How to draw polygons with multiple paths using DrawingManager class?

267 views
Skip to first unread message

Faheem Ramzan

unread,
Nov 24, 2011, 3:28:34 PM11/24/11
to google-map...@googlegroups.com
Hi,

When drawing polygon using the DrawingLibrary apis, it doesn't seems to add multiple paths (polygon with holes) in the polygon using drawing library. 

In there documentation regarding polygonOptions in DrawingManagerOptions it has written that:
"Options to apply to any new polygons created with this DrawingManager. The paths property is 
ignored, and the map property of a new polygon is always set to the DrawingManager's map."

I am not sure why the paths property is ignored, does that mean ithere is no support for multiple paths using DrawingManager class?

Best Regards,
Faheem

Enoch Lau (Google Employee)

unread,
Nov 24, 2011, 10:53:55 PM11/24/11
to google-map...@googlegroups.com
Indeed, there is no support for drawing multiple paths using DrawingManager. You can approximate drawing multiple paths by having the user draw two polygons, taking the path from the second polygon and adding it as the second path on the first polygon.

Feel free to add a feature request, where you should outline your use case for drawing polygons with multiple paths.

Enoch

Faheem Ramzan

unread,
Nov 25, 2011, 4:45:00 AM11/25/11
to google-map...@googlegroups.com
Thanks for the reply, but the suggestion you provided will not work if we want to show holes in the polygon, please see the attached picture what i exactly want. Can you achieve this by using any way, currently we have custom solution, but really want the support in the drawing library so we can switch to it.

I have added the feature request for it as well.

Thanks,
Faheem
Multipath polygon.png
Reply all
Reply to author
Forward
0 new messages