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 ?

user1234
  • 335
  • 2
  • 19
  • 2
    What does the data look like? Please provide a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve) that demonstrates the issue **in the question itself** (if possible). – geocodezip Aug 22 '15 at 04:50
  • Yes it sounds more likely to be a problem with the data supplied for `marker_points` than the number of points – duncan Aug 22 '15 at 12:53
  • @ducan data is supplied proper using ajax for different date ranges.I can see in firebug console. Each time when coordinates increases data on heatmap decreases. – user1234 Aug 22 '15 at 16:52
  • relation between no. of coordinates and datapoints on heatmap is inverse. As more coordinates represent less data on heatmap. – user1234 Aug 22 '15 at 17:01

2 Answers2

7

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

user1234
  • 335
  • 2
  • 19
0

In case others with a larger scale might encounter this, I had a similar case with the following features:

  1. Had around 30K Points
  2. Over a large country like Mexico.

dissipating:true, maxIntensity:1 , radius: 10

AND: I added a weight of 2 to each point. (You can do that with Google Heatmap)

TBE
  • 1,002
  • 1
  • 11
  • 32