Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google heatmap not showing data points properly

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 ?

like image 550
user1234 Avatar asked Aug 22 '15 03:08

user1234


1 Answers

dissipating:true and maxIntensity:10 fixed my problem. Thank you everyone helping.

like image 67
user1234 Avatar answered Oct 14 '22 22:10

user1234