X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/f66ea3ec5e1e1acf57becf69b99584c405b56d6e..9dcc92cc353c190e0031143b59695582ef329ab4:/src/terraservermapsource.c diff --git a/src/terraservermapsource.c b/src/terraservermapsource.c index 9ec86fe3..5701a420 100644 --- a/src/terraservermapsource.c +++ b/src/terraservermapsource.c @@ -29,13 +29,15 @@ static gboolean _coord_to_mapcoord ( VikMapSource *self, const VikCoord *src, gdouble xzoom, gdouble yzoom, MapCoord *dest ); static void _mapcoord_to_center_coord ( VikMapSource *self, MapCoord *src, VikCoord *dest ); +static gboolean _is_direct_file_access ( VikMapSource *self ); +static gboolean _is_mbtiles ( VikMapSource *self ); static gchar *_get_uri( VikMapSourceDefault *self, MapCoord *src ); static gchar *_get_hostname( VikMapSourceDefault *self ); static DownloadMapOptions *_get_download_options( VikMapSourceDefault *self ); /* FIXME Huge gruik */ -static DownloadMapOptions terraserver_options = { FALSE, FALSE, NULL, 0, a_check_map_file }; +static DownloadMapOptions terraserver_options = { FALSE, FALSE, NULL, 0, a_check_map_file, NULL, NULL }; typedef struct _TerraserverMapSourcePrivate TerraserverMapSourcePrivate; struct _TerraserverMapSourcePrivate @@ -122,7 +124,7 @@ static void terraserver_map_source_class_init (TerraserverMapSourceClass *klass) { GObjectClass* object_class = G_OBJECT_CLASS (klass); - VikMapSourceClass* granparent_class = VIK_MAP_SOURCE_CLASS (klass); + VikMapSourceClass* grandparent_class = VIK_MAP_SOURCE_CLASS (klass); VikMapSourceDefaultClass* parent_class = VIK_MAP_SOURCE_DEFAULT_CLASS (klass); GParamSpec *pspec = NULL; @@ -130,8 +132,10 @@ terraserver_map_source_class_init (TerraserverMapSourceClass *klass) object_class->get_property = terraserver_map_source_get_property; /* Overiding methods */ - granparent_class->coord_to_mapcoord = _coord_to_mapcoord; - granparent_class->mapcoord_to_center_coord = _mapcoord_to_center_coord; + grandparent_class->coord_to_mapcoord = _coord_to_mapcoord; + grandparent_class->mapcoord_to_center_coord = _mapcoord_to_center_coord; + grandparent_class->is_direct_file_access = _is_direct_file_access; + grandparent_class->is_mbtiles = _is_mbtiles; parent_class->get_uri = _get_uri; parent_class->get_hostname = _get_hostname; @@ -206,6 +210,18 @@ _coord_to_mapcoord ( VikMapSource *self, const VikCoord *src, gdouble xmpp, gdou return TRUE; } +static gboolean +_is_direct_file_access ( VikMapSource *self ) +{ + return FALSE; +} + +static gboolean +_is_mbtiles ( VikMapSource *self ) +{ + return FALSE; +} + static void _mapcoord_to_center_coord ( VikMapSource *self, MapCoord *src, VikCoord *dest ) { @@ -246,7 +262,26 @@ _get_download_options( VikMapSourceDefault *self ) } TerraserverMapSource * -terraserver_map_source_new_with_id (guint8 id, const char *label, int type) +terraserver_map_source_new_with_id (guint16 id, const char *label, int type) { - return g_object_new(TERRASERVER_TYPE_MAP_SOURCE, "id", id, "label", label, "type", type, NULL); + char *copyright = NULL; + switch (type) + { + case 1: + copyright = "© DigitalGlobe"; + break; + case 2: + copyright = "© LandVoyage"; + break; + case 4: + copyright = "© DigitalGlobe"; + break; + default: + g_critical("Houston, we've had a problem. type=%d", type); + } + + return g_object_new(TERRASERVER_TYPE_MAP_SOURCE, + "id", id, "label", label, "type", type, + "copyright", copyright, + NULL); }