问题
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.
回答1:
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
- Use ajax call to push the coordinates to the server side script to hold the data.
- 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.
来源:https://stackoverflow.com/questions/23026537/google-maps-drawing-library-vs-standard-drawing-techniques