将 google 地图 v2 自定义叠加层转换为 v3 自定义叠加层
我做了很多研究,但尚未找到对我有帮助的确切答案。我需要将 http://www.uaf.edu/campusmap/ 上的地图从 V2 转换为V3,所以我可以尝试将它与我的融合表结合起来。它使用 Map Tiler 制作的图块。有人可以帮助我吗?
I have been doing so much research and yet to find the exact answer to help me. I need to convert my map at http://www.uaf.edu/campusmap/ from V2 to V3 so I can try to combine it with my fusion tables. It uses tiles made by Map Tiler. Is there anyone who can help me out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您需要将整个地图移植到 V3 并使用自定义地图类型。
顺便说一句,您加载 API 两次,一次来自 http://www.uaf.edu/files/ Campusmap/ ,然后再次来自 http://www.uaf.edu/files/campusmap/campusmap-122311.html -- 在 iframe 中加载。可能最好删除其中一个,我认为您可以删除第一个。
I guess you need to port the whole map to V3 and use Custom Map Types.
BTW, you're loading the API twice, once from http://www.uaf.edu/files/campusmap/ and then again from http://www.uaf.edu/files/campusmap/campusmap-122311.html -- which is loaded in an iframe. Probably better to remove one of them, I think you can get rid of the first one.
我认为转换到 v3 时您需要担心两个主要问题:
v3 中不存在
GTileOverlay
。您可以根据 pp.10 使用自定义地图类型。为此,您需要创建一个
ImageMapType
(请参阅文档)。然后,您需要将其添加到Map.overlayMapTypes
MVCArray
(它将显示在底图上方 - 地图参考)。在 v3 中,没有什么比
GDownloadUrl
和GXml
更适合下载和解析 XML 文档了。您需要使用像 jQuery 这样的通用库来帮助下载标记位置。I think there are two main things you'll need to worry about when converting to v3:
GTileOverlay
doesn't exist in v3. You can use Custom Map Types, as per the pp.To do this, you'll want to make an
ImageMapType
(see the docs). You'll then need to add this to theMap.overlayMapTypes
MVCArray
(which will display it above the base map - Map reference).There's nothing like
GDownloadUrl
andGXml
for downloading and parsing an XML document in v3. You'll need to use a generic library like jQuery to help downloading your marker locations.