Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

leaflet.js disable duplicated world maps

Tags:

leaflet

We need to disable duplicated world maps at the left and right side of the main world map, which is showing by default. Problem is that we need exact zoom level there and sometimes leaflet showing duplicates... Is it possible to remove duplicates at all?

like image 692
nvvetal Avatar asked Dec 17 '13 15:12

nvvetal


1 Answers

You will disable the noWrap property of your TiledLayer (which extends GridLayer). Documentation here

var layer = new L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {     noWrap: true }); 
like image 121
Patrick D Avatar answered Sep 22 '22 10:09

Patrick D