Package com.google.gwt.maps.client.geom

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


    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

    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

    }
    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

      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

      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

    }
    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

        String description = "Googleplex";
        setProperty(location, "description", description);
        assertEquals(description, location.getDescription());

        LatLng ll = LatLng.newInstance(1, -1);
        setProperty(location, "latlng", ll);
        assertSame(ll, location.getLatLng());

        String panoId = "7";
        setProperty(location, "panoId", panoId);
View Full Code Here

      public void run() {
        final MapWidget m = new MapWidget();
        m.addMapClickHandler(new MapClickHandler() {
          public void onClick(MapClickEvent event) {
            Overlay o = event.getOverlay();
            LatLng p = event.getLatLng();
            assertEquals(event.getSender(), m);
            assertNotNull("maker is null", o);
            Marker marker = (Marker) o;
            assertTrue(marker.getLatLng().getLatitude() == 12.34);
            assertTrue(marker.getLatLng().getLongitude() == -22.2);
            assertNotNull("point is null", p);
            assertTrue(p.getLatitude() == 10.1);
            assertTrue(p.getLongitude() == 12.2);
            LatLng overlaylatlng = event.getOverlayLatLng();
            assertNotNull("overlaylatlng is null", overlaylatlng);
            assertEquals("Latitude didn't match for overlaylatlng", 1.0,
                overlaylatlng.getLatitude(), .001);
            assertEquals("Longitude didn't match for overlaylatlng", 2.0,
                overlaylatlng.getLongitude(), .001);
            finishTest();
          }
        });
        RootPanel.get().add(m);
        Marker marker = new Marker(LatLng.newInstance(12.34, -22.2));
View Full Code Here

    if (isFirefoxOnWindows()) {
      return;
    }
    loadApi(new Runnable() {
      public void run() {
        final LatLng mountEverest = LatLng.newInstance(27.988056, 86.925278);
        StreetviewPanoramaOptions options = StreetviewPanoramaOptions.newInstance();
        options.setLatLng(mountEverest);

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

TOP

Related Classes of com.google.gwt.maps.client.geom.LatLng

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.