angularjs-google-maps icon indicating copy to clipboard operation
angularjs-google-maps copied to clipboard

ngmap shape directive doesn't handle polygons with holes

Open manderhalt opened this issue 9 years ago • 9 comments

For GeoJSON type "Polygon", the "coordinates" member must be an array of LinearRing coordinate arrays. For Polygons with multiple rings, the first must be the exterior ring and any others must be interior rings or holes.

In ngmap, "paths" attributes of polygons takes only the first array of LinearRing. So the following structures for polygons with holes is not supported: [ [ [ ],[ ],[ ]],[ [ ],[ ],[ ] ] ]

https://plnkr.co/edit/FexkP44EYifHUtftud8m?p=preview

manderhalt avatar Feb 13 '16 12:02 manderhalt

I am not sure this is supported by Google Maps Polygon object

allenhwkim avatar Feb 13 '16 14:02 allenhwkim

it works with the google map javascript api: https://plnkr.co/edit/at4HhJhRhjCMvalJWLEI?p=preview

manderhalt avatar Feb 13 '16 14:02 manderhalt

It seems an array of Lat/Lngs in an array are not converted properly. i.e., [[LatLng,LatLng], [LatLng,LatLng]] is converted to [LatLng, LatLng]

It means any element in an array is converted to LatLng, which is a bug.

Thanks for finding this @manderhalt

allenhwkim avatar Feb 14 '16 13:02 allenhwkim

Is there any volunteer to take care of this? I can start digging into it, but not sooner.

allenhwkim avatar Feb 29 '16 01:02 allenhwkim

This would be super helpful for a project I'm working on right now. Have you identified where in the code this is happening? I might be able to spend some time to fix it

bradorego avatar Oct 04 '16 16:10 bradorego

any timeline on when the pull request is going to be accepted? we really need this as well :)

csaxton avatar Oct 12 '16 14:10 csaxton

There is no PR made that I find. PR is made to sebas-nicholls/angularjs-google-maps, not to allenhwkim/angularjs-google-maps

allenhwkim avatar Oct 12 '16 15:10 allenhwkim

#733 Pull request to fix issue

sebas-nicholls avatar Dec 07 '16 15:12 sebas-nicholls

Thanks for working on this. I just downloaded the latest and I'm still having issues. What format should the paths be? [[[lat, lng], [lat, lng]], [[lat, lng], [lat, lng]], [[lat, lng], [lat, lng]]]? This is what I would expect, but maybe it was changed with the update?

acadotte avatar Dec 09 '16 02:12 acadotte