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

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


  }

  public void testMapMoveEvent() {
    loadApi(new Runnable() {
      public void run() {
        final LatLng start = LatLng.newInstance(37.4419, -122.1419);
        final LatLng end = LatLng.newInstance(37.4569, -122.1569);

        final MapWidget m = new MapWidget(start, 13);

        /*
         * The Move event gets called on setCenter(). There is a setCenter()
View Full Code Here


   * Creates a 300x300 pixel map centered on Atlanta and adds it to the page.
   *
   * @return the created MapWidget instance.
   */
  protected MapWidget addDefaultMap() {
    LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
    MapWidget map = new MapWidget(atlanta, 8);
    map.setSize("300px", "300px");
    RootPanel.get().add(map);
    return map;
  }
View Full Code Here

  public void testPolylineOptions() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(0, 0), 3);
        map.setSize("500px", "400px");
        LatLng nycToZurich[] = {LatLng.newInstance(40.75, -73.90), // New York
            LatLng.newInstance(47.3, 8.5) // Zurich
        };
        map.setCenter(LatLng.newInstance(40, -25), 2);
        Polyline pline = new Polyline(nycToZurich, "#FF0000", 1, .75,
            PolylineOptions.newInstance(false, true));
View Full Code Here

  public void testPolylineOptions2() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(0, 0), 3);
        map.setSize("500px", "400px");
        LatLng nycToZurich[] = {LatLng.newInstance(40.75, -73.90), // New York
            LatLng.newInstance(47.3, 8.5) // Zurich
        };
        map.setCenter(LatLng.newInstance(40, -25), 2);
        Polyline pline = new Polyline(nycToZurich, "#FF0000", 1, .75,
            PolylineOptions.newInstance(false));
View Full Code Here

  }

  public void testOverlayZIndex() {
    loadApi(new Runnable() {
      public void run() {
        LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
        double result1 = Overlay.getZIndex(atlanta.getLatitude());
        assertTrue("expected non-zero value", result1 != 0.0);
        double result2 = Overlay.getZIndex(atlanta.getLatitude() + 1);
        assertTrue("expected non-zero value", result2 != 0.0);
        assertTrue("expected result1 > result2 ", result1 > result2);
      }
    });
  }
View Full Code Here

    map = new MapWidget(tenthStreet, 16);
    map.setSize("500px", "300px");
    map.addMapClickHandler(new MapClickHandler() {
      public void onClick(MapClickEvent event) {
        LatLng point = event.getLatLng() == null ? event.getOverlayLatLng()
            : event.getLatLng();
        if (point != null) {
          svClient.getNearestPanoramaLatLng(point,
              new LatLngStreetviewCallback() {
                @Override
View Full Code Here

    map.addMapClickHandler(new MapClickHandler() {
      public void onClick(MapClickEvent e) {
        MapWidget sender = e.getSender();
        Overlay overlay = e.getOverlay();
        LatLng point = e.getLatLng();

        if (overlay != null && overlay instanceof Marker) {
          sender.removeOverlay(overlay);
        } else {
          sender.addOverlay(new Marker(point));
View Full Code Here

    // 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() {

        public void onVisibilityChanged(
            GroundOverlayVisibilityChangedEvent event) {
View Full Code Here

  }

  public void testMarkerCloseInfoWindow() {
    loadApi(new Runnable() {
      public void run() {
        LatLng center = LatLng.newInstance(0, 0);
        final MapWidget map = new MapWidget(center, 1);
        map.setSize("300px", "300px");
        final Marker m = new Marker(center);
        map.addOverlay(m);
        RootPanel.get().add(map);
View Full Code Here

  }

  public void testMarkerLatLng() {
    loadApi(new Runnable() {
      public void run() {
        LatLng p1 = LatLng.newInstance(45, 45);
        LatLng p2 = LatLng.newInstance(50, 50);
        Marker m = new Marker(p1);
        assertTrue("Compare points", LatLng.newInstance(45, 45).isEquals(
            m.getLatLng()));
        m.setLatLng(p2);
        assertTrue("Compare points", LatLng.newInstance(50, 50).isEquals(
View Full Code Here

TOP

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

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.