Java 类com.google.android.gms.maps.GoogleMap.CancelableCallback 实例源码

项目:VR-One    文件:MapActivity.java   
/**
 * Called when the Animate To "Go To Analog Stick" button is clicked.
 */
public void onGoToVrController(View view) {

    if (!checkReady()) {
        return;
    }

    changeCamera(CameraUpdateFactory.newCameraPosition(vrControllerCameraPos), new CancelableCallback() {
        @Override
        public void onFinish() {
            Toast.makeText(getBaseContext(), "Animation to Analog Stick complete", Toast.LENGTH_SHORT)
                    .show();
        }

        @Override
        public void onCancel() {
            Toast.makeText(getBaseContext(), "Animation to Analog Stick canceled", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
项目:mage-android    文件:MapFragment.java   
@Override
public boolean onMyLocationButtonClick() {
    if (location != null) {
        LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
        float zoom = map.getCameraPosition().zoom < 15 ? 15 : map.getCameraPosition().zoom;
        map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom), new CancelableCallback() {

            @Override
            public void onCancel() {
                mapWrapper.setOnMapPanListener(MapFragment.this);
                followMe = true;
            }

            @Override
            public void onFinish() {
                mapWrapper.setOnMapPanListener(MapFragment.this);
                followMe = true;
            }
        });
    }
    return true;
}
项目:geofenceeditor    文件:GeofenceEditorActivity.java   
public void setLocation(final double latitude, final double longitude, final int zoom) {
    CameraUpdate update;
    if (-1 == zoom) {
        update = CameraUpdateFactory.newLatLng(new LatLng(latitude, longitude));
    } else {
        update = CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), zoom);
    }

    mMap.animateCamera(update, 1000, new CancelableCallback() {
        @Override
        public void onFinish() {
            completeSetLocation(latitude, longitude, zoom);
        }

        @Override
        public void onCancel() {
        }
    });
}
项目:XamarinAdmobTutorial    文件:CameraDemoActivity.java   
/**
 * Called when the Animate To Sydney button is clicked.
 */
public void onGoToSydney(View view) {
    if (!checkReady()) {
        return;
    }

    changeCamera(CameraUpdateFactory.newCameraPosition(SYDNEY), new CancelableCallback() {
        @Override
        public void onFinish() {
            Toast.makeText(getBaseContext(), "Animation to Sydney complete", Toast.LENGTH_SHORT)
                    .show();
        }

        @Override
        public void onCancel() {
            Toast.makeText(getBaseContext(), "Animation to Sydney canceled", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
项目:HereAStory-Android    文件:CameraDemoActivity.java   
/**
 * Called when the Animate To Sydney button is clicked.
 */
public void onGoToSydney(View view) {
    if (!checkReady()) {
        return;
    }

    changeCamera(CameraUpdateFactory.newCameraPosition(SYDNEY), new CancelableCallback() {
        @Override
        public void onFinish() {
            Toast.makeText(getBaseContext(), "Animation to Sydney complete", Toast.LENGTH_SHORT)
                    .show();
        }

        @Override
        public void onCancel() {
            Toast.makeText(getBaseContext(), "Animation to Sydney canceled", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
项目:GoogleMapsV2Demo    文件:CameraDemoActivity.java   
/**
 * Called when the Animate To Sydney button is clicked.
 */
public void onGoToSydney(View view) {
    if (!checkReady()) {
        return;
    }

    changeCamera(CameraUpdateFactory.newCameraPosition(SYDNEY), new CancelableCallback() {
        @Override
        public void onFinish() {
            Toast.makeText(getBaseContext(), "Animation to Sydney complete", Toast.LENGTH_SHORT)
                    .show();
        }

        @Override
        public void onCancel() {
            Toast.makeText(getBaseContext(), "Animation to Sydney canceled", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
项目:XamarinAdmobTutorial    文件:CameraDemoActivity.java   
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    boolean animated = ((CompoundButton) findViewById(R.id.animate)).isChecked();
    if (animated) {
        mMap.animateCamera(update, callback);
    } else {
        mMap.moveCamera(update);
    }
}
项目:disconnected-content-explorer-android    文件:ReportMapFragment.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    map = googleMap;

    map.setMapType(GoogleMap.MAP_TYPE_NONE);

    map.setOnInfoWindowClickListener(this);
    map.setOnMapClickListener(this);
    map.setOnMarkerClickListener(this);
    map.setOnMapLongClickListener(this);

    LatLng latLng = new LatLng(0.0, 0.0);
    float zoom = map.getCameraPosition().zoom < 1 ? 1 : map.getCameraPosition().zoom;
    map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom), new CancelableCallback() {
        @Override
        public void onCancel() {
            // TODO
        }
        @Override
        public void onFinish() {
            // TODO
        }
    });

    offlineMap = new OfflineMap(map);
    offlineMap.setVisible(true);

    geoPackageMapOverlays = new GeoPackageMapOverlays(getActivity(), mapView, map);

    refreshMapMarkers();
}
项目:HereAStory-Android    文件:CameraDemoActivity.java   
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    if (mAnimateToggle.isChecked()) {
        if (mCustomDurationToggle.isChecked()) {
            int duration = mCustomDurationBar.getProgress();
            // The duration must be strictly positive so we make it at least 1.
            mMap.animateCamera(update, Math.max(duration, 1), callback);
        } else {
            mMap.animateCamera(update, callback);
        }
     } else {
        mMap.moveCamera(update);
    }
}
项目:GoogleMapsV2Demo    文件:CameraDemoActivity.java   
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    if (mAnimateToggle.isChecked()) {
        if (mCustomDurationToggle.isChecked()) {
            int duration = mCustomDurationBar.getProgress();
            // The duration must be strictly positive so we make it at least 1.
            mMap.animateCamera(update, Math.max(duration, 1), callback);
        } else {
            mMap.animateCamera(update, callback);
        }
    } else {
        mMap.moveCamera(update);
    }
}
项目:Shortest-Path-Direction-on-Google-Maps-v2-for-Android    文件:MapActivity.java   
/**
 * Change the camera position by moving or animating the camera depending on
 * input parameter.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback,
        boolean instant) {

    if (instant) {
        mMap.animateCamera(update, 1, callback);
    } else {
        mMap.animateCamera(update, 4000, callback);
    }
}
项目:businessmap    文件:ContactsMapFragment.java   
public boolean showMarkerInfoWindow(ContactsItem contact, boolean animate) {
    if (mMap == null || contact == null) {
        return false;
    }
    final Marker marker = mContactMarkerHashMap.get(contact.hashCode());
    if (marker == null) {
        return false;
    }
    if (animate) {
        mMap.animateCamera(
            CameraUpdateFactory.newCameraPosition(
                new CameraPosition.Builder()
                    .target(marker.getPosition())
                    .zoom(15.5f)
                    .build()
            ),
            new CancelableCallback() {
                @Override
                public void onCancel() {
                }

                @Override
                public void onFinish() {
                    marker.showInfoWindow();
                }
            }
        );
    } else {
        marker.showInfoWindow();
    }
    return true;
}
项目:clusterkraf    文件:Clusterkraf.java   
/**
 * Show the InfoWindow for the passed Marker and ClusterPoint
 * 
 * @param marker
 * @param clusterPoint
 */
public void showInfoWindow(Marker marker, ClusterPoint clusterPoint) {
    GoogleMap map = mapRef.get();
    if (map != null && marker != null && clusterPoint != null) {
        long dirtyUntil = System.currentTimeMillis() + options.getShowInfoWindowAnimationDuration();
        innerCallbackListener.clusteringOnCameraChangeListener.setDirty(dirtyUntil);
        CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLng(marker.getPosition());
        map.animateCamera(cameraUpdate, options.getShowInfoWindowAnimationDuration(), new CancelableCallback() {

            @Override
            public void onFinish() {
                innerCallbackListener.handler.post(new Runnable() {

                    @Override
                    public void run() {
                        innerCallbackListener.clusteringOnCameraChangeListener.setDirty(0);

                    }
                });
            }

            @Override
            public void onCancel() {
                innerCallbackListener.clusteringOnCameraChangeListener.setDirty(0);
            }
        });
        marker.showInfoWindow();
    }
}
项目:referendum_1o_android    文件:GoogleMapWrapper.java   
@Override
public final void animateCamera(CameraUpdate update, CancelableCallback callback) {
    map.animateCamera(update, callback);
}
项目:referendum_1o_android    文件:GoogleMapWrapper.java   
@Override
public final void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback) {
    map.animateCamera(update, durationMs, callback);
}
项目:Field-Work    文件:ATKMap.java   
public void animateCamera(CameraUpdate update, CancelableCallback callback){
    this.map.animateCamera(update, callback);
}
项目:Field-Work    文件:ATKMap.java   
public void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback){
    this.map.animateCamera(update, durationMs, callback);
}
项目:HereAStory-Android    文件:GoogleMapWrapper.java   
@Override
public final void animateCamera(CameraUpdate update, CancelableCallback callback) {
    map.animateCamera(update, callback);
}
项目:HereAStory-Android    文件:GoogleMapWrapper.java   
@Override
public final void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback) {
    map.animateCamera(update, durationMs, callback);
}
项目:OpenATKLib    文件:ATKMap.java   
public void animateCamera(CameraUpdate update, CancelableCallback callback){
    this.map.animateCamera(update, callback);
}
项目:OpenATKLib    文件:ATKMap.java   
public void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback){
    this.map.animateCamera(update, durationMs, callback);
}
项目:mtransit-for-android    文件:GoogleMapWrapper.java   
@Override
public final void animateCamera(CameraUpdate update, CancelableCallback callback) {
    map.animateCamera(update, callback);
}
项目:mtransit-for-android    文件:GoogleMapWrapper.java   
@Override
public final void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback) {
    map.animateCamera(update, durationMs, callback);
}
项目:Shortest-Path-Direction-on-Google-Maps-v2-for-Android    文件:MapActivity.java   
@Override
public void OnDirectionListReceived(List<LatLng> mPointList) {
    if (mPointList != null) {
        PolylineOptions rectLine = new PolylineOptions().width(10).color(
                Color.RED);
        for (int i = 0; i < mPointList.size(); i++) {
            rectLine.add(mPointList.get(i));
        }
        mMap.addPolyline(rectLine);

        CameraPosition mCPFrom = new CameraPosition.Builder()
                .target(startPosition).zoom(15.5f).bearing(0).tilt(25)
                .build();
        final CameraPosition mCPTo = new CameraPosition.Builder()
                .target(destinationPosition).zoom(15.5f).bearing(0)
                .tilt(50).build();

        changeCamera(CameraUpdateFactory.newCameraPosition(mCPFrom),
                new CancelableCallback() {
                    @Override
                    public void onFinish() {
                        changeCamera(CameraUpdateFactory
                                .newCameraPosition(mCPTo),
                                new CancelableCallback() {

                                    @Override
                                    public void onFinish() {

                                        LatLngBounds bounds = new LatLngBounds.Builder()
                                                .include(startPosition)
                                                .include(
                                                        destinationPosition)
                                                .build();
                                        changeCamera(
                                                CameraUpdateFactory
                                                        .newLatLngBounds(
                                                                bounds, 50),
                                                null, false);
                                    }

                                    @Override
                                    public void onCancel() {
                                    }
                                }, false);
                    }

                    @Override
                    public void onCancel() {
                    }
                }, true);
    }
}
项目:VR-One    文件:MapActivity.java   
/**
 * Change the camera position by moving or animating the camera depending on the state of the
 * animate toggle button.
 */
private void changeCamera(CameraUpdate update, CancelableCallback callback) {
    mMap.moveCamera(update);
}
项目:referendum_1o_android    文件:IGoogleMap.java   
void animateCamera(CameraUpdate update, CancelableCallback callback);
项目:referendum_1o_android    文件:IGoogleMap.java   
void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback);
项目:HereAStory-Android    文件:IGoogleMap.java   
void animateCamera(CameraUpdate update, CancelableCallback callback);
项目:HereAStory-Android    文件:IGoogleMap.java   
void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback);
项目:mtransit-for-android    文件:IGoogleMap.java   
void animateCamera(CameraUpdate update, CancelableCallback callback);
项目:mtransit-for-android    文件:IGoogleMap.java   
void animateCamera(CameraUpdate update, int durationMs, CancelableCallback callback);