Java源码示例:com.esri.arcgisruntime.mapping.view.GeoView
示例1
/**
* Synchronizes the viewpoint across Geoviews when the user is navigating.
*/
private void synchronizeViewpoints(GeoView geoView) {
if (geoView.isNavigating()) {
Viewpoint geoViewPoint = geoView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);
// loop through the available GeoViews. If it doesn't match the given GeoView, then set the GeoView to the other's viewpoint
for (GeoView anyGeoView : geoViewList) {
if (anyGeoView != geoView) {
anyGeoView.setViewpoint(geoViewPoint);
}
}
}
}
示例2
/**
* Synchronizes the viewpoint across GeoViews when the user is navigating.
*/
private static void synchronizeViewpoints(GeoView navigatingGeoView, GeoView geoViewToSync) {
if (navigatingGeoView.isNavigating()) {
Viewpoint navigatingViewpoint = navigatingGeoView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);
geoViewToSync.setViewpoint(navigatingViewpoint);
}
}
示例3
@Override
public void navigationChanged(NavigationChangedEvent navigationCompletedEvent) {
if (navigationCompletedEvent != null) {
GeoView source = navigationCompletedEvent.getSource();
if (source instanceof MapView) {
MapView mapView = (MapView) source;
Point pt = mapView.getVisibleArea().getExtent().getCenter();
Log.i(TAG, String.format("CenterPoint: X:%.6f, Y:%.6f", pt.getX(), pt.getY()));
Log.i(TAG, "Current scale: " + mapView.getMapScale());
}
}
}