Google地图绘图库与标准绘图技术 [英] Google Maps Drawing Library vs Standard Drawing Techniques

查看:134
本文介绍了Google地图绘图库与标准绘图技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想知道使用绘图库与标准Google Maps API技术创建形状的优缺点,例如 new google.maps.Polygon new google.maps.Circle new google.maps.Rectangle 等。



如果应用程序的目标是收集数据库中的空间数据(即坐标),是否会影响使用哪种方法?

这更像是一个讨论类型的问题,所以我期待着你的想法。通过使用事件监听器,你可以收集绘制的形状的纬度和经度(但它会被收集在客户端)。



遵循 Demo 将有助于您收集经度和纬度。



在演示本身中,我已经指定了一种给每个绘制区域命名的方法。



存储在数据库中


  1. 使用ajax调用将坐标推送到服务器端脚本来保存数据。
  2. 在服务器端,使用Spatial API处理数据以将其存储在数据库中。

希望这可以帮助您存储在数据库中。


I am wondering what are the advantages and disadvantages of using Drawing Library versus standard Google Maps API techniques to create shapes like new google.maps.Polygon, new google.maps.Circle, new google.maps.Rectangle, etc.

If the goal of the application is to collect spatial data (i.e., coordinates) in a database, will that affect which method to use?

This is more of a discussion type of question so I look forward to your thoughts.

解决方案

By Using Event Listeners you can collect the drawn Lattitude and Longitude of the Shape(But it will be collected at the Client Side).

Following Demo will help you to collect Lattitude and Longitude.

In the demo itself, I have specified a way to give a name for each drawn region.

To store in Database

  1. Use ajax call to push the coordinates to the server side script to hold the data.
  2. At the server side, use Spatial API to handle the data to store it in the database.

Hope this will help you to store in database.

这篇关于Google地图绘图库与标准绘图技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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