【问题标题】:Google maps Multipoint not rendering when there is more number of markers当标记数量更多时,谷歌地图多点不渲染
【发布时间】:2019-06-18 10:50:40
【问题描述】:

当标记数量更多时,谷歌地图中的多点几何无法正确渲染标记。 Google maps Multi point rendering

 var mapProp = {
    center: x,
    zoom: 5
};

var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);

map.data.addGeoJson(data);
map.data.setStyle(function (feature) {
     return /** @type {google.maps.Data.StyleOptions} */({
    icon: {
      url: feature.getProperty('icon'),
      icon: feature.getProperty('icon'),
      scaledSize: new google.maps.Size(40, 40), // scaled size 16 px
      anchor: new google.maps.Point(20, 25) // anchor
    },
    size: '10px'
  });
});

data是geojson特征集合数组。

【问题讨论】:

    标签: javascript angularjs google-maps


    【解决方案1】:

    看起来只有中心是错误的:) 看看这个

    var x = new google.maps.LatLng(35.38904996691167, 75.377197265625);
    

    http://jsfiddle.net/k0pzdg9f/1/

    【讨论】:

    • 一个或两个多点几何特征可以正常工作。当我给一组几何多点特征不能正常工作时。
    • 无法正常工作,例如,发生了什么?那些不是地图上可见的几何特征点吗?
    • 那些几何特征是可见的,但是这些图标变得很笨拙,并且它们正在破坏其他图标。SVG 也破坏了。
    • suryapratap 特征点变得像小提琴一样。 jsfiddle.net/jLvq3opr
    • 我认为这与特征点的数量无关,这是您的图像无法正确缩放,请尝试使用来自kml4earth.appspot.com/icons.html#shapes的东西
    猜你喜欢
    • 2012-12-09
    • 2012-05-01
    • 1970-01-01
    • 2015-06-02
    • 2012-01-02
    • 1970-01-01
    • 1970-01-01
    • 2010-11-06
    相关资源
    最近更新 更多