Example usage for com.google.gwt.maps.client.streetview StreetViewPanoramaData getLocation

List of usage examples for com.google.gwt.maps.client.streetview StreetViewPanoramaData getLocation

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.streetview StreetViewPanoramaData getLocation.

Prototype

public final native StreetViewLocation getLocation() ;

Source Link

Document

gets Specifies the location meta-data for this panorama.

Usage

From source file:com.google.gwt.maps.testing.client.maps.StreetViewSideBySideMapWidget.java

License:Apache License

private void processPanoSearch(LatLng latlng, final StreetViewPanoramaData data, StreetViewStatus status) {
    if (status != StreetViewStatus.OK) {
        // TODO error
        return;/*w w  w  .  j a v a 2s .  co m*/
    }

    if (data == null) {
        // TODO error
        return;
    }

    // setup marker for location clicked
    MarkerOptions options = MarkerOptions.newInstance();
    options.setClickable(true);
    options.setPosition(latlng);
    options.setMap(mapWidget);
    options.setTitle(data.getLocation().getDescription());

    Marker marker = Marker.newInstance(options);

    // move back on click
    marker.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            moveStreetView(data);
        }
    });

    // move
    moveStreetView(data);
}

From source file:com.google.gwt.maps.testing.client.maps.StreetViewSideBySideMapWidget.java

License:Apache License

protected void moveStreetView(StreetViewPanoramaData data) {
    String markerPanoId = data.getLocation().getPano();

    StreetViewPov pov = StreetViewPov.newInstance();
    pov.setHeading(270);//w  w w.ja  va 2  s.  co m
    pov.setPitch(0);
    pov.setZoom(1);

    wStreetPano.setPano(markerPanoId);
    wStreetPano.setPov(pov);
    wStreetPano.setVisible(true);
}