Use Swisstopo Map as Overlay in Googlemaps

441 views
Skip to first unread message

Mario Kaufmann

unread,
Apr 13, 2018, 7:42:23 AM4/13/18
to GeoAdmin API
Hi

Does someone know if it is possible to add a Swisstopo Map as overlay in Googlemaps?
I have found this post but don't know if it is up to date: https://groups.google.com/forum/#!topic/geoadmin-api/vzGYM3u2JXE

Does someone have a working solution or code for that?

David Oesch

unread,
Apr 14, 2018, 8:08:21 AM4/14/18
to GeoAdmin API
post is up to date 


--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mario Kaufmann

unread,
Apr 14, 2018, 9:17:16 AM4/14/18
to GeoAdmin API
Ok, thanks


Am Samstag, 14. April 2018 14:08:21 UTC+2 schrieb David Oesch:
post is up to date 

On Fri, Apr 13, 2018 at 1:42 PM, Mario Kaufmann <marioka...@gmail.com> wrote:
Hi

Does someone know if it is possible to add a Swisstopo Map as overlay in Googlemaps?
I have found this post but don't know if it is up to date: https://groups.google.com/forum/#!topic/geoadmin-api/vzGYM3u2JXE

Does someone have a working solution or code for that?

--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.

Mario Kaufmann

unread,
May 6, 2018, 4:51:52 PM5/6/18
to GeoAdmin API
Hi

In your example "http://www.procrastinatio.org/mercator/google.html" is a problem with some tiles: When i zoom into the map, partly single tiles don't load and appears as grey tile. When i zoom to the maximum it doesnt load any tiles and only a grey area appears. Does somebody know how i can solve this issue?

Loïc Gasser

unread,
May 7, 2018, 9:16:52 AM5/7/18
to geoadm...@googlegroups.com
Hi,

here is an updated version on codepen.


You have to play with the min and max zoom levels of these layers.

Check these out in the example above.

Loïc Gasser





--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api+unsubscribe@googlegroups.com.

Marc Monnerat

unread,
May 8, 2018, 7:21:14 AM5/8/18
to geoadmin-api
Hello,

you have to set a maxZoom, the max zoom level the WMTS server is serving. See the WMTS GetCapabilities (https://wmts.geo.admin.ch/EPSG/3857/1.0.0/WMTSCapabilities.xml), for instance it is 21 for the orthophotos (ch.swisstopo.swissimage). And use current as timestamp (or anything specified in the Dimension of the above mentioned document)

     var OrthophotoType = new google.maps.ImageMapType({
         maxZoom: 21,
         minZoom: 7,
         name: "Orthophoto",
         tileSize: new google.maps.Size(256, 256),
         credit: 'swisstopo',
         getTileUrl: function(coord, zoom) {
                     return BASE_URL +  '/1.0.0/ch.swisstopo.swissimage/default/current/3857/'+ zoom + "/" + coord.x + "/" + coord.y + ".jpeg";
                 }
   });


Regards,

Marc


--
-- ἡ φύσις οὐδὲν ποιεῖ ἅλματα.
Reply all
Reply to author
Forward
0 new messages