这个五角大楼示例显示可以在多边形内添加孔:http ://code.google.com/p/gmaps-samples-v3/source/browse/trunk/poly/pentagon.html?r=40
我想在一个圆圈内添加一个洞。
目前我正在通过制作一个圆形多边形并设置内部和外部边界来模仿这一点,它工作正常,但是代码非常长,因为地图中有大约 15 个圆圈。
任何帮助将非常感激
谢谢!
这个五角大楼示例显示可以在多边形内添加孔:http ://code.google.com/p/gmaps-samples-v3/source/browse/trunk/poly/pentagon.html?r=40
我想在一个圆圈内添加一个洞。
目前我正在通过制作一个圆形多边形并设置内部和外部边界来模仿这一点,它工作正常,但是代码非常长,因为地图中有大约 15 个圆圈。
任何帮助将非常感激
谢谢!
I didn't find anything for the Circle class, but someone has figured out a function that will reduce your code size. It does the same thing you are doing, creating polygons shaped like a circle.
http://www.geocodezip.com/v3_polygon_example_donut.html
The function drawCircle(point, radius, dir) uses dir to distinguish positive space and holes. You have to alternate them to create holes.