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.

Setting map center to L.LatLng(Infinity, Infinity) causes infinite loop

See original GitHub issue

How to reproduce

  • Leaflet version I’m using: master, 1.0.3
  • Browser (with version) I’m using: Chrome, Firefox (latest versions)
  • OS/Platform (with version) I’m using: Windows 8.1

What behavior I’m expecting and which behavior I’m seeing

I expect that passing Infinity in to the L.LatLng constructor like this new L.LatLng(Infinity, Infinity); would throw an error. Instead this is allowed and is causing the browser to freeze when adding a tile layer, for example.

Minimal example reproducing the issue

Beware, this will freeze your browser Example - http://playground-leaflet.rhcloud.com/qem/edit?html,output

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
IvanSanchezcommented, Apr 26, 2017

@theashyster Hey, you wanted Leaflet to throw an error instead of getting stuck in an infinite loop, and you got errors instead of infinite loops, don’t complain now 😝😝😝

2reactions
zhen1991commented, Apr 4, 2018

Hi! I had the same problem like u guys Uncaught Error: Attempted to load an infinite number of tiles when using proj4leaflet js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Maps API v3 not loading without fitbounds ...
What I was missing from the answer from my previous question was that an initial zoom level and center has to be set....
Read more >
Leaflet - a JavaScript library for interactive maps
Runs the given function fn when the map gets initialized with a view (center and zoom) and at least one layer, or immediately...
Read more >
File: js/leaflet-src.js
Auxiliary data. js/leaflet-src.js This package can manage a Leaflet based map with locations in MySQL. It manages information stored in MySQL database to...
Read more >
leaflet源码下载
Zoom/pan options): this // Sets the view of the map (geographical center and ... log = -Infinite, // thus triggering an infinite loop...
Read more >
Untitled
Tier 2 brands, Lilka slimakova, Floacist feel good, Star wars jedi academy cheats steam, L 3314-10, Easy riser cushion, Octodad shorts squid?
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