I would like to create a heatmap layer that can be toggled on and off, which would show instead of the pindrops. Despite looking through the Wiki as well as the Google Maps api (https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap) I am quite lost as to how to initialize the layer and show it. Does it go into the the same handler variable or do I have to create something new entirely?
I've also posted on stackoverflow: http://stackoverflow.com/questions/28261039/creating-a-heatmap-layer-in-gmaps4rails, though no one's really looking. I also saw that someone had mentioned the trafficlayer in the issues, but there didn't seem to be a resolution. (or that it just wasn't implemented yet, but I couldn't figure out any implementation for other layers.)
I am using the Gmaps4Rails gem and by following the wiki/readme, I have successfully created a map with points (pins).
The javascript looks like this:
handler = Gmaps.build('Google'); handler.buildMap({ provider: { }, internal: { id: 'map' } }, function(){ json_array = #{raw(@hash.to_json)}; markers = handler.addMarkers(jsonarray); .each(json_array, function(json, index){ json.marker = markers[index]; });
});
I would like to create a heatmap layer that can be toggled on and off, which would show instead of the pindrops. Despite looking through the Wiki as well as the Google Maps api (https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap) I am quite lost as to how to initialize the layer and show it. Does it go into the the same handler variable or do I have to create something new entirely?
I've also posted on stackoverflow: http://stackoverflow.com/questions/28261039/creating-a-heatmap-layer-in-gmaps4rails, though no one's really looking. I also saw that someone had mentioned the trafficlayer in the issues, but there didn't seem to be a resolution. (or that it just wasn't implemented yet, but I couldn't figure out any implementation for other layers.)