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.

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:
  1. npm i leaflet -S
  2. import L from 'leaflet'
  3. import 'leaflet-path-transform'
  4. 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
DonNicoJscommented, Jan 25, 2019

@boolinlin you can also be sure by adding a webpack alias and so forcing one single instance of leaflet no matter what.

1reaction
DonNicoJscommented, Nov 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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