Example usage for com.google.gwt.maps.client.visualizationlib WeightedLocation newInstance

List of usage examples for com.google.gwt.maps.client.visualizationlib WeightedLocation newInstance

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.visualizationlib WeightedLocation newInstance.

Prototype

public static WeightedLocation newInstance(LatLng location, double weight) 

Source Link

Document

A data point entry for a heatmap.

Usage

From source file:com.google.gwt.maps.testing.client.maps.HeatMapLayerWidget.java

License:Apache License

/**
 * Get (randomly_ weighted spatial data for use in tests
 * //  ww w . j av  a2 s.c  o  m
 * @return
 */
@SuppressWarnings("unused")
// here as an example of WeightedDataPoints
private JsArray<WeightedLocation> getSampleWeightedData() {
    JsArray<LatLng> samplePoints = getSampleData();
    JsArray<WeightedLocation> sampleLocations = ArrayHelper.toJsArray(new WeightedLocation[] {});
    for (int n = 0, len = samplePoints.length(); n < len; n++) {
        sampleLocations.push(WeightedLocation.newInstance(samplePoints.get(n), 10 * Math.random()));
    }
    return sampleLocations;
}