如何放置针在特定的纬度和经度在谷歌地图iframe
本文关键字:经度 谷歌地图 iframe 纬度 何放置 | 更新日期: 2023-09-27 17:51:23
我有一个Iframe来显示网页上的地图,像这样,
if (browsername== "IE")
sbOutput.AppendFormat("<iframe width='"450'" height='"250'" frameborder='"0'" scrolling='"no'" marginheight='"0'" marginwidth='"0'" align='"bottom'" src='"http://maps.google.com/maps?key=ABQIAAAAyzfPKfpu4h_2V2EY0MQKcBQLL4oEiRrONF_Oyv5y1AbK0VEmMxQN1Z5_-BmLvlLLFYiLTknmwufmIg&mapclient=jsapi&ie=UTF8&ll=" + latitude + "," + longitude + "&spn=0.222565,0.596008&z=10&output=embed;'"></iframe>");
else
sbOutput.AppendFormat("<div><object data='"http://maps.google.com/maps?key=ABQIAAAAyzfPKfpu4h_2V2EY0MQKcBQLL4oEiRrONF_Oyv5y1AbK0VEmMxQN1Z5_-BmLvlLLFYiLTknmwufmIg&mapclient=jsapi&ie=UTF8&ll=" + latitude + "," + longitude + "&spn=0.222565,0.596008&z=10&output=embed'" width='"450'" height='"250'" > Error: Embedded data could not be displayed. </object></div>");
如何在特定的经纬度上放置一个大头针?提前感谢!!
在链接中添加q=纬度,经度将在地图中显示pin以及显示地址的文本框。
你可以试试这个jQuery插件:http://gmap.nurtext.de/examples.html
试试这个:
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);