如何创建自定义,可共享且协调的地图? [英] How can I create a custom, shareable and colaborative map?
问题描述
我的情况是这样的:我有我的API代码和网站正在运行,然后可以加载地图,通过JavaScript访问它并创建叠加层或函数,但是我试图存储(保存)这些自定义标记(叠加层从脚本中获得)以永久的方式保存在地图中,但是由于每次刷新网页时,标记(以及所有叠加层)都会消失,并且地图会在没有任何叠加层或任何标记的情况下重新加载,因此我无法做到这一点,不知道我该怎么解决.
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.
如何创建自定义,可共享且协调的地图?
请注意,我可以在网站上通过JavaScript获取地图并创建临时叠加层,但是无法保存(存储)这些叠加层或创建永久标记.
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.
是否可以直接在我的网站上通过JavaScript代码(API v3)进行操作?
Is it possible do it through JavaScript Code (API v3) direct in my website?
我需要购买Map Engine(用于企业)许可证吗?
Do I need to purchase a Map Engine (for Business) license?
我不想使用自己的数据库,而是使用基于Google Maps的内容,例如可以存储标记的图层.有什么办法吗? Google Maps Engine可以吗?
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?
我一直在从Maps Engine(用于企业)中读取有关"layerID"和"MapID"的内容,我认为可以在Google Maps Engine中直接在自定义图层中存储自定义标记(和图形).但是我没有在互联网上找到关于此的任何信息,也没有访问Maps Engine(用于企业)的机会.
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.
推荐答案
查看以下内容的文章部分文档
这两篇文章将使您可以从InfoWindows收集数据,并在地图上显示数据库中的数据(使数据持久化):
These two articles will allow you to collect data from InfoWindows, and display data from the database on a map (make the data persistent):
- 将PHP/MySQL与Google Maps结合使用 显示如何使用PHP/MySQL和Google Maps API v3创建地图来轮询数据库中的数据并显示为标记.
- 从信息窗口到数据库:保存用户添加的表单数据 显示如何提示用户在信息窗口中填写信息,然后将该信息保存回数据库中.
- 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.
这篇关于如何创建自定义,可共享且协调的地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!