Example usage for com.google.gwt.maps.client.overlays Polygon newInstance

List of usage examples for com.google.gwt.maps.client.overlays Polygon newInstance

Introduction

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

Prototype

public final static Polygon newInstance(PolygonOptions options) 

Source Link

Document

Create a polygon using the passed PolygonOptions, which specify the polygon's path, the stroke style for the polygon's edges, and the fill style for the polygon's interior regions.

Usage

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

License:Apache License

private void drawShapes() {
    // add some draw shapes for folks
    CircleOptions cOpts = CircleOptions.newInstance();
    cOpts.setCenter(LatLng.newInstance(52.62d, -119.95d));
    cOpts.setFillColor("#FF0000");
    cOpts.setStrokeColor("CCFF44");
    cOpts.setFillOpacity(0.5d);//from  w  w  w  .ja  va  2  s.  c o m
    cOpts.setStrokeOpacity(0.9d);
    cOpts.setStrokeWeight(3);
    cOpts.setRadius(1000000d);
    cOpts.setMap(mapWidget);
    @SuppressWarnings("unused")
    Circle circle = Circle.newInstance(cOpts);

    cOpts = CircleOptions.newInstance();
    cOpts.setCenter(LatLng.newInstance(40.569d, -82.7929d));
    cOpts.setFillColor("#00FF00");
    cOpts.setStrokeColor("FFCCFF");
    cOpts.setFillOpacity(0.7d);
    cOpts.setStrokeOpacity(0.9d);
    cOpts.setStrokeWeight(10);
    cOpts.setRadius(300000d);
    cOpts.setMap(mapWidget);
    @SuppressWarnings("unused")
    Circle circle2 = Circle.newInstance(cOpts);

    LatLng[] a = new LatLng[18];
    a[0] = LatLng.newInstance(49.02824580511537, -104.0899658203125);
    a[1] = LatLng.newInstance(43.009982694835784, -104.0679931640625);
    a[2] = LatLng.newInstance(43.026047765621, -98.5528564453125);
    a[3] = LatLng.newInstance(42.73623356449312, -98.0255126953125);
    a[4] = LatLng.newInstance(42.89740952345494, -97.9156494140625);
    a[5] = LatLng.newInstance(42.83298955227273, -97.3883056640625);
    a[6] = LatLng.newInstance(42.52607693975099, -96.5753173828125);
    a[7] = LatLng.newInstance(43.20248609768505, -96.4654541015625);
    a[8] = LatLng.newInstance(43.521979415112206, -96.6192626953125);
    a[9] = LatLng.newInstance(43.69698341176971, -96.5093994140625);
    a[10] = LatLng.newInstance(45.32638440880054, -96.4215087890625);
    a[11] = LatLng.newInstance(45.54224714353031, -96.9708251953125);
    a[12] = LatLng.newInstance(45.757284242039375, -96.6851806640625);
    a[13] = LatLng.newInstance(46.23050041945144, -96.5533447265625);
    a[14] = LatLng.newInstance(46.714738770992284, -96.9049072265625);
    a[15] = LatLng.newInstance(47.67030090972658, -96.8170166015625);
    a[16] = LatLng.newInstance(47.98009843932673, -97.1466064453125);
    a[17] = LatLng.newInstance(48.97058369834937, -97.2125244140625);
    JsArray<LatLng> paths = ArrayHelper.toJsArray(a);

    PolygonOptions pOpts = PolygonOptions.newInstance();
    pOpts.setFillColor("#0000FF");
    pOpts.setStrokeColor("FFFFFF");
    pOpts.setFillOpacity(0.4d);
    pOpts.setStrokeOpacity(0.9d);
    pOpts.setStrokeWeight(6);
    pOpts.setPaths(paths);
    pOpts.setMap(mapWidget);
    @SuppressWarnings("unused")
    Polygon polygon = Polygon.newInstance(pOpts);
}