Package com.google.gwt.maps.client

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


  public MapEventDemo() {
    VerticalPanel vp = new VerticalPanel();

    // Center the new map on Midtown Atlanta
    map = new MapWidget(ATLANTA, 13);
    map.setSize("500px", "300px");
    map.setUIToDefault();

    MarkerOptions opt = MarkerOptions.newInstance();
    opt.setDraggable(true);
View Full Code Here


   */
  public void testMercatorProjection() {
    loadApi(new Runnable() {
      public void run() {
        TileLayer tileLayer = initTileLayer();
        MapWidget map = new MapWidget();
        map.setSize("300px", "300px");
        Projection projection = new MercatorProjection(20);
        assertNotNull("new MercatorProjection(20)", projection);
        MapType mapType = new MapType(new TileLayer[] {tileLayer}, projection,
            "MyMap");
        map.addMapType(mapType);
        RootPanel.get().add(map);
        map.setZoomLevel(10);
        map.setCurrentMapType(mapType);

        // Now try to call some of the MercatorProjection methods directly
        LatLng lResult = projection.fromPixelToLatLng(
            Point.newInstance(10, 10), map.getZoomLevel(), false);
        assertNotNull("translation from Pixel to LatLng", lResult);
        Point pResult = projection.fromLatLngToPixel(map.getCenter(),
            map.getZoomLevel());
        assertNotNull("translation from LatLng to Pixel", pResult);
        double dResult = projection.getWrapWidth(map.getZoomLevel());
        assertTrue("getWrapWidth()", dResult > 0);
        // Not sure how to test tileCheckRange()

        // The map gets recentered when its created and these callbacks
        // may fire multiple times. Give the test some time to quiesce.
View Full Code Here

   */
  public void testProjectionDefault() {
    loadApi(new Runnable() {
      public void run() {
        TileLayer tileLayer = initTileLayer();
        MapWidget map = new MapWidget();
        map.setSize("300px", "300px");
        Projection projection = new MercatorProjection(20);
        assertNotNull("new MercatorProjection(20)", projection);
        MapType mapType = new MapType(new TileLayer[] {tileLayer}, projection,
            "MyMap");
        map.addMapType(mapType);
        RootPanel.get().add(map);
        map.setZoomLevel(10);
        map.setCurrentMapType(mapType);

        // The map gets recentered when its created and these callbacks
        // may fire multiple times. Give the test some time to quiesce.
        new Timer() {
          public void run() {
View Full Code Here

   */
  public void testSubclassProjection() {
    loadApi(new Runnable() {
      public void run() {
        TileLayer tileLayer = initTileLayer();
        MapWidget map = new MapWidget();
        map.setSize("300px", "300px");
        Projection projection = new Projection() {

          @Override
          public Point fromLatLngToPixel(LatLng latlng, int zoomLevel) {
            assertNotNull(latlng);
            assertTrue("zoomLevel > 0", zoomLevel > 0);
            return Point.newInstance(1, 1);
          }

          @Override
          public LatLng fromPixelToLatLng(Point point, int zoomLevel,
              boolean unbounded) {
            assertNotNull(point);
            assertTrue("zoomLevel > 0", zoomLevel > 0);
            return LatLng.newInstance(45, 45);
          }

          @Override
          public double getWrapWidth(int zoomLevel) {
            assertTrue("zoomLevel > 0", zoomLevel > 0);
            return 100;
          }

          @Override
          public boolean tileCheckRange(TileIndex index, int zoomLevel,
              int tileSize) {
            assertNotNull("index", index);
            assertTrue("zoomLevel > 0", zoomLevel > 0);
            assertTrue("tileSize > 0", tileSize > 0);
            return false;
          }
        };

        MapType mapType = new MapType(new TileLayer[] {tileLayer}, projection,
            "MyMap");
        map.addMapType(mapType);
        RootPanel.get().add(map);
        map.setCurrentMapType(mapType);

        // The map gets recentered when its created and these callbacks
        // may fire multiple times. Give the test some time to quiesce.
        new Timer() {
          public void run() {
View Full Code Here

      controlPanel = vp;
      doResetDefaults();
    }

    private MapWidget newMapWidget() {
      MapWidget tmpMap = new MapWidget(LatLng.newInstance(37.4419, -122.1419),
          13);
      tmpMap.setSize(size.getWidth() + "px", size.getHeight() + "px");
      return tmpMap;
    }
View Full Code Here

  private MapWidget map;

  public EarthPluginDemo() {
    Panel panel = new FlowPanel();
    map = new MapWidget(LatLng.newInstance(37.42317, -122.08364), 16);
    map.setSize("500px", "500px");
    map.setUIToDefault();
    map.addMapType(MapType.getEarthMap());
    map.setCurrentMapType(MapType.getEarthMap());
    panel.add(map);
View Full Code Here

  private MapWidget map;

  public RoutedDirectionsDemo() {
    HorizontalPanel hp = new HorizontalPanel();
    map = new MapWidget(ATLANTA, 15);
    map.setSize("400px", "480px");
    map.setUIToDefault();
    map.getElement().getStyle().setPropertyPx("margin", 15);
    hp.add(map);
    DirectionsPanel directionsPanel = new DirectionsPanel();
View Full Code Here

  private Button editPolygonButton = new Button("Edit Last Polygon");

  public DrawingOverlayDemo() {

    // Go to Paris
    map = new MapWidget(LatLng.newInstance(48.859068, 2.344894), 12);
    map.setSize("500px", "400px");

    // Change the default UI controls a bit to help with drawing.
    MapUIOptions options = map.getDefaultUI();
    options.setScrollwheel(false);
View Full Code Here

  public InfoWindowDemo() {

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

    map = new MapWidget(ATLANTA, 13);
    vertPanel.add(map);

    actionListBox = new ListBox();
    actionListBox.addItem(TEST_DEFAULT);
    actionListBox.addItem(TEST_IMAGE);
View Full Code Here

  }

  private MapWidget map;

  public IconDemo() {
    map = new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13);
    map.setSize("500px", "300px");
    initWidget(map);
    map.setUIToDefault();
  }
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.