Package com.google.gwt.maps.client

Examples of com.google.gwt.maps.client.MapWidget$MapPanel


   * Test the Polygon constructor with extra args, but not PolygonOptions.
   */
  public void testPolygonNoOpts() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(0, 0), 3);
        map.setSize("500px", "400px");
        LatLng[] points = { //
        LatLng.newInstance(45, 45), //
            LatLng.newInstance(45, -45), //
            LatLng.newInstance(0, 0)};
        Polygon p = new Polygon(points, "#ff0000", 3, 1.0, "#0000ff", 0.3);
        map.addOverlay(p);
        RootPanel.get().add(map);
      }
    });
  }
View Full Code Here


   * Test the getVertexCount() method.
   */
  public void testPolygonVertexCount() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(0, 0), 3);
        map.setSize("500px", "400px");
        LatLng[] points = { //
        LatLng.newInstance(45, 45), //
            LatLng.newInstance(45, -45), //
            LatLng.newInstance(0, 0)};
        Polygon p = new Polygon(points);
        map.addOverlay(p);
        RootPanel.get().add(map);
        assertEquals("vertex count", 3, p.getVertexCount());
      }
    });
  }
View Full Code Here

   * Test the Polygon constructor with the PolygonOptions in the constructor.
   */
  public void testPolygonWithOptions() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(0, 0), 3);
        map.setSize("500px", "400px");
        LatLng[] points = { //
        LatLng.newInstance(45, 45), //
            LatLng.newInstance(45, -45), //
            LatLng.newInstance(0, 0)};
        PolygonOptions opts = PolygonOptions.newInstance();
        opts.setClickable(false);
        Polygon p = new Polygon(points, "#ff0000", 3, 1.0, "#0000ff", 0.3, opts);
        map.addOverlay(p);
        RootPanel.get().add(map);
      }
    });
  }
View Full Code Here

   * Test the Polygon constructor with the PolygonOptions in the constructor.
   */
  public void testPolygonWithOptionsClickable() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(0, 0), 3);
        map.setSize("500px", "400px");
        LatLng[] points = { //
        LatLng.newInstance(45, 45), //
            LatLng.newInstance(45, -45), //
            LatLng.newInstance(0, 0)};
        PolygonOptions opts = PolygonOptions.newInstance(false);
        Polygon p = new Polygon(points, "#ff0000", 3, 1.0, "#0000ff", 0.3, opts);
        map.addOverlay(p);
        RootPanel.get().add(map);
      }
    });
  }
View Full Code Here

    grid.getCellFormatter().setVerticalAlignment(0, 0,
        HasVerticalAlignment.ALIGN_TOP);
    grid.getCellFormatter().setWidth(0, 1, "300px");
    grid.getCellFormatter().setVerticalAlignment(0, 1,
        HasVerticalAlignment.ALIGN_TOP);
    map = new MapWidget(LatLng.newInstance(42.351505, -71.094455), 15);
    map.setHeight("480px");
    grid.setWidget(0, 0, map);
    DirectionsPanel directionsPanel = new DirectionsPanel();
    grid.setWidget(0, 1, directionsPanel);
    directionsPanel.setSize("100%", "100%");
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);
        InfoWindowContent content = new InfoWindowContent("<i>Hello World!</i>");
        InfoWindow info = map.getInfoWindow();
        info.open(m, content);
        DeferredCommand.addCommand(new Command() {

          public void execute() {
            m.closeInfoWindow();
View Full Code Here

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

  }

  private final MapWidget map;

  public ClickDemo() {
    map = new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13);
    map.setSize("500px", "300px");
    initWidget(map);
    // Workaround for bug with click handler & setUItoDefaults() - see issue 260
    MapUIOptions opts = map.getDefaultUI();
    opts.setDoubleClick(false);
    map.setUI(opts);

    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

  public void testMarkerShowMapBlowupContent() {
    loadApi(new Runnable() {
      public void run() {
        LatLng center = LatLng.newInstance(0, 0);
        final MapWidget map = new MapWidget(center, 1);
        map.setSize("300px", "300px");
        Marker m = new Marker(center);
        map.addOverlay(m);
        RootPanel.get().add(map);
        MapBlowupContent content = new MapBlowupContent(
            MapType.getSatelliteMap(), 3);
        m.showMapBlowup(content);
      }
View Full Code Here

            finishTest();
          }

        });

        final MapWidget map = new MapWidget();
        map.setSize("300px", "300px");
        map.addOverlay(marker1);
        RootPanel.get().add(map);

        marker1.trigger(new MarkerClickEvent(marker1));
      }
    }, false);
View Full Code Here

TOP

Related Classes of com.google.gwt.maps.client.MapWidget$MapPanel

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.