5

I am facing a strange problem with google heatmap. Heatmap shows less datapoints on increasing number of coordinates in heatmap data. For 333 coordinates, heatmap shows datapoints like: enter image description here

And for 9885 coordinates : enter image description here

As you can see for 333 coordinates there are more datapoints than 9885 coordinates. But it should show more datapoints for large data. My code:

var map = new google.maps.Map(document.getElementById('bcak_track_map'), {
    zoom:19,
    center:{lat:parseFloat(flat), lng:parseFloat(flon)},
    mapTypeId:google.maps.MapTypeId.SATELLITE
});
map.setTilt(45);

var heatMapBounds = new google.maps.LatLngBounds();

var markerCount = 0;
$.each(marker_points, function (key, val) {
    var myLatLon = new google.maps.LatLng(parseFloat(val.latitute), parseFloat(val.longtute));
    heatArr[markerCount] = {location: myLatLon, weight: 2};
    heatMapBounds.extend(myLatLon);
    markerCount++;
});

var sheatmap = new google.maps.visualization.HeatmapLayer({
    data:new google.maps.MVCArray(heatArr),
    radius:30
});
sheatmap.setMap(map);
map.fitBounds(heatMapBounds);
bounds = new google.maps.LatLngBounds(null);

And data getting in marker_points

 [
 Object { latitute="33.65112310998252",  longtute="-117.98994390000001"},
 Object { latitute="33.650867",  longtute="-117.990379"}, 
 Object { latitute="33.650867",  longtute="-117.990379"}, 
 Object { latitute="33.650855606216076",  longtute="-117.99054136256564"}, 
 Object { latitute="33.650867",  longtute="-117.990379"}, 
 Object { latitute="33.651302292183665",  longtute="-117.99096972341766"}, 
 Object { latitute="33.65106477008209",  longtute="-117.99117056945039"}
 ......
]

anyone please help me to show heatmap correct datapoints ?

4

2 回答 2

7

dissipating:true 和 maxIntensity:10 解决了我的问题。谢谢大家帮忙。

于 2015-08-24T18:09:24.737 回答
0

如果其他规模较大的人可能会遇到这种情况,我有一个类似的案例,具有以下特点:

  1. 有大约 30K 点
  2. 在像墨西哥这样的大国。

消散:真,最大强度:1,半径:10

并且:我为每个点添加了 2 的权重。(你可以用谷歌热图做到这一点)

于 2020-10-22T20:56:00.243 回答