]> git.street.me.uk Git - andy/viking.git/blobdiff - src/viktmsmapsource.c
help/Makefile.am: explicitly list figures.
[andy/viking.git] / src / viktmsmapsource.c
index 6d8e591e80d09b0cda2cfbe16007e536d0f79c85..afaed4def651169e8d6f44d997039c4c615053cf 100644 (file)
  * You should have received a copy of the GNU General Public License along
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+
+ /**
+  * 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)
      */