@Override public void animateCenterZoom(LatLng latLng, int zoom) { googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom)); }
@Override public void animateCenter(LatLng latLng) { googleMap.animateCamera(CameraUpdateFactory.newLatLng(latLng)); }
@Override public void onLocationChanged(Location location) { if (mapLocationListener != null) { mapLocationListener.onLocationChanged(location); LatLng latlng= new LatLng(location.getLatitude(), location.getLongitude()); CameraUpdate cu=CameraUpdateFactory.newLatLng(latlng); map.animateCamera(cu); } }
private void setUpMap() { map.setMyLocationEnabled(true); map.animateCamera(zoomToLastKnownLatLng()); }
@Override public void setZoom(int zoom) { googleMap.animateCamera( CameraUpdateFactory.newLatLngZoom(googleMap.getCameraPosition().target, zoom)); }
@Override public void onMapReady(GoogleMap map) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } }
@Override public boolean onClusterClick(Cluster<Person> cluster) { // Show a toast with some info when the cluster is clicked. String firstName = cluster.getItems().iterator().next().name; Toast.makeText(this, cluster.getSize() + " (including " + firstName + ")", Toast.LENGTH_SHORT).show(); // Zoom in the cluster. Need to create LatLngBounds and including all the cluster items // inside of bounds, then animate to center of the bounds. // Create the builder to collect all essential cluster items for the bounds. LatLngBounds.Builder builder = LatLngBounds.builder(); for (ClusterItem item : cluster.getItems()) { builder.include(item.getPosition()); } // Get the LatLngBounds final LatLngBounds bounds = builder.build(); // Animate camera to the bounds try { getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100)); } catch (Exception e) { e.printStackTrace(); } return true; }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarkers(map); map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater(), models)); map.setOnInfoWindowClickListener(this); }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations, false, 180); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet, false, 0); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3, true, 90); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy, true, 270); }
@Override public void onMapReady(GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); }
@Override public void onMapReady(final GoogleMap map) { this.map=map; if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); markerToAnimate= addMarker(map, LINCOLN_CENTER.latitude, LINCOLN_CENTER.longitude, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); }
@SuppressLint("MissingPermission") @Override public void onMapReady(final GoogleMap map) { this.map=map; if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater())); map.setOnInfoWindowClickListener(this); map.setMyLocationEnabled(true); locMgr=(LocationManager)getSystemService(LOCATION_SERVICE); crit.setAccuracy(Criteria.ACCURACY_FINE); follow(); }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater())); map.setOnInfoWindowClickListener(this); }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations, "UN_HQ.jpg"); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet, "Avery_Fisher_Hall.jpg"); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3, "Carnegie_Hall.jpg"); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy, null); map.setInfoWindowAdapter(new PopupAdapter(this, getLayoutInflater(), images)); map.setOnInfoWindowClickListener(this); }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations, 45); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet, 135); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3, 225); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy, 315); map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater())); map.setOnInfoWindowClickListener(this); map.setOnMarkerClickListener(this); }
@Override public void onMapReady(final GoogleMap map) { if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); } map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater())); map.setOnInfoWindowClickListener(this); map.setOnMarkerDragListener(this); }
@Override public void onMapReady(final GoogleMap map) { this.map=map; if (needsInit) { CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044, -73.98180484771729)); CameraUpdate zoom=CameraUpdateFactory.zoomTo(15); map.moveCamera(center); map.animateCamera(zoom); } addMarker(map, 40.748963847316034, -73.96807193756104, R.string.un, R.string.united_nations); addMarker(map, 40.76866299974387, -73.98268461227417, R.string.lincoln_center, R.string.lincoln_center_snippet); addMarker(map, 40.765136435316755, -73.97989511489868, R.string.carnegie_hall, R.string.practice_x3); addMarker(map, 40.70686417491799, -74.01572942733765, R.string.downtown_club, R.string.heisman_trophy); map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater())); map.setOnInfoWindowClickListener(this); map.setOnCameraMoveStartedListener(this); map.setOnCameraMoveListener(this); map.setOnCameraMoveCanceledListener(this); map.setOnCameraIdleListener(this); }
/** * Click handler for clamping to Pacific button. * @param view */ public void onClampToPacific(View view) { if (!checkReady()) { return; } mMap.setLatLngBoundsForCameraTarget(PACIFIC); mMap.animateCamera(CameraUpdateFactory.newCameraPosition(PACIFIC_CAMERA)); }
map.animateCamera(zoom);