Package com.google.gwt.maps.client

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


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


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

   * Tests the fromEncoded() methods.
   */
  public void testPolylineFromEncoded() {
    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 testPolylineInsertDelete() {
    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);
        p.insertVertex(1, LatLng.newInstance(45, 0));
        p.deleteVertex(3);
      }
    });
View Full Code Here

   * Test the polyline constructor with extra args, but not polylineOptions.
   */
  public void testPolylineNoOpts() {
    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, "#ff0000", 3, 1.0);
        map.addOverlay(p);
        RootPanel.get().add(map);
      }
    });
  }
View Full Code Here

   * Test the constructor using the PolylineOptions argument.
   */
  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));
        map.addOverlay(pline);
        RootPanel.get().add(map);
      }
    });
  }
View Full Code Here

  }

  public void testMapImpl() {
    loadApi(new Runnable() {
      public void run() {
        @SuppressWarnings("unused")
        MapWidget w = new MapWidget();
      }
    }, true, MAPS_MIN_VERSION);
  }
View Full Code Here

  }

  public void testDirections() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget();
        DirectionsPanel directionsPanel = new DirectionsPanel();
        DirectionQueryOptions opts = new DirectionQueryOptions(map,
            directionsPanel);
        String query = "from: 10 10th St NW, Atlanta, GA 30309 USA "
            + "to: 1600 Amphitheatre Parkway Mountain View, CA 94043 USA";
View Full Code Here

  }

  public void testDirectionsNoPanel() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget();
        DirectionQueryOptions opts = new DirectionQueryOptions(map);
        String query = "from: 10 10th St NW, Atlanta, GA 30309 USA "
            + "to: 1600 Amphitheatre Parkway Mountain View, CA 94043 USA";
        Directions.load(query, opts, new DirectionsCallback() {
View Full Code Here

  // A simple test to ensure none of the methods throws exceptions.
  public void testDirectionsQueryOptions() {
    loadApi(new Runnable() {
      public void run() {
        MapWidget map = new MapWidget();
        DirectionsPanel directionsPanel = new DirectionsPanel();
        DirectionQueryOptions opts = new DirectionQueryOptions(map,
            directionsPanel);
        opts.setAvoidHighways(true);
        opts.setLocale("de_DE");
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.