2013-02-21 210 views
1

我想嵌入bing地图到网页中,它的工作原理,但我想显示在网页上的嵌入式地图图钉。我可以看到这是不可能的。有谁知道如何做到这一点?嵌入bing地图 - 图钉

<div id="mapviewer"><iframe id="map" scrolling="no" width="500" height="400" frameborder="0" src="http://www.bing.com/maps/embed/?v=2&amp;cp=45.810280~15.957222&amp;lvl=4&amp;dir=0&amp;sty=r&amp;cid=AF2FECA12C1AA81D!196&amp;form=LMLTEW&amp;emid=8841ff8b-025d-e5a7-e37f-39b4d31b3b93"></iframe><div id="LME_maplinks" style="line-height:20px;"><a id="LME_largerMap" href="http://www.bing.com/maps/?v=2&amp;cp=45.810280~15.957222&amp;lvl=4&amp;dir=0&amp;sty=r&amp;cid=AF2FECA12C1AA81D!196&amp;form=LMLTEW" target="_blank" style="margin:0 7px">View Larger Map</a><a id="LME_directions" href="http://www.bing.com/maps/?v=2&amp;cp=45.810280~15.957222&amp;lvl=4&amp;dir=0&amp;sty=r&amp;cid=AF2FECA12C1AA81D!196&amp;form=LMLTEW&amp;rtp=%7Epos.45.810279846_15.957221984000004_" target="_blank" style="margin:0 7px">Driving Directions</a></div></div> 

回答

3

您可以使用嵌入的地图图钉与 '图钉' 参数,请参阅MSDN一下:

http://msdn.microsoft.com/en-us/library/ee692180.aspx

下面是一个例子:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
    <head> 
     <title>Embedded Map</title> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    </head> 
    <body style="font-family:Arial"> 
     <p>A simple embedded map.</p> 
     <iframe width="400" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" 
     src="http://dev.virtualearth.net/embeddedMap/v1/ajax/aerial?zoomLevel=10&center=47.5_-122.5&pushpins=47.5_-122.5"/> 
    </body> 
</html> 

这里什么是可用选项的示例:

mapMode
地图的风格。有效值包括:公路,航空,AerialWithLabels,鸟眼,BirdseyeWithLabels

个zoomLevel 一个int指示地图风格的有效缩放级别。

中心
两个双打由下划线是的地图的中心的坐标的纬度和经度值分开。

标题
双指定度数的地图的方向。

图钉下划线是的图钉的坐标的纬度和经度值分离
两个双打。多个图钉位置由〜分开。

文化
有效的文化字符串。默认值是“en-us”。

+0

http://img818.imageshack.us/img818/8863/clipboard01lru.jpg所以我可以传递图钉的坐标,但我不能通过数据显示上面的pushin。请参阅链接上的屏幕截图。 – unarity 2013-02-21 14:42:05

+0

是的,就是这样,您可以选择下面的选项。 除此之外,您可以使用Bing地图网站的URL:http://onlinehelp.microsoft.com/en-us/bing/ff808440.aspx – 2013-02-21 21:41:48

+0

我们如何通过https加载给定的iframe的src url? 我们尝试将协议更改为https并添加参数s = 1(https://dev.virtualearth.net/embeddedMap/v1/ajax/aerial?zoomLevel=10¢er=47.5_-122.5&pushpins=47.5_-122.5&s= 1),但内容被阻止。 – Nikitesh 2014-05-05 07:37:41