如何添加"孔"为圆区(谷歌地图API V3) [英] How to add a "hole" to a Circle Polygon (Google Maps API V3)

查看:200
本文介绍了如何添加"孔"为圆区(谷歌地图API V3)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此五角大楼的例子显示了孔可多边形内部添加:的http://$c$c.google.com/p/gmaps-samples-v3/source/browse/trunk/poly/pentagon.html?r=40

This Pentagon example shows holes can be added inside a Polygon: http://code.google.com/p/gmaps-samples-v3/source/browse/trunk/poly/pentagon.html?r=40

我想补充一个圆圈里面一个洞。

I would like to add a hole inside a circle.

目前,我通过一个圆形的多边形,并把内部和外部边界在它模仿这一点,它工作正常,然而code极长看到的地图有〜15圈。

Currently I am mimicking this by making a circle shape polygon and putting inner and outer bounds and it is working fine, however the code is extremely long seeing as the map has ~15 circles in it.

任何帮助将是非常美联社preciated

Any help would be much appreciated

谢谢!

推荐答案

我没有找到Circle类东西,但有人想出了一个功能,这将减少你的code尺寸。它做你正在做同样的事情,创造形状像一个圆的多边形。

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.geo$c$czip.com/v3_polygon_example_donut.html

函数画圆(点,半径,DIR)使用DIR来区分正空间和漏洞。你必须交替他们创造洞。

The function drawCircle(point, radius, dir) uses dir to distinguish positive space and holes. You have to alternate them to create holes.

这篇关于如何添加"孔"为圆区(谷歌地图API V3)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆