diff --git a/examples/clients/leaflet/geojson-tile-layer.js b/examples/clients/leaflet/geojson-tile-layer.js index c289ee5..f3e99c2 100644 --- a/examples/clients/leaflet/geojson-tile-layer.js +++ b/examples/clients/leaflet/geojson-tile-layer.js @@ -32,12 +32,13 @@ updateLayers: function(url, geoData) { if (geoData.type == 'FeatureCollection'){ - for (var i=0;i this.options.maxZoom) || + (this.options.minZoom && zoom < this.options.minZoom)) { + this.map.removeLayer(this.layer); + } else { + this.map.addLayer(this.layer); + } + }, + }); L.geoJSONTileLayer = function (url, options) { diff --git a/examples/clients/leaflet/vanilla.html b/examples/clients/leaflet/vanilla.html index bb91c9a..cb83e9b 100644 --- a/examples/clients/leaflet/vanilla.html +++ b/examples/clients/leaflet/vanilla.html @@ -28,6 +28,7 @@ }).addTo(mymap); L.geoJSONTileLayer('http://localhost:8000/src/geojson/countries?filter=id,lt,3&tile={z},{x},{y}', { + minZoom: 3, maxZoom: 18, }).addTo(mymap);