English 中文(简体)
更改嵌入的 Google 地图信息泡沫中的位置名称
原标题:Changing the name of location in embeded Google Maps information bubble

我正在我的网站上嵌入谷歌地图, 但我希望能够将信息泡沫中的名称改成另一个名称, 例如地址, 我想在下面的链接中更改信息泡沫中的地址,

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=One+Exchange+Plaza,+26th+Floor+New+York,+NY+10006&amp;aq=&amp;sll=37.0625,-95.677068&amp;sspn=39.371738,86.572266&amp;ie=UTF8&amp;hq=&amp;hnear=1+Exchange+Plaza,+New+York,+10006&amp;t=m&amp;z=14&amp;ll=40.706793,-74.012592&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=One+Exchange+Plaza,+26th+Floor+New+York,+NY+10006&amp;aq=&amp;sll=37.0625,-95.677068&amp;sspn=39.371738,86.572266&amp;ie=UTF8&amp;hq=&amp;hnear=1+Exchange+Plaza,+New+York,+10006&amp;t=m&amp;z=14&amp;ll=40.706793,-74.012592" style="color:#0000FF;text-align:left">View Larger Map</a></small>
问题回答

据我所知""http://jsfiddle.net/6qYJg/"rel=“nofolpt”你必须建立你自己的 JavaScript 页面 才能改变这个气泡。它只使用基本的 API 组件, 但我认为它对于一个单一标记来说是个麻烦。 优点在于它高度定制。 我只是试图复制原件, 留下方向和搜索链接 。

<!DOCTYPE html>
<html>
  <head>
    <style type="text/css">
      html, body { margin: 0; padding: 0; height: 100% }
      #infoContents { color: blue; font-family: Arial, sans-serif; font-size: 12px }
    </style>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
      var map;
      var spot = new google.maps.LatLng(40.706793,-74.012592);
      var mapCenter = new google.maps.LatLng(40.712583,-74.00933592);
      var mapOptions = { center: mapCenter, zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP };

      function initialize() {
        map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
        var iconShadow = new google.maps.MarkerImage(
          "http://www.google.com/mapfiles/ms/micons/msmarker.shadow.png", 
          new google.maps.Size(59,32),
          new google.maps.Point(0,0),
          new google.maps.Point(15,32));

        var marker = new google.maps.Marker({
          map: map,
          position: spot,
          icon: "http://www.google.com/mapfiles/markerA.png",
          shadow: iconShadow
        });

        var infowindow = new google.maps.InfoWindow({
          content:  <div id="infoContents"><b style="font-size: 16px">I am so Smart</b><br><br>1 Exchange Plaza<br>New York, NY 10006</div> 
        });

        infowindow.open(map, marker);
      }

      google.maps.event.addDomListener(window,  load , initialize);
    </script>
  </head>
  <body>
    <div id="map_canvas" style="width: 425px; height: 350px;"></div>
  </body>
</html>

如果您在2016年再读这个, 您可以用 Google MyMaps 创建一个地图, 并节省时间 。)





相关问题
How to decide the current point reach on google map?

How to decide the current point reach on google map? I have a list of points (pickup points) of a route that I want to show in my google map with polyline. Now i have to get the current location of ...

Topographical or relief data in Map APIs

I was wondering if anyone knew of any map APIs that offer topographical or relief data? I ve had a quick look at Google and Bing APIs, but could find nothing there. Google allow you to view a map as ...

Using maps on Windows Mobile

I m experimenting with maps on different mobile platforms. Getting Google Maps to work on Android was easy, following this tutorial. Getting the same to work on Windows Mobile is a different matter. ...

Adding a custom icon to a google map

I need a hand adding a custom icon to some Google Maps javascript. Code below for your reference: function populateMap() { var map = new GMap2(document.getElementById("map")); map.setCenter(new ...

RSS to KML Overlay

I m want to display my blog as a Google Map overlay (each post contains geotags). How can I dynamically create a KML overlay from an RSS? Or better, how can I create a loop (PHP) that would display ...

开放街道地图管理员

我需要开放Street的标记管理员。 地图,如山角地图。

热门标签