I have an Iframe to show a map on a webpage like this,
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>");
How do i get to place a pin on that specific latitude an开发者_开发知识库d longitude? Thanks in advance!!!
Adding q=latitude,longitude in the link will show the pin in the map along with the text box which shows the address.
You can try this jQuery plugin: http://gmap.nurtext.de/examples.html
Try this:
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);
精彩评论