Examples of LatLng


Examples of com.google.gwt.maps.client.geom.LatLng

            assertEquals("convertLatLngToDivPixel().getX() == 250", 250,
                result.getX());
            assertEquals("convertLatLngToDivPixel().getY() == 250", 250,
                result.getY());

            LatLng latLng;
            latLng = m.convertContainerPixelToLatLng(Point.newInstance(100, 100));
            assertNotNull("convertContainerPixelToLatLng()", result);
            latLng = m.convertDivPixelToLatLng(Point.newInstance(100, 100));
            assertNotNull("convertDivPixelToLatLng()", result);

            latLng = m.convertContainerPixelToLatLng(Point.newInstance(250, 250));
            assertNotNull("convertContainerPixelToLatLng()", result);
            assertTrue(latLng.isEquals(LatLng.newInstance(0, 0)));
            latLng = m.convertDivPixelToLatLng(Point.newInstance(250, 250));
            assertNotNull("convertDivPixelToLatLng()", result);
            assertTrue(latLng.isEquals(LatLng.newInstance(0, 0)));
            finishTest();
          }
        }.schedule(1000);
      }
    }, false);
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

    handlerTable.setHTML(0, 2, "<b>Events</b>");
  }

  private void computeAtlantaTriangle() {
    LatLngBounds bounds = map.getBounds();
    LatLng center = map.getCenter();
    LatLng ne = bounds.getNorthEast();
    LatLng sw = bounds.getSouthWest();
    GWT.log("ne=" + ne + ", sw=" + sw, null);
    double vertDelta = ne.getLatitude() - sw.getLatitude();
    double horizDelta = ne.getLongitude() - sw.getLongitude();
    double vertGrid = vertDelta / 4.0;
    double horizGrid = horizDelta / 8.0;

    // A triangle pointing north to the west of the center of the map.
    ATLANTA_TRIANGLE1[0] = LatLng.newInstance(center.getLatitude() + vertGrid,
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

    icon.setIconAnchor(Point.newInstance(6, 20));
    icon.setInfoWindowAnchor(Point.newInstance(5, 1));

    // Add 10 markers to the map at random locations
    LatLngBounds bounds = map.getBounds();
    LatLng southWest = bounds.getSouthWest();
    LatLng northEast = bounds.getNorthEast();
    double lngSpan = northEast.getLongitude() - southWest.getLongitude();
    double latSpan = northEast.getLatitude() - southWest.getLatitude();
    MarkerOptions options = MarkerOptions.newInstance();
    options.setIcon(icon);
    for (int i = 0; i < 10; i++) {
      LatLng point = LatLng.newInstance(southWest.getLatitude() + latSpan
          * Math.random(), southWest.getLongitude() + lngSpan * Math.random());

      map.addOverlay(new Marker(point, options));
    }
  }
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

  public void testMapOptions() {
    loadApi(new Runnable() {
      public void run() {

        LatLng atlanta = LatLng.newInstance(33.7814790, -84.3880580);
        MapOptions options = MapOptions.newInstance();

        // Test the setters
        options.setBackgroundColor("#f00");
        options.setDraggableCursor("text");
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

  public void testReverseGeocoder() {
    loadApi(new Runnable() {
      public void run() {

        // Somewhere in Berlin, Germany (DE)
        final LatLng testPoint = LatLng.newInstance(52.51622, 13.39782);
        Geocoder geocoder = new Geocoder();
        geocoder.getLocations(testPoint, new LocationCallback() {

          public void onFailure(int statusCode) {
            assertTrue("Reverse Geocode of " + testPoint
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

    loadApi(new Runnable() {
      private int handleCount = 0;
      private double longitude = 0;

      public void run() {
        final LatLng tenthStreet = LatLng.newInstance(33.7814839, -84.3879353);
        StreetviewPanoramaOptions options = StreetviewPanoramaOptions.newInstance();
        options.setLatLng(tenthStreet);

        panorama = new StreetviewPanoramaWidget(options);
        panorama.setSize("500px", "300px");
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

    if (isFirefoxOnWindows()) {
      return;
    }
    loadApi(new Runnable() {
      public void run() {
        final LatLng tenthStreet = LatLng.newInstance(33.7814839, -84.3879353);
        final Pov pov = Pov.newInstance();
        pov.setPitch(-5).setYaw(180).setZoom(2);

        StreetviewPanoramaOptions options = StreetviewPanoramaOptions.newInstance();
        options.setLatLng(tenthStreet);
        options.setPov(pov);

        panorama = new StreetviewPanoramaWidget(options);
        panorama.setSize("500px", "300px");

        panorama.addInitializedHandler(new StreetviewInitializedHandler() {
          public void onInitialized(StreetviewInitializedEvent event) {
            LatLng point = panorama.getLatLng();
            assertEquals(tenthStreet.getLatitude(), point.getLatitude(), 1e-2);
            assertEquals(tenthStreet.getLongitude(), point.getLongitude(), 1e-2);

            Pov actualPov = panorama.getPov();
            assertEquals(pov.getPitch(), actualPov.getPitch(), 1e-2);
            assertEquals(pov.getYaw(), actualPov.getYaw(), 1e-2);
            // Intentionally not testing zoom, as it behaves unpredictably
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

    }
    super.gwtTearDown();
  }

  private StreetviewPanoramaWidget newDefaultPanorama() {
    LatLng tenthStreet = LatLng.newInstance(33.7814839, -84.3879353);
    StreetviewPanoramaOptions options = StreetviewPanoramaOptions.newInstance();
    options.setLatLng(tenthStreet);
    StreetviewPanoramaWidget panorama = new StreetviewPanoramaWidget(options);
    panorama.setSize("500px", "300px");
    return panorama;
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

      public void run() {
        StreetviewClient client = new StreetviewClient();
        client.getNearestPanorama(tenthStreet, new DataStreetviewCallback() {
          public void onDone(StreetviewData data) {
            assertEquals(ReturnValue.SUCCESS.getReturnCode(), data.getCode());
            LatLng point = data.getLocation().getLatLng();
            assertEquals(tenthStreet.getLatitude(), point.getLatitude(), 1e-2);
            assertEquals(tenthStreet.getLongitude(), point.getLongitude(), 1e-2);
            assertNotNull(data.getLinks());
            assertNotNull(data.getCopyright());
            assertNotNull(data.getLocation().getPanoId());
            assertNotNull(data.getLocation().getDescription());
            assertNotNull(data.getLocation().getPov());
View Full Code Here

Examples of com.google.gwt.maps.client.geom.LatLng

      public void doTest(String panoId) {
        client.getPanoramaById(panoId, new DataStreetviewCallback() {
          public void onDone(StreetviewData data) {
            assertEquals(ReturnValue.SUCCESS.getReturnCode(), data.getCode());
            LatLng point = data.getLocation().getLatLng();
            assertEquals(tenthStreet.getLatitude(), point.getLatitude(), 1e-2);
            assertEquals(tenthStreet.getLongitude(), point.getLongitude(), 1e-2);
            assertNotNull(data.getLinks());
            assertNotNull(data.getCopyright());
            assertNotNull(data.getLocation().getPanoId());
            assertNotNull(data.getLocation().getDescription());
            assertNotNull(data.getLocation().getPov());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.