谷歌地图与融合表标记不显示在Chrome浏览器

Google Maps with Fusion Table markers not showing in Chrome

本文关键字:显示 Chrome 浏览器 融合 谷歌地图      更新时间:2023-09-26

我正在使用Fusion表来填充谷歌地图。它在IE11和Firefox上工作良好,但在Chrome(最新版本)中标记不显示。我在控制台中得到一个错误:'Attr。已弃用textContent。请用"value"代替。

var geocoder;
var map, layer;
function initialize() {
       geocoder = new google.maps.Geocoder();
       var styles = [
                 {
                   "stylers": [
                     { "invert_lightness": true },
                     { "saturation": -100 },
                     { "gamma": 1 },
                     { "lightness": 11 }
                   ]
                 },{
                   "featureType": "water",
                   "stylers": [
                     { "lightness": -100 }
                   ]
                 }];
       var mapOptions = {
         center: new google.maps.LatLng(lat, lon),
         zoom: 6,
         mapTypeId: google.maps.MapTypeId.ROADMAP,
         styles: styles
       };
       map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);

        var layer = new google.maps.FusionTablesLayer({
          query: {
            select: 'latitude',
            from: fusiontableid
          },
          map: map,
          styleId: 2,
          templateId: 3
        });

     }
     google.maps.event.addDomListener(window, 'load', initialize);

有什么解决方法吗?

找到了!这是一个CSS问题:

img, object, embed {
    max-width: 100%;
    height: auto;
}
img {
    -ms-interpolation-mode: bicubic;
}
#map_canvas img, .map_canvas img {
    max-width: none !important;
}

max-width: 100%的行是混乱的地图样式-下面的#map_canvas是为了覆盖它,但因为我的画布id是map-canvas它不适用。