谷歌图表 API 和地理地图
我被一个问题困住了。 希望有人已经面对它并修复它。 我想创建一个像 Google Analytics 一样的交互式地理地图。我的意思是从世界到国家的可缩放地图以显示地理信息。 我已经拥有按地区、国家和城市划分的所有数据。 我可以将它们放在一个级别的 Google 地理地图上。但是当用户点击一个国家/地区时,我希望他可以获得更多详细信息......就像最后的分析一样。 我尝试在地理地图上添加侦听器以获取事件,我希望动态更改地理地图的选项,但没有运气...... 有人有主意吗?
感谢您的帮助。
I'm stuck with an issue.
Hope someone already faced it and fixed it.
I would like to create a interactive geo maps like in Google Analytics. I mean a zoomable map from world to country to display geo infos.
I already have all the data split by regions, country and cities.
I'm able to put them on a Google geomap at one level. But when the user clicks on a country, I would like he can get more details....like in Analytics at the end.
I have tried to add listeners on the geomap to get the event and I hoped to change the options of the geomap on the fly but no luck...
Does anyone have an idea ?
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
成立。
如果有人感兴趣,我会分享它。
在 JavaScript 中,
您需要捕获区域点击事件。
为此,您需要通过指定要放大的区域来更改地理地图的选项。
在其中,您需要获取 e['region'] 值并相应地调整您的地理数据。
将它们传递到您的地理地图,重新绘制它即可。
再见
Found.
I'll share it in case someone is interested.
In javascript,
You need to catch the region click event.
To be able to do this, you need to change the options of the geomap by speficying the region you're zooming in.
In it, you need to get the e['region'] value and to adapt your geo data accordingly.
Pass them to your geomap, redraw it and that's it.
Bye