开发者

how to place pin on specific latiutude and longitude on google map iframe

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&amp;mapclient=jsapi&amp;ie=UTF8&amp;ll=" + latitude + "," + longitude + "&amp;spn=0.222565,0.596008&amp;z=10&amp;output=embed;\"></iframe>");

        else
            sbOutput.AppendFormat("<div><object data=\"http://maps.google.com/maps?key=ABQIAAAAyzfPKfpu4h_2V2EY0MQKcBQLL4oEiRrONF_Oyv5y1AbK0VEmMxQN1Z5_-BmLvlLLFYiLTknmwufmIg&amp;mapclient=jsapi&amp;ie=UTF8&amp;ll=" + latitude + "," + longitude + "&amp;spn=0.222565,0.596008&amp;z=10&amp;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);  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜