Package com.google.gwt.maps.client

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


   * Test the "endline" event using a trigger.
   */
  public void testPolylineEndLineTrigger() {
    loadApi(new Runnable() {
      public void run() {
        final MapWidget m = new MapWidget();
        final Polyline polyline = setupPolyline(m);
        final LatLng testLatLng = LatLng.newInstance(31, 32);

        m.addOverlay(polyline);
        polyline.setDrawingEnabled();
        polyline.addPolylineEndLineHandler(new PolylineEndLineHandler() {

          public void onEnd(PolylineEndLineEvent event) {
            assertEquals("event.getLatLng()", testLatLng, event.getLatLng());
View Full Code Here


  public void testMarkerRemoveEvent() {
    loadApi(new Runnable() {
      public void run() {
        LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
        final MapWidget map = new MapWidget(atlanta, 13);
        map.setSize("300px", "300px");
        RootPanel.get().add(map);

        final Marker marker = new Marker(atlanta);
        map.addOverlay(marker);
        marker.addMarkerRemoveHandler(new MarkerRemoveHandler() {
          public void onRemove(MarkerRemoveEvent event) {
            assertEquals(event.getSender(), marker);
            finishTest();
          }
        });
        map.clearOverlays();
      }
    }, false);
  }
View Full Code Here

  public void testMarkerRemoveTrigger() {
    loadApi(new Runnable() {
      public void run() {
        LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
        final MapWidget map = new MapWidget(atlanta, 13);
        map.setSize("300px", "300px");
        RootPanel.get().add(map);

        final Marker marker = new Marker(atlanta);
        map.addOverlay(marker);
        marker.addMarkerRemoveHandler(new MarkerRemoveHandler() {
          public void onRemove(MarkerRemoveEvent event) {
            assertEquals(event.getSender(), marker);
            finishTest();
          }
View Full Code Here

  public void testMarkerVisibilityChangedEvent() {
    loadApi(new Runnable() {
      public void run() {
        LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
        final MapWidget map = new MapWidget(atlanta, 13);
        map.setSize("300px", "300px");
        RootPanel.get().add(map);

        final Marker marker = new Marker(atlanta);
        map.addOverlay(marker);
        marker.addMarkerVisibilityChangedHandler(new MarkerVisibilityChangedHandler() {
          public void onVisibilityChanged(MarkerVisibilityChangedEvent event) {
            assertEquals(event.getSender(), marker);
            assertFalse(event.isVisible());
            finishTest();
View Full Code Here

  public void testMarkerVisibilityChangedTrigger() {
    loadApi(new Runnable() {
      public void run() {
        LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
        final MapWidget map = new MapWidget(atlanta, 13);
        map.setSize("300px", "300px");
        RootPanel.get().add(map);

        final Marker marker = new Marker(atlanta);
        map.addOverlay(marker);
        marker.addMarkerVisibilityChangedHandler(new MarkerVisibilityChangedHandler() {
          public void onVisibilityChanged(MarkerVisibilityChangedEvent event) {
            assertEquals(event.getSender(), marker);
            assertTrue(event.isVisible());
            finishTest();
View Full Code Here

  }

  private MapWidget map;

  public DragMarkerDemo() {
    map = new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13);
    map.setSize("500px", "300px");
    initWidget(map);
  }
View Full Code Here

        event.cancel();
      }
    });
    panel.add(form);

    map = new MapWidget(LatLng.newInstance(34, 0), 1);
    map.setSize("100%", "480px");
    panel.add(map);

    Grid grid = new Grid((sampleAddresses.length / NUM_ADDRESS_COLUMNS) + 1,
        NUM_ADDRESS_COLUMNS);
View Full Code Here

    googleBarOptions.setStyle("new");
    MapOptions mapOptions = MapOptions.newInstance();
    mapOptions.setGoogleBarOptions(googleBarOptions);
    mapOptions.setSize(Size.newInstance(500, 600));
    // Dublin
    map = new MapWidget(LatLng.newInstance(53.350705, -6.264095), 13,
        mapOptions);
    // map.setUIToDefault();
    map.setGoogleBarEnabled(true);

    initWidget(map);
View Full Code Here

  private MapWidget map;

  public ReverseGeocoderDemo() {
    VerticalPanel outer = new VerticalPanel();
    map = new MapWidget(LatLng.newInstance(0, 0), 1);
    outer.add(map);
    map.setSize("500px", "300px");
    initWidget(outer);
    // Workaround for bug with click handler & setUItoDefaults() - see issue 260
    MapUIOptions opts = map.getDefaultUI();
View Full Code Here

  }

  public void testSimple() {
    loadApi(new Runnable() {
      public void run() {
        final MapWidget map = new MapWidget();
        map.setSize("300px", "300px");
        RootPanel.get().add(map);
        GeoXmlOverlay.load(KML_DEMO_URI, new GeoXmlLoadCallback() {
          @Override
          public void onFailure(String url, Throwable e) {
            assertTrue("testSimple: Expected success", false);
          }

          @Override
          public void onSuccess(String url, GeoXmlOverlay overlay) {
            assertNotNull("url", url);
            assertNotNull("overlay", overlay);
            map.addOverlay(overlay);
            assertNotNull("getDefaultBounds()", overlay.getDefaultBounds());
            assertNotNull("getDefaultCenter()", overlay.getDefaultCenter());
            assertNotNull("getDefaultSpan()", overlay.getDefaultSpan());
            overlay.gotoDefaultViewport(map);
            finishTest();
View Full Code Here

TOP

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

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.