Google maps api:自定义单独的地图叠加的MapTypeControl [英] Google maps api: Customising the MapTypeControl for separate map overlays

查看:105
本文介绍了Google maps api:自定义单独的地图叠加的MapTypeControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多(非地理)数据片,我试图通过谷歌地图
查看。它基本上分解成N个'地图',每个
包含M'图层'。

这个例子显示了我想要做的事情:
http://code.google.com/apis/maps /documentation/javascript/examples/map-simple.html



我可以通过提供两个
自定义MapType来切换两个不同的地图(非常像示例中的Map / Sattelite切换),
,但我无法弄清楚如何制作它,因此我可以打开和关闭
的其他覆盖图层(如'terrain'复选框)。

官方文档模糊地提到了这个(
http://code.google.com/apis/maps/documentation/javascript/maptypes.html#MapTypeInterface
)但不幸的是,位I 'm after('参见添加MapType控件
bel ow')是一个死链接,我找不到
文档的这一点。



有谁知道如何控制文档drop-
down toggle boxes exists?



谢谢

解决方案

如果您希望基于复选框显示或消失特定的叠加层,可以查看 http://geojason.info/2010/overlay-map-management-with-google-maps-api-v3/ 。然而,这涉及实际上并不在地图上的复选框。他们需要进入侧栏或地图上方或其他地方。如果您希望能够在地形和图层复选框出现的控件中添加内容,我认为Google Maps API v3中没有任何钩子可以实现这一点。我很乐意错误,但我不认为它很简单,我希望任何设法实现它的解决方案都会变得脆弱。


I have lots of slices of (non-geographical) data that I'm trying to view via google maps. It basically breaks down into N 'maps', each containing M 'layers'.

This sample shows basically what I want to do: http://code.google.com/apis/maps/documentation/javascript/examples/map-simple.html

I can get it to switch between two different maps by providing two custom MapTypes (much like the Map/Sattelite toggle in the sample), but I can't figure out how to make it so I can toggle on and off an additional overlay layer (like the 'terrain' checkbox).

The official docs vaguely mention this ( http://code.google.com/apis/maps/documentation/javascript/maptypes.html#MapTypeInterface ) but unfortunately the bit I'm after ('See Adding MapType Controls below') is a dead link, and I can't find this bit of the documentation.

Does anyone know where the documentation on how to control the drop- down toggle boxes exists?

Thanks

解决方案

If you are looking to have a particular overlay appear or disappear based on a checkbox, you can check out http://geojason.info/2010/overlay-map-management-with-google-maps-api-v3/.

However, that involves checkboxes that are not actually on the map. They need to go in a sidebar or above the map or whatever. If you are hoping to be able to add things to the control where the "terrain" and the "layer" checkbox appear, I don't think there's any hooks in Google Maps API v3 to do that. I'd be happy to be wrong, but I don't think it's simple and I would expect any solution that managed to accomplish it would be brittle.

这篇关于Google maps api:自定义单独的地图叠加的MapTypeControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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