【问题标题】:how to place pin on specific latiutude and longitude on google map iframe如何在谷歌地图iframe上的特定纬度和经度上放置图钉
【发布时间】:2011-04-22 13:12:53
【问题描述】:

我有一个 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&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>");

如何在特定的纬度和经度上放置图钉?提前谢谢!!!

【问题讨论】:

标签: c# asp.net iframe


【解决方案1】:

在链接中添加 q=latitude,longitude 将在地图中显示大头针以及显示地址的文本框。

【讨论】:

  • 我得到了两个大头针,一个带有 GPS 坐标的绿色大头针,一个带有附近地区的红色圆形大头针。要是有办法重命名图钉就好了。
【解决方案2】:

你可以试试这个 jQuery 插件:http://gmap.nurtext.de/examples.html

【讨论】:

    【解决方案3】:

    试试这个:

        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);  
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多