X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/a3319e114fd4cba45156dc0150ee0c629185bb9f..8e7bf2f684e122505fa081216f05ac72a81b76be:/src/viktmsmapsource.c?ds=sidebyside diff --git a/src/viktmsmapsource.c b/src/viktmsmapsource.c index 6d8e591e..afaed4de 100644 --- a/src/viktmsmapsource.c +++ b/src/viktmsmapsource.c @@ -16,6 +16,22 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + + /** + * SECTION:viktmsmapsource + * @short_description: the class for TMS oriented map sources + * + * The #VikTmsMapSource class handles TMS oriented map sources. + * + * The tiles are in 'equirectangular'. + * http://en.wikipedia.org/wiki/Equirectangular_projection + * + * Such service is also a type of TMS (Tile Map Service) as defined in + * OSGeo's wiki. + * http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification + * Following this specification, the protocol handled by this class + * follows the global-geodetic profile. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -30,7 +46,8 @@ 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 _supports_download_only_new (VikMapSource *self ); +static gboolean _supports_download_only_new ( VikMapSource *self ); +static gboolean _is_direct_file_access ( VikMapSource *self ); static gchar *_get_uri( VikMapSourceDefault *self, MapCoord *src ); static gchar *_get_hostname( VikMapSourceDefault *self ); @@ -190,6 +207,7 @@ vik_tms_map_source_class_init (VikTmsMapSourceClass *klass) grandparent_class->coord_to_mapcoord = _coord_to_mapcoord; grandparent_class->mapcoord_to_center_coord = _mapcoord_to_center_coord; grandparent_class->supports_download_only_new = _supports_download_only_new; + grandparent_class->is_direct_file_access = _is_direct_file_access; parent_class->get_uri = _get_uri; parent_class->get_hostname = _get_hostname; @@ -265,8 +283,14 @@ static gint tms_zoom ( gdouble mpp ) { return 255; } -gboolean -_supports_download_only_new (VikMapSource *self) +static gboolean +_is_direct_file_access ( VikMapSource *self ) +{ + return FALSE; +} + +static gboolean +_supports_download_only_new ( VikMapSource *self ) { g_return_val_if_fail (VIK_IS_TMS_MAP_SOURCE(self), FALSE); @@ -325,11 +349,6 @@ _get_uri( VikMapSourceDefault *self, MapCoord *src ) g_return_val_if_fail (VIK_IS_TMS_MAP_SOURCE(self), NULL); VikTmsMapSourcePrivate *priv = VIK_TMS_MAP_SOURCE_PRIVATE(self); - gdouble socalled_mpp; - if (src->scale >= 0) - socalled_mpp = GZ(src->scale); - else - socalled_mpp = 1.0/GZ(-src->scale); /* We should restore logic of viking: * tile index on Y axis follow a screen logic (top -> down) */