champlain_map_source_new_osm_cyclemap (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full (CHAMPLAIN_MAP_SOURCE_OSM_CYCLE_MAP,
+ "OpenStreetMap Cycle Map",
"(CC) BY 2.0 OpenStreetMap contributors",
"http://creativecommons.org/licenses/by/2.0/", 0, 18, 256,
CHAMPLAIN_MAP_PROJECTION_MERCATOR,
champlain_map_source_new_osm_osmarender (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full (CHAMPLAIN_MAP_SOURCE_OSM_OSMARENDER,
+ "OpenStreetMap Osmarender",
"(CC) BY 2.0 OpenStreetMap contributors",
"http://creativecommons.org/licenses/by/2.0/", 0, 18, 256,
CHAMPLAIN_MAP_PROJECTION_MERCATOR,
static ChamplainMapSource *
champlain_map_source_new_osm_mapnik (void)
{
- return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("OpenStreetMap Mapnik",
+ return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full (CHAMPLAIN_MAP_SOURCE_OSM_MAPNIK,
+ "OpenStreetMap Mapnik",
"(CC) BY 2.0 OpenStreetMap contributors",
"http://creativecommons.org/licenses/by/2.0/", 0, 18, 256,
CHAMPLAIN_MAP_PROJECTION_MERCATOR,
champlain_map_source_new_oam (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full (CHAMPLAIN_MAP_SOURCE_OAM,
+ "OpenAerialMap",
"(CC) BY 3.0 OpenAerialMap contributors",
"http://creativecommons.org/licenses/by/3.0/", 0, 17, 256,
CHAMPLAIN_MAP_PROJECTION_MERCATOR,
champlain_map_source_new_mff_relief (void)
{
return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full (CHAMPLAIN_MAP_SOURCE_MFF_RELIEF,
+ "Maps for Free Relief",
"Map data available under GNU Free Documentation license, Version 1.2 or later",
"http://www.gnu.org/copyleft/fdl.html", 0, 11, 256,
CHAMPLAIN_MAP_PROJECTION_MERCATOR,
enum
{
PROP_0,
+ PROP_ID,
PROP_NAME,
PROP_LICENSE,
PROP_LICENSE_URI,
struct _ChamplainMapSourcePrivate
{
+ gchar *id;
gchar *name;
gchar *license;
gchar *license_uri;
switch(prop_id)
{
+ case PROP_ID:
+ g_value_set_string (value, priv->id);
+ break;
case PROP_NAME:
g_value_set_string (value, priv->name);
break;
switch(prop_id)
{
+ case PROP_ID:
+ champlain_map_source_set_id (map_source,
+ g_value_get_string (value));
case PROP_NAME:
champlain_map_source_set_name (map_source,
g_value_get_string (value));
klass->fill_tile = champlain_map_source_real_fill_tile;
+ /**
+ * ChamplainMapSource:id:
+ *
+ * The name of the map source
+ *
+ * Since: 0.4
+ */
+ pspec = g_param_spec_string ("id",
+ "Id",
+ "The id of the map source",
+ "",
+ (G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class, PROP_ID, pspec);
+
/**
* ChamplainMapSource:name:
*
g_object_notify (G_OBJECT (map_source), "projection");
}
+/**
+ * champlain_map_source_get_id:
+ * @map_source: a #ChamplainMapSource
+ *
+ * Returns the map source's id.
+ *
+ * Since: 0.4
+ */
+const gchar *
+champlain_map_source_get_id (ChamplainMapSource *map_source)
+{
+ ChamplainMapSourcePrivate *priv = map_source->priv;
+ return priv->id;
+}
+
+/**
+ * champlain_map_source_set_id:
+ * @map_source: a #ChamplainMapSource
+ * @id: a id
+ *
+ * Sets the map source's id.
+ *
+ * Since: 0.4
+ */
+void
+champlain_map_source_set_id (ChamplainMapSource *map_source,
+ const gchar *id)
+{
+ ChamplainMapSourcePrivate *priv = map_source->priv;
+
+ g_free (priv->id);
+ priv->id = g_strdup (id);
+ g_object_notify (G_OBJECT (map_source), "id");
+}
+
void champlain_map_source_fill_tile (ChamplainMapSource *map_source,
ChamplainTile *tile);
+void champlain_map_source_set_id (ChamplainMapSource *map_source,
+ const gchar *id);
+const gchar * champlain_map_source_get_id (ChamplainMapSource *map_source);
+
void champlain_map_source_set_name (ChamplainMapSource *map_source,
const gchar *name);
const gchar * champlain_map_source_get_name (ChamplainMapSource *map_source);
* Since: 0.4
*/
ChamplainNetworkMapSource*
-champlain_network_map_source_new_full (const gchar *name,
+champlain_network_map_source_new_full (const gchar *id,
+ const gchar *name,
const gchar *license,
const gchar *license_uri,
guint min_zoom,
const gchar *uri_format)
{
ChamplainNetworkMapSource * source;
- source = g_object_new (CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE, "name", name,
- "license", license, "license-uri", license_uri,
+ source = g_object_new (CHAMPLAIN_TYPE_NETWORK_MAP_SOURCE, "id", id,
+ "name", name, "license", license, "license-uri", license_uri,
"min-zoom-level", min_zoom, "max-zoom-level", max_zoom,
"tile-size", tile_size, "projection", projection,
"uri-format", uri_format, NULL);
GType champlain_network_map_source_get_type (void);
-ChamplainNetworkMapSource* champlain_network_map_source_new_full (
- const gchar *name, const gchar *license, const gchar *license_uri,
- guint min_zoom, guint max_zoom, guint tile_size,
- ChamplainMapProjection projection, const gchar *uri_format);
+ChamplainNetworkMapSource* champlain_network_map_source_new_full (const gchar *id,
+ const gchar *name,
+ const gchar *license,
+ const gchar *license_uri,
+ guint min_zoom,
+ guint max_zoom,
+ guint tile_size,
+ ChamplainMapProjection projection,
+ const gchar *uri_format);
gchar * champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *source,
gint x,