gint
champlain_map_source_get_max_zoom_level (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->max_zoom_level;
}
gint
champlain_map_source_get_min_zoom_level (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->min_zoom_level;
}
guint
champlain_map_source_get_tile_size (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->tile_size;
}
gint zoom_level,
gdouble longitude)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
return ((longitude + 180.0) / 360.0 * pow(2.0, zoom_level)) * priv->tile_size;
gint zoom_level,
gdouble latitude)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
return ((1.0 - log (tan (latitude * M_PI / 180.0) + 1.0 /
champlain_map_source_get_row_count (ChamplainMapSource *map_source,
gint zoom_level)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
return pow (2, zoom_level);
champlain_map_source_get_column_count (ChamplainMapSource *map_source,
gint zoom_level)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
return pow (2, zoom_level);
gint zoom_level,
guint x)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
gdouble dx = (float)x / champlain_map_source_get_tile_size (map_source);
gint zoom_level,
guint y)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
//ChamplainMapSourcePrivate *priv = map_source->priv;
// FIXME: support other projections
gdouble dy = (float)y / champlain_map_source_get_tile_size (map_source);
const gchar *
champlain_map_source_get_name (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->name;
}
champlain_map_source_set_name (ChamplainMapSource *map_source,
const gchar *name)
{
+ g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
+
ChamplainMapSourcePrivate *priv = map_source->priv;
g_free (priv->name);
const gchar *
champlain_map_source_get_license (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->license;
}
champlain_map_source_set_license (ChamplainMapSource *map_source,
const gchar *license)
{
+ g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
+
ChamplainMapSourcePrivate *priv = map_source->priv;
g_free (priv->license);
const gchar *
champlain_map_source_get_license_uri (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->license_uri;
champlain_map_source_set_license_uri (ChamplainMapSource *map_source,
const gchar *license_uri)
{
+ g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
+
ChamplainMapSourcePrivate *priv = map_source->priv;
g_free (priv->license_uri);
champlain_map_source_set_projection (ChamplainMapSource *map_source,
ChamplainMapProjection projection)
{
+ g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
+
ChamplainMapSourcePrivate *priv = map_source->priv;
priv->map_projection = projection;
const gchar *
champlain_map_source_get_id (ChamplainMapSource *map_source)
{
+ g_return_val_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source), 0);
+
ChamplainMapSourcePrivate *priv = map_source->priv;
return priv->id;
}
champlain_map_source_set_id (ChamplainMapSource *map_source,
const gchar *id)
{
+ g_return_if_fail (CHAMPLAIN_IS_MAP_SOURCE (map_source));
+
ChamplainMapSourcePrivate *priv = map_source->priv;
g_free (priv->id);