Package org.gwtopenmaps.openlayers.client

Examples of org.gwtopenmaps.openlayers.client.LonLat


    public Markers getMarkerLayer() {
        return markerLayer;
    }

    public LonLat createLonLat(double longitude, double latitude) {
        LonLat lonLat = new LonLat(longitude, latitude);
        lonLat.transform(new Projection("EPSG:4326").getProjectionCode(), map.getProjection());
        return lonLat;
    }
View Full Code Here


      });
    }
  }

  private void reDrawGeoFence(Map map) {
    LonLat center = map.getCenter();
    center.transform(map.getProjection(), DEFAULT_PROJECTION.getProjectionCode());
    removeGeoFence();

    Point[] points = new Point[40];

    int angle = 0;
    for (int i = 0; i < 40; i++) {
      angle += 360 / 40;
      double radius = storeBinder.getModel().getRadius();
      LonLat lonLat = LonLat.narrowToLonLat(destinationVincenty(center.lon(), center.lat(), angle, radius));
      lonLat.transform("EPSG:4326", map.getProjection());
      points[i] = new Point(lonLat.lon(), lonLat.lat());
    }
    LinearRing ring = new LinearRing(points);
    Polygon polygon = new Polygon(new LinearRing[]{ring});

    vectorLayer.addFeature(new VectorFeature(polygon));
View Full Code Here

  private native JSObject destinationVincenty(double lon, double lat, int angle, double distance) /*-{
    return $wnd.OpenLayers.Util.destinationVincenty(new $wnd.OpenLayers.LonLat(lon, lat), angle, distance);
  }-*/;

  private void centerMap(Map map, LatLng center, int zoomLevel) {
    LonLat lonlat = convertPoint(map.getProjection(), center);
    map.setCenter(lonlat, zoomLevel);
  }
View Full Code Here

    LonLat lonlat = convertPoint(map.getProjection(), center);
    map.setCenter(lonlat, zoomLevel);
  }

  private LonLat convertPoint(String mapProjection, LatLng center) {
    LonLat lonlat = new LonLat(center.getLongitude(), center.getLatitude());
    lonlat.transform(DEFAULT_PROJECTION.getProjectionCode(), mapProjection);
    return lonlat;
  }
View Full Code Here

TOP

Related Classes of org.gwtopenmaps.openlayers.client.LonLat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.