Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    25
    Thanks
    11
    Thanked 1 Time in 1 Post

    Google Maps API Heatmap Layer

    I want to represent my data as a heatmap layer provided by Google Maps API.

    Code:
    https://developers.google.com/maps/documentation/javascript/tutorial
    The default code worked pretty well for me. Posting a snippet of it...

    Code:
     function initialize() {
            var mapOptions = {
              zoom: 8,
              center: new google.maps.LatLng(37.5697, -122.3675),
              mapTypeId: google.maps.MapTypeId.TERRAIN,
             };
    
            var map = new google.maps.Map(document.getElementById('map_canvas'),
                mapOptions);
    
            pointArray = new google.maps.MVCArray(heatMapData);
    
            var heatmap = new google.maps.visualization.HeatmapLayer({
              data: pointArray
            });
    
            heatmap.setMap(map);
          }
    Code:
    https://developers.google.com/maps/documentation/javascript/layers#JSHeatMaps
    heatMapData is the variable I created which contains all the latitude, longitude and intensity/weightage information... The above code did work out well. But there is an issue..

    I want to increase the radius of the layer. I believe that it is possible. In the official documentation, it is given that it is possible. Posting the link to this:-

    Code:
    https://developers.google.com/maps/documentation/javascript/reference#HeatmapLayer
    This code worked out pretty fine :-

    Code:
            pointArray = new google.maps.MVCArray(heatMapData);
    
            var heatmap = new google.maps.visualization.HeatmapLayer({
              data: pointArray,
    		dissipating: true,
    		radius: 50
            });
    
            heatmap.setMap(map);
          }
    How can I change the gradient of the heatmap?
    Last edited by egregious; 03-29-2013 at 11:46 AM.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    you've obviously read the documentation. Is the gradient setting not working the way you expect?
    https://developers.google.com/maps/d...apLayerOptions


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •