Setting map center to L.LatLng(Infinity, Infinity) causes infinite loop
See original GitHub issueHow 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:
- Created 6 years ago
- Comments:17 (13 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 😝😝😝
Hi! I had the same problem like u guys Uncaught Error: Attempted to load an infinite number of tiles when using proj4leaflet js.