Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Leaflet with WMTS server?

Is it possible to use Leaflet javascript library to show map data from a WMTS (Web Map Tile Service) based server? Leaflet doesn't seem to support WMTS out of the box, but are there any plugins for that?

like image 481
Juha Syrjälä Avatar asked Sep 17 '12 20:09

Juha Syrjälä


People also ask

What is the difference between WMS and Wmts?

A WMS is calculated on the server side and delivers one image per request. A WMTS delivers tiles that have been pre-renderd on the server side, and cached on the client side. This will reduce waiting time for the data and bandwith.

How do you use WMS in leaflet?

And the way to use that in a Leaflet map is simply: var map = L. map(mapDiv, mapOptions); var wmsLayer = L. tileLayer.

What is WMS layer?

The OGC Web Map Service (WMS) is a map portrayal service used to publish a collection of map layers to embed in your interactive web maps. The WMS specification expresses the map contents as map layers using XML. The primary use of the WMS is to openly serve interactive map images on the internet.


1 Answers

You can use the L.TileLayer.WMTS class as implemented here: http://depot.ign.fr/geoportail/api/develop/tech-docs-js/examples/js/geoportalLeaflet.js

Here is the result: http://depot.ign.fr/geoportail/api/develop/tech-docs-js/examples/geoportalLeaflet.html

like image 149
ebrehault Avatar answered Oct 19 '22 12:10

ebrehault