Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had my map working with worldCopyJump set to true, but then it stopped working. I'm not sure exactly what broke it (the original form of this question said there was a connection to a plugin, but that doesn't seem to be the case), but it might be that I updated to Leaflet 0.62.

In any case, this is the problem: when the map loads, dragging the map would throw a bunch of errors claiming to have invalid LatLong objects (with a NaN instead of the longitude), and the map would freeze.

Oddly enough, if before dragging the map I zoomed in or out, and then dragged, everything would work fine. Whatever the map is doing during onzoom seems to be somehow fixing whatever problem it had.

Also peculiar is the LatLongs that are reported to be invalid: they are nowhere in the code. I have no idea where those numbers might be coming from.

I traced the error back to the worldCopyJump option. If this is set to false then the map works from the get go. But I need that option turned on. Can anybody think of what might be going on?

You can find a (non-)functional version of the map online here.

In case that does not last, here's the code:

<html xmlns="">
  <link rel="stylesheet" href="" />
  <script src="//" ></script>
  <script src=""></script>
    html, body, #map { width: 100%; height: 100%; margin: 0; padding: 0; }
<div id="map"></div>
<script type="text/javascript">
  var map ='map',{
        center: [35.67989, 139.76463],
        zoom: 2,
//         Set followign line to false or comment out to fix problem
        worldCopyJump: true,

  L.tileLayer('http://{s}{key}/{styleId}/256/{z}/{x}/{y}.png', {
    styleId: 97789,
    maxZoom: 18

  L.marker([50.5, 30.5]).addTo(map);
share|improve this question
Turns out this has nothing to do with the MarkerCluster plugin in the end. I still have no idea why it's not working, but I kept on trimming down the code, removed the GeoJSON, removed the references to the plugin, even removed the layer control... all to no avail. I updated the code in the question to reflect these changes, and the online version has them as well. Still lost though... – jja Jul 4 '13 at 21:41
Indeed, going back to Leaflet 0.5 fixes the problem. Not sure if this is a bug or if I'm using something wrong, though... – jja Jul 4 '13 at 21:59
Filed a bug report and a solution has been added. See – jja Jul 5 '13 at 10:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.