【问题标题】:google map api v3, infowindow editable~google map api v3,信息窗口可编辑~
【发布时间】:2011-02-14 13:29:45
【问题描述】:

我想做一个谷歌地图信息窗口。 触发某些事件时,信息窗口应该是可编辑的。

有一个关于google map infowindow editable的问答,

How do I make the info window editable in the Google Maps API?

但是,这是关于第 2 版的。

知道如何编辑信息窗口吗?

参考~ 这是我的 addMarket 函数

 this.addMarker = function(location) {
        var iconImg = 'signpost.png';
        var marker = new google.maps.Marker({
          position: location, 
          map: this.mMap,
          icon: iconImg,
        });

        var infowindow = new google.maps.InfoWindow(
        { 
            maxWidth: '50px',
            content: "some text"
        });
        google.maps.event.addListener(marker, 'click', function() {
            infowindow.open(this.mMap, marker);
        });
        infowindow.open(this.mMap, marker);
        this.mMarkerArray.push(marker);
    }

【问题讨论】:

    标签: javascript google-maps google-maps-api-3


    【解决方案1】:

    好吧,您可以将任何 HTML 传递给 InfoWindowcontent 属性。所以你提到的谷歌地图 v2 的solution 也适用于这里:

    var infowindow = new google.maps.InfoWindow(
        { 
            maxWidth: '50px',
            content: '<div contentEditable="true">changeme...</div>'
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-29
      相关资源
      最近更新 更多