Package com.google.gwt.maps.client

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


  }

  public void testSmallZoomControl() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget();
        map.setSize("300px", "300px");
        map.addControl(new SmallZoomControl());
        RootPanel.get().add(map);
      }
    });
  }
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));
        map.addOverlay(pline);
        RootPanel.get().add(map);
      }
    });
  }
View Full Code Here

   * Test the setEditngEnabled() method.
   */
  public void testPolylineSetEditingOptions() {
    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)};

        Polyline p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(true);

        p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(false);

        p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(PolyEditingOptions.newInstance(false));

        p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(PolyEditingOptions.newInstance(true));

        p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(PolyEditingOptions.newInstance(100));

        p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(PolyEditingOptions.newInstance(5, true));

        p = new Polyline(points);
        map.addOverlay(p);
        p.setEditingEnabled(PolyEditingOptions.newInstance(7, false));

        RootPanel.get().add(map);
      }
    });
View Full Code Here

   * Test the getVertexCount() method.
   */
  public void testPolylineVertexCount() {
    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)};
        Polyline p = new Polyline(points);
        map.addOverlay(p);
        RootPanel.get().add(map);
        assertEquals("vertex count", 3, p.getVertexCount());
      }
    });
  }
View Full Code Here

    options.setLatLng(tenthStreet);
    svClient = new StreetviewClient();
    panorama = new StreetviewPanoramaWidget(options);
    panorama.setSize("500px", "300px");

    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();
View Full Code Here

   * Test the getArea() method.
   */
  public void testGetArea() {
    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);
        double result = p.getArea();
        assertTrue("non-negative area", result > 0);
      }
    });
View Full Code Here

   * Test the simple Polygon constructor.
   */
  public void testPolygon() {
    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);
      }
    });
  }
View Full Code Here

   * Tests the fromEncoded() methods.
   */
  public void testPolygonFromEncoded() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget(LatLng.newInstance(33.75951619957536,
            -84.39289301633835), 20);
        map.setSize("500px", "400px");
        map.addMapType(MapType.getHybridMap());
        map.setCurrentMapType(MapType.getHybridMap());

        EncodedPolyline[] polylines = new EncodedPolyline[2];
        polylines[0] = EncodedPolyline.newInstance("{t`mEt_bbO?eAx@??dAy@?", 2,
            "BBBBB", 1);
        polylines[0].setColor("#ff00ff");
View Full Code Here

   * Test insertVertex() and deleteVerex().
   */
  public void testPolygonInsertDelete() {
    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);
        p.insertVertex(1, LatLng.newInstance(45, 0));
        p.deleteVertex(3);
      }
    });
View Full Code Here

  public CustomMapTypeDemo() {

    VerticalPanel vertPanel = new VerticalPanel();
    vertPanel.setStyleName("hm-panel");

    map = new MapWidget(LatLng.newInstance(33.7814790, -84.3880580), 13);
    map.setSize("500px", "450px");

    CopyrightCollection myCopyright = new CopyrightCollection("");
    myCopyright.addCopyright(new Copyright(1, LatLngBounds.newInstance(LatLng.newInstance(34,
        -81), LatLng.newInstance(36, -79)), 10, ""));
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.