结合Google Maps API& Google地图数据API [英] Combine Google Maps API & Google Maps Data API

查看:266
本文介绍了结合Google Maps API& Google地图数据API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从地图中嵌入地图时,我会使用googgle地图提供的连结为我提供
这张地图,我可以使用 Google Maps Data API和Java



< iframe width =425height =350frameborder =0scrolling =nomarginheight =0marginwidth =0src = http://maps.google.com/maps/ms?source=embed&amp;hl=el&amp;geocode=&amp;ie=UTF8&amp;t=h&amp;msa=0&amp;
msid = 118122212106261754884.00047ec38974a377d47dd&
ll = 39.527348,21.00174& amp; amp; spn = 0,0& amp; output = embed>< / iframe>< br />



但我不能将它放在div上,并使用 Google Maps API和Javascript $ b来操作它$ b捕捉事件例如



现在,如果我使用
Google地图的Hello,World我可以完成上述所有操作,但此地图不在我的地图中,所以我不能se gui和google地图给我的地图上的一种管理的所有操作。

我如何结合这些技术?
Mapplets可以帮助我吗?
点击这里查看一个例子
在这个例子中我不能在地图上操作第二张地图,即setCenter()。



我很困惑:($ / b>

解决方案

嵌入谷歌地图与使用谷歌地图API不同,在这里有两个选项 - 您可以更新您的MyMap,导出为KML(通过Google地球中的视图链接),并使用GGeoXML加载它。

另外,您可以使用Maps Data API从My Map中加载数据并以编程方式将其添加到地图中。 : http://gmaps-samples.googlecode.com/svn /trunk/college-finder/index.html

When i embed a map from my maps i use the link that googgle maps provides me This map i can manipulate with Google Maps Data API and Java

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?source=embed&amp;hl=el&amp;geocode=&amp;ie=UTF8&amp;t=h&amp;msa=0&amp; msid=118122212106261754884.00047ec38974a377d47dd&amp; ll=39.527348,21.00174&amp;spn=0,0&amp;output=embed"></iframe><br />

but then i can't put it on a div and manipulate it with Google Maps API and Javascript to catch events for example

Now if i use The "Hello, World" of Google Maps i can do all of the above but this map is not in "My Maps" so i can't use the gui and all the operations the google maps give me for a kind of "administration" on the map

How can i combine these technologies? Can Mapplets help me? Click here for an example i made In this example i cannot manipulate the second map with javascript i.e. setCenter() on the map

I'am confused :(

解决方案

Embedding a Google Map is different from using the Google Maps API. You have a couple of options here - you can update your MyMap, export is as KML (via the View in Google Earth link) and load it using GGeoXML.

Alternatively, you can use the Maps Data API to load data from your My Map and programmatically add it to the map. Here is a sample: http://gmaps-samples.googlecode.com/svn/trunk/college-finder/index.html.

这篇关于结合Google Maps API&amp; Google地图数据API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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