toBounds function is not working properly
See original GitHub issue- I’m reporting a bug, probably asking for help too;
How to reproduce
- Leaflet version I’m using: 1.3.4
- Browser (with version) I’m using: Chrome and others too
- OS/Platform (with version) I’m using: macOS Movaje 10.14
- Steps:
npm i leaflet -S
import L from 'leaflet'
import 'leaflet-path-transform'
- created a polygon and added to map by
polygon.addTo(map)
What behaviour I’m expecting and which behaviour I’m seeing
throws
'TypeError: Cannot read property 'x' of undefined
at Bounds.intersects
'
I have debugged step by step and I found the toBounds
function is not working properly.
function toBounds(a, b) {
if (!a || a instanceof Bounds) {
return a;
}
return new Bounds(a, b);
}
Here even a
is valid bounds a instanceof Bounds
is returning false
and returning new Bounds(a, b)
which b
is undefined
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
Center Map to Bounds not working - Stack Overflow
Try this way: Declare your bounds variable outside of the initialize function scope (that is where you define your marker and markers variables) ......
Read more >Issue with Google Maps-API: fit_bounds does not work
I currently have some issues with the Google Maps API when trying to set the map to bounds. I created a bound which...
Read more >User blog:Ytosk/Small improvements to bounds on values of Rayo's ...
Almost two years ago, i posted a bound for values of Rayo's function: Rayo(266+20n) > 2↑↑n. Since then, not much has happened.
Read more >A Reflective Newton Method for Minimizing a Quadratic ...
We propose a new algorithm, a reflective Newton method, for the minimization of a quadratic function of many variables subject to upper arid...
Read more >Package test failing due to bounds checking enabled
If I manually run the test from the command line with --check-bounds=no (or ... the @simd macro stops working, and this macro is...
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
@boolinlin you can also be sure by adding a webpack alias and so forcing one single instance of leaflet no matter what.
Chiming here too since I am working on the wrapper.
I don’t think is an issue in leaflet itself, and even by removing instanceOf it may create other, even more hidden bugs. We can continue on the issue in vue2-leaflet I think.