New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getLatLngs used with polygon does not return array #5212
Comments
jsfiddle is here https://jsfiddle.net/qccxwp64/2/ |
The return value of This is done in Leaflet/src/layer/vector/Polygon.js Line 106 in b1c2e99
LatLng s. Simply use polygon.getLatLngs()[0] to get the LatLng s of the outer (and only) ring.
|
This explains everything, thank you very much! |
Shouldn't the official documentation http://leafletjs.com/reference-1.0.3.html#polyline-getlatlngs be changed to indicate something else than |
How to reproduce
Leaflet version I'm using: 1.0.2
Browser (with version) I'm using: Chrome & FF
OS/Platform (with version) I'm using: Windows 10
What behaviour I'm expecting and which behaviour I'm seeing
getLatLngs used with polygon does not return array, but LatLngs as string. If used with polyline array of LatLng is returned. This worked fine with 0.7.7 version.
Minimal example reproducing the issue
Using http://playground-leaflet.rhcloud.com/ or any other jsfiddle like site.
The text was updated successfully, but these errors were encountered: