hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

Holes property for polygon #105

Closed kristjanbrand closed 6 years ago

kristjanbrand commented 6 years ago

Hey!

Is there support for holes inside a polygon? Tried to make it work but looks like it's not supported or it is using some other parameter for it.

Otherwise very nice module and thank you for developing it!

hansemannn commented 6 years ago

Hey there! Just added the property here. Pass it via the holes property which is an array for latitude/longitude dictionaries - see reamde for more infos.

kristjanbrand commented 6 years ago

Hey! Thanks for a fast reply! Downloaded the latest release but sadly it is not working.

My code: var polygon = maps.createPolygon({ points : [[85, -180], [85, 0], [85, 180], [-85, 180], [-85, 0], [-85, -180], [85, -180]], strokeWidth : 0, fillColor : '#48000000', strokeColor : '#48000000', title: 'My Polygon', holes: [ {latitude: 25.774, longitude: -80.190}, {latitude: 18.466, longitude: -66.118}, {latitude: 32.321, longitude: -64.757}, {latitude: 25.774, longitude: -80.190} ], });

This is supposed to create a polygon on whole map with hole in bermuda triangle. Polygon is created but no hole is present. Am i missing something?

Edit: Also it would be awesome if it would support [18.466, -66.118] array as "Points" property is supporting.