问题
I am trying to embed bing maps into web page and it works, but I want to show pushpin in embeded map on web page. As I can see it is not possible. Does anyone know how to do this?
<div id="mapviewer"><iframe id="map" scrolling="no" width="500" height="400" frameborder="0" src="http://www.bing.com/maps/embed/?v=2&cp=45.810280~15.957222&lvl=4&dir=0&sty=r&cid=AF2FECA12C1AA81D!196&form=LMLTEW&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&cp=45.810280~15.957222&lvl=4&dir=0&sty=r&cid=AF2FECA12C1AA81D!196&form=LMLTEW" target="_blank" style="margin:0 7px">View Larger Map</a><a id="LME_directions" href="http://www.bing.com/maps/?v=2&cp=45.810280~15.957222&lvl=4&dir=0&sty=r&cid=AF2FECA12C1AA81D!196&form=LMLTEW&rtp=%7Epos.45.810279846_15.957221984000004_" target="_blank" style="margin:0 7px">Driving Directions</a></div></div>
回答1:
You can use pushpin in embedded maps with the 'pushpins' parameter, see the MSDN about this:
http://msdn.microsoft.com/en-us/library/ee692180.aspx
Here is an example:
<!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¢er=47.5_-122.5&pushpins=47.5_-122.5"/>
</body>
</html>
Here is an example of what are the options available:
mapMode
The style of the map. Valid values are: Road, Aerial, AerialWithLabels, Birdseye, BirdseyeWithLabels
zoomLevel An int indicating a valid zoom level for the map style.
center
Two doubles separated by an underscore that are the latitude and longitude values of the coordinate of the center of the map.
heading
A double specifying the orientation of the map in degrees.
pushpins
Two doubles separated by an underscore that are the latitude and longitude values of the coordinate of the pushpin. Multiple pushpin locations are separated by a ~.
culture
A valid culture string. The default value is “en-us”.
来源:https://stackoverflow.com/questions/14999939/embed-bing-maps-pushpin