问题
My situation is this: I have my API code and my website running, then I can load a map, access it from JavaScript and create overlays or functions, but I'm trying to store (save) these custom markers (overlays obtained from script) in a map in a permanent way, but I'm unable to do it as every time I refresh my webpage the markers (and all overlays) disappear and the map reloads without any overlays or any markers, and I don't know how can I solve this.
How can I create a custom, shareable and colaborative map?
Note that I can get a map and create temporary overlays through a JavaScript in my website, but I can't save (store) these overlays or create permanent markers.
Is it possible do it through JavaScript Code (API v3) direct in my website?
Do I need to purchase a Map Engine (for Business) license?
I would not like to use my own database, but use something based on a Google Maps, like a layer e.g., where I could store markers. Is there any way? Google Maps Engine does this?
I've been reading something about "layerID" and "MapID" from Maps Engine (for business) where I think it would be possible to store custom markers (and drawings) in a custom layer direct in google maps Engine. But I didn't find anything about this in internet and I don't have access to Maps Engine (for business) to try.
回答1:
Look in the articles section of the documentation
These two articles will allow you to collect data from InfoWindows, and display data from the database on a map (make the data persistent):
- Using PHP/MySQL with Google Maps Shows how to use PHP/MySQL and the Google Maps API v3 to create a map that polls data from a database and shows as markers.
- From Info Windows to a Database: Saving User-Added Form Data Shows how to prompt users to fill out information in an infowindow, and then save that information back into a database.
Extend to save and retrieve data from the Drawing Manager if you need to save other geographic data besides markers.
来源:https://stackoverflow.com/questions/19015842/how-can-i-create-a-custom-shareable-and-colaborative-map