谷歌地图API v3 - 如何绘制动态多边形/多段线? [英] google maps API v3 - how to draw dynamic polygons/polylines?

查看:387
本文介绍了谷歌地图API v3 - 如何绘制动态多边形/多段线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4天Google Maps Javascript API使用经验,我发现他们的文档和信息共享令人困惑。

有没有人有经验或知识在Google地图上绘制多边形/折线(使用Javascript API V3),类似于 this 例子? (我在这个 blogPost from 2008)

据我的研究可以告诉我这个例子直接使用JavaScript API V2或使用V2的GeometryControl实用程序库(可以是发现此处以供参考)。我似乎无法找到Javascript API V3是否有任何方式允许这种接口。



我将继续我的研究,但希望得到任何有用的评论或链接或建议。即使你指出我进一步研究的正确方向。 :)

解决方案

经过多次调查,我发现这个例子。在发现它并使用Google搜索后,它似乎是我的问题的一般答案。这是非常基本的,但根据V3 API是正确的。



使用本例中的代码,我成功地构建了一个我需要的原型。该代码是基本的,但我发现它可以进行扩展,以更好地符合我的规范,这是很好的。



我在评论中提供的链接是plexer的答案最好的解决方案,但开发它的人声明它仍在开发中,因此在发布应用程序中不够稳定。


I have 4 days of experience with Google Maps Javascript API and i find their documentation and information sharing confusing at best.

Does anyone have experience or knowledge on how to draw polygons/polylines on a google map (using Javascript API V3) similar to this example? (which i found on this blogPost from 2008)

So far as my research can tell me the example uses the Javascript API V2 directly or uses the GeometryControl utility library from V2 (which can be found here for reference). I cannot seem to find if the Javascript API V3 has any way of allowing such interface.

I will be continuing my research but would appreciate any helpful comment or link or suggestion. Even if you point me in the correct direction for further research. :)

解决方案

After much research i came across this example. Which, after discovering it and googling it, seems the general answer to questions like mine. This is very basic but correct according to the V3 API.

Using the code in this example i am successfully building a prototype that i need. The code is basic but i have found that it can be extended to better fit my specifications, which is good.

The link provided in my comment to plexer's answer would be the best solution but the person developing it states that it is still under development and thus not stable enough for use in release applications.

这篇关于谷歌地图API v3 - 如何绘制动态多边形/多段线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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