question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Leaflet + noWrap option not working in above 1.x version

See original GitHub issue
  • I am working in leaflet map chart. I tried to implement the nowrap option but its not working. -When i am using this theme “http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png” its working but when i tried to use dark theme not working. same code working in 0.x version.
var map = L.map('map', {
    worldCopyJump: true,
    inertia: false
}).fitWorld();

//  OSM tiles
//http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
// L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
L.tileLayer('http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',
{
     maxZoom: 18,
   //  continuousWorld: false,
     noWrap: true
}).addTo(map);

Using http://jsfiddle.net/rajinikumarr/JKFgD/46/.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
IvanSanchezcommented, Dec 1, 2016

So with those options, Leaflet is asking the following tiles:

http://a.basemaps.cartocdn.com/dark_all/0/-2/0.png (404)
http://a.basemaps.cartocdn.com/dark_all/0/-1/0.png (404)
http://a.basemaps.cartocdn.com/dark_all/0/0/0.png (OK)
http://a.basemaps.cartocdn.com/dark_all/0/1/0.png (OK)
http://a.basemaps.cartocdn.com/dark_all/0/2/0.png (OK)

So the noWrap behaviour is working as expected: the X tile coordinate does not wrap around the earth. The fact that the CartoDB tiles work for positive Xs and return 404s for negative Xs is a particular of that tileserver, and not a Leaflet bug.

I’d rather go using the maxBounds option for this.

Leaflet code working as expected → closing.

0reactions
perliedmancommented, Jul 23, 2017

@Kostanos but from the code example you posted above, you haven’t told Leaflet about the bounds. How should it know that -1 is outside your bounds?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leaflet + noWrap option not working in above 1.x version
I am working in leaflet map chart. I tried to implement the nowrap option but its not working. please anyone suggest to solve...
Read more >
Leaflet + Nowrap Option Not Working In Above 1.X ... - ADocLib
The following plugins allow loading different maps and provide functionality to tile and The plugin provides 96 daily updated layers with satellite imagery...
Read more >
Documentation - a JavaScript library for interactive maps
Check this list if you are using a different version of Leaflet. Map. Usage example; Creation; Options; Events. Map Methods. Modifying map state;...
Read more >
Having issues with Leaflet + GIBS + EPSG4326
After upgrading to a newer version, I've just run into a series of issues. I'm hoping someone can help me finally sort this...
Read more >
Issues for Leaflet | Drupal.org
Fullscreen library not loading when using leafletRenderMap ... feature lost since 1.3 version, Needs work, Normal, Feature request, 8.x-1.x-dev, Code ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found