Package com.google.gwt.maps.client.geom

Examples of com.google.gwt.maps.client.geom.LatLngBounds


  @Override
  public void onShow() {
    map.clearOverlays();

    // Add 10 markers to the map at random locations
    LatLngBounds bounds = map.getBounds();
    LatLng southWest = bounds.getSouthWest();
    LatLng northEast = bounds.getNorthEast();
    double lngSpan = northEast.getLongitude() - southWest.getLongitude();
    double latSpan = northEast.getLatitude() - southWest.getLatitude();
    for (int i = 0; i < 10; i++) {
      LatLng point = LatLng.newInstance(southWest.getLatitude() + latSpan
          * Math.random(), southWest.getLongitude() + lngSpan * Math.random());
 
View Full Code Here


  private void displayOverlay() {

    map.clearOverlays();

    LatLngBounds bounds = map.getBounds();
    LatLng southWest = bounds.getSouthWest();
    LatLng northEast = bounds.getNorthEast();
    double lngSpan = northEast.getLongitude() - southWest.getLongitude();
    double latSpan = northEast.getLatitude() - southWest.getLatitude();

    LatLng[] points = new LatLng[NUM_POINTS];
View Full Code Here

  public void onShow() {
    // The map's bounds are meaningless until the map has been added to the DOM
    // and sized appropriately
    if (firstTime) {
      firstTime = false;
      LatLngBounds bounds = map.getBounds();
      LatLng southWest = bounds.getSouthWest();
      LatLng northEast = bounds.getNorthEast();
      double lngDelta = (northEast.getLongitude() - southWest.getLongitude()) / 4;
      double latDelta = (northEast.getLatitude() - southWest.getLatitude()) / 4;

      // generate bounds that covers center map with half the width and height
      LatLngBounds rectBounds = LatLngBounds.newInstance(LatLng.newInstance(
          southWest.getLatitude() + latDelta, southWest.getLongitude()
              + lngDelta), LatLng.newInstance(northEast.getLatitude() - latDelta,
          northEast.getLongitude() - lngDelta));

      map.addOverlay(new RectangleOverlay(rectBounds, 2));
View Full Code Here

  }

  public void testCopyrightCollectionEvent() {
    loadApi(new Runnable() {
      public void run() {
        LatLngBounds bounds = LatLngBounds.newInstance(LatLng.newInstance(
            -90.0, -180.0), LatLng.newInstance(90.0, 180.0));
        final CopyrightCollection collection = new CopyrightCollection();
        final Copyright copyright = new Copyright(3452981, bounds, 3,
            "2008 Google testCopyrightCollectionEvent");
        collection.addNewCopyrightHandler(new NewCopyrightHandler() {
View Full Code Here

  }

  public void testCopyrightCollectionTrigger() {
    loadApi(new Runnable() {
      public void run() {
        LatLngBounds bounds = LatLngBounds.newInstance(LatLng.newInstance(
            -90.0, -180.0), LatLng.newInstance(90.0, 180.0));
        final CopyrightCollection collection = new CopyrightCollection();
        final Copyright copyright = new Copyright(3432241, bounds, 3,
            "2008 Google testCopyrightCollectionTrigger");
        collection.addNewCopyrightHandler(new NewCopyrightHandler() {
View Full Code Here

  public void testMapTypeTrigger() {
    loadApi(new Runnable() {
      public void run() {
        final MapType mapType = MapType.getNormalMap();
        LatLngBounds bounds = LatLngBounds.newInstance(LatLng.newInstance(
            -90.0, -180.0), LatLng.newInstance(90.0, 180.0));
        final Copyright copyright = new Copyright(123432, bounds, 3,
            "2008 Google testMapTypeTrigger");

        mapType.addMapTypeNewCopyrightHandler(new MapTypeNewCopyrightHandler() {
View Full Code Here

  // }

  public void testTileLayerTrigger() {
    loadApi(new Runnable() {
      public void run() {
        LatLngBounds bounds = LatLngBounds.newInstance(LatLng.newInstance(
            -90.0, -180.0), LatLng.newInstance(90.0, 180.0));
        final Copyright copyright = new Copyright(123432, bounds, 3,
            "2008 Google testTileLayerTrigger");
        CopyrightCollection collection = new CopyrightCollection();
        collection.addCopyright(copyright);
View Full Code Here

    icon.setShadowSize(Size.newInstance(22, 20));
    icon.setIconAnchor(Point.newInstance(6, 20));
    icon.setInfoWindowAnchor(Point.newInstance(5, 1));

    // Add 10 markers to the map at random locations
    LatLngBounds bounds = map.getBounds();
    LatLng southWest = bounds.getSouthWest();
    LatLng northEast = bounds.getNorthEast();
    double lngSpan = northEast.getLongitude() - southWest.getLongitude();
    double latSpan = northEast.getLatitude() - southWest.getLatitude();
    MarkerOptions options = MarkerOptions.newInstance();
    options.setIcon(icon);
    for (int i = 0; i < 10; i++) {
View Full Code Here

    handlerTable.setHTML(0, 1, "<b>Type</b>");
    handlerTable.setHTML(0, 2, "<b>Events</b>");
  }

  private void computeAtlantaTriangle() {
    LatLngBounds bounds = map.getBounds();
    LatLng center = map.getCenter();
    LatLng ne = bounds.getNorthEast();
    LatLng sw = bounds.getSouthWest();
    GWT.log("ne=" + ne + ", sw=" + sw, null);
    double vertDelta = ne.getLatitude() - sw.getLatitude();
    double horizDelta = ne.getLongitude() - sw.getLongitude();
    double vertGrid = vertDelta / 4.0;
    double horizGrid = horizDelta / 8.0;
View Full Code Here

  public void onShow() {
    // The map's bounds are meaningless until the map has been added to the DOM
    // and sized appropriately
    if (firstTime) {
      firstTime = false;
      LatLngBounds bounds = map.getBounds();
      LatLng southWest = bounds.getSouthWest();
      LatLng northEast = bounds.getNorthEast();
      double lngDelta = (northEast.getLongitude() - southWest.getLongitude()) / 4;
      double latDelta = (northEast.getLatitude() - southWest.getLatitude()) / 4;

      // generate bounds that covers center map with half the width and height
      LatLngBounds rectBounds = LatLngBounds.newInstance(LatLng.newInstance(
          southWest.getLatitude() + latDelta, southWest.getLongitude()
              + lngDelta), LatLng.newInstance(northEast.getLatitude() - latDelta,
          northEast.getLongitude() - lngDelta));
      groundOverlay = new GroundOverlay("boot.jpg", rectBounds);
      groundOverlay.addGroundOverlayVisibilityChangedHandler(new GroundOverlayVisibilityChangedHandler() {
View Full Code Here

TOP

Related Classes of com.google.gwt.maps.client.geom.LatLngBounds

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.