多边形绘图并获取与Google Map API v3的坐标 [英] Polygon Drawing and Getting Coordinates with Google Map API v3

查看:362
本文介绍了多边形绘图并获取与Google Map API v3的坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google Maps API v3开发应用程序。我想要做的是;首先让用户在Google Map上绘制一个多边形,并获取他/她的多边形坐标并将其保存到数据库中。然后我将显示用户保存的坐标。



我不知道如何让用户在带有API v3的Google Map上绘制多边形,然后获取坐标。如果我能得到这些坐标,很容易将它们保存到数据库中。



http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html 几乎就是一个确切的例子,但它使用API​​ v2并且不给坐标。我想使用API​​ v3并能够获取所有坐标。

是否有任何绘制多边形的示例并使用API​​ v3获取坐标?

解决方案

Google现在包含一个绘图库,请参阅完整文档: https://developers.google.com/maps/documentation/javascript/overlays#drawing_tools



或者是一个简单的例子它的使用,在那里: http://gmaps-samples-v3.googlecode。 com / svn / trunk / drawing / drawing-tools.html


I'm trying to develop an application by using Google Maps API v3. What I'm trying to do is; first let the user draw a polygon on a Google Map and get his/her polygon's coordinates and save them into a database. I will then show the user saved coordinates.

I don't know how to let users draw polygon on a Google Map with API v3 and then get the coordinates. If I can get those coordinates, it's easy to save them into a database.

http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html is nearly the exact example but it uses API v2 and doesn't give coordinates. I want to use API v3 and be able to get all coordinates.

Is there any examples of drawing polygon and getting its coordinates with API v3?

解决方案

Google now includes a drawing library, see full documentation there: https://developers.google.com/maps/documentation/javascript/overlays#drawing_tools

Or a quick example of its use, over there: http://gmaps-samples-v3.googlecode.com/svn/trunk/drawing/drawing-tools.html

这篇关于多边形绘图并获取与Google Map API v3的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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