为了账号安全,请及时绑定邮箱和手机立即绑定

Google Map Infowindow无法正确显示

Google Map Infowindow无法正确显示

繁星coding 2019-11-19 15:10:31
单击标记时,信息窗口未正确显示在我的地图上。网站在这里。您还会注意到地图控件也未正确显示。    var map;    var locations = <?php print json_encode(di_get_locations()); ?>;    var markers = []    jQuery(function($){        var options = {            center: new google.maps.LatLng(51.840639771473, 5.8587418730469),            zoom: 8,            mapTypeId: google.maps.MapTypeId.ROADMAP        };        map = new google.maps.Map(document.getElementById("map_canvas"), options);        for (var i=0; i < locations.length;i++) {            makeMarker(locations[i]);        }        centerMap();    });    function makeMarker(location) {        var markerOptions = {map: map, position: new google.maps.LatLng(location.lat, location.lng)};        var marker = new google.maps.Marker(markerOptions);        markers.push(marker);        var content = '';        var infowindow = new google.maps.InfoWindow(          { content: "test",            size: new google.maps.Size(50,50),            disableAutoPan : true          });        google.maps.event.addListener(marker, 'click', function(e) {            infowindow.open(map,marker);        });    }    function centerMap() {      map.setCenter(markers[markers.length-1].getPosition());    }注意:我使用的是Google Maps JS V3。
查看完整描述

3 回答

?
守着一只汪

TA贡献1872条经验 获得超3个赞

问题可能是您正在使用img{ max-width: 100%; }通用性。


试试这个到你的CSS


.gmnoprint img {

    max-width: none; 

}


查看完整回答
反对 回复 2019-11-19
  • 3 回答
  • 0 关注
  • 867 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信