angularjs-google-maps
angularjs-google-maps copied to clipboard
ngmap shape directive doesn't handle polygons with holes
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
I am not sure this is supported by Google Maps Polygon object
it works with the google map javascript api: https://plnkr.co/edit/at4HhJhRhjCMvalJWLEI?p=preview
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
Is there any volunteer to take care of this? I can start digging into it, but not sooner.
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
any timeline on when the pull request is going to be accepted? we really need this as well :)
There is no PR made that I find. PR is made to sebas-nicholls/angularjs-google-maps
, not to allenhwkim/angularjs-google-maps
#733 Pull request to fix issue
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?