@Override public void clearMarkers() { markers.clear(); googleMap.clear(); }
private void displayPlacesOnMap(List<Place> places) { if (map != null) { map.clear(); if (!places.isEmpty()) { LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder(); for (Place place : places) { // Creates a marker at the place location and with the place name LatLng position = place.getPosition(); String placeName = place.get(Place.NAME); if (position != null) { MarkerOptions markerOptions = new MarkerOptions() .position(position) .title(placeName); Marker marker = map.addMarker(markerOptions); marker.setTag(place); boundsBuilder.include(position); } } CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngBounds(boundsBuilder.build(), 100); map.moveCamera(cameraUpdate); } } }
@Override public void onViewRecycled(RecyclerView.ViewHolder holder) { MapAdapter.ViewHolder mapHolder = (MapAdapter.ViewHolder) holder; if (mapHolder != null && mapHolder.map != null) { // Clear the map and free up resources by changing the map type to none. // Also reset the map when it gets reattached to layout, so the previous map would // not be displayed. mapHolder.map.clear(); mapHolder.map.setMapType(GoogleMap.MAP_TYPE_NONE); } } };
/** Called when the Clear button is clicked. */ public void onClearMap(View view) { if (!checkReady()) { return; } mMap.clear(); }
/** Called when the Reset button is clicked. */ public void onResetMap(View view) { if (!checkReady()) { return; } // Clear the map because we don't want duplicates of the markers. mMap.clear(); addMarkersToMap(); }
public void openPlaceAutoCompleteView() { mMap.clear(); this.listLatLng.clear(); try { Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_FULLSCREEN) .build(this); startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE); } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) { // TODO: Handle the error. } }
@Override public void onCameraMoveStarted(int reason) { if (!isCanceled) { mMap.clear(); } String reasonText = "UNKNOWN_REASON"; currPolylineOptions = new PolylineOptions().width(5); switch (reason) { case OnCameraMoveStartedListener.REASON_GESTURE: currPolylineOptions.color(Color.BLUE); reasonText = "GESTURE"; break; case OnCameraMoveStartedListener.REASON_API_ANIMATION: currPolylineOptions.color(Color.RED); reasonText = "API_ANIMATION"; break; case OnCameraMoveStartedListener.REASON_DEVELOPER_ANIMATION: currPolylineOptions.color(Color.GREEN); reasonText = "DEVELOPER_ANIMATION"; break; } Log.i(TAG, "onCameraMoveStarted(" + reasonText + ")"); addCameraTargetToPath(); }
@Override public final void clear() { map.clear(); }
/** * Clears all markers from the map. */ public void clearMarkers() { mGoogleMap.clear(); markers.clear(); }
@Override public void clearMarkers() { if (isMapReady) mMap.clear(); mMarkers.clear(); }
public void addCustomPin() { if (googleMap != null) { googleMap.clear(); for (int i = 0; i < latLngsArrayList.size(); i++) { addPin(latLngsArrayList.get(i), i); } } }
@Override public void onMovedToScrapHeap(View view) { ViewHolder holder = (ViewHolder) view.getTag(); if (holder != null && holder.map != null) { holder.map.clear(); holder.map.setMapType(GoogleMap.MAP_TYPE_NONE); } } };
public void addSelectedCustomPin(int position) { if (googleMap != null) { googleMap.clear(); for (int i = 0; i < latLngsArrayList.size(); i++) { addMarkerSelectedPin(latLngsArrayList.get(i), i,position); } } }
/** * Resets the map by removing all points, lines and setting the text to 0 */ void clear() { mMap.clear(); trace.clear(); lines.clear(); points.clear(); distance = 0; updateValueText(); }
@Override public void onClick(View view) { stopTimer(); map.clear(); addMarkerMe(map, myLatLng.latitude, myLatLng.longitude,"Me", mNama); btnStop.setVisibility(View.GONE); Button btnStartTujuan=(Button)findViewById(R.id.btnStartTujuan); btnStartTujuan.setVisibility(View.VISIBLE); Toast.makeText(getBaseContext(),"Silahkan naikan penumpang, klik tombol Start " + " apabila sudah mulai mengantarkan ke tempat tujuan.",Toast.LENGTH_LONG).show(); } });
@Override public void onCameraChange(CameraPosition cameraPosition) { Log.d("Camera postion change" + "", cameraPosition + ""); mCenterLatLong = cameraPosition.target; mMap.clear(); try { Location mLocation = new Location(""); mLocation.setLatitude(mCenterLatLong.latitude); mLocation.setLongitude(mCenterLatLong.longitude); startIntentService(mLocation); mLocationMarkerText.setText("Lat : " + mCenterLatLong.latitude + "," + "Long : " + mCenterLatLong.longitude); } catch (Exception e) { e.printStackTrace(); } } });
@Override public void onLocationChanged(Location location) { //Every time we change location we clear the map and update our zoom and marker location. mMap.clear(); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()),10)); mMap.addMarker(new MarkerOptions().position(new LatLng(location.getLatitude(), location.getLongitude())).title("Your Location")); updateLocation(location); }
private void setMapLocation(Location l) { if (map != null && l != null) { LatLng latLng = new LatLng(l.getLatitude(), l.getLongitude()); CameraUpdate update = CameraUpdateFactory.newLatLngZoom(latLng, 15); map.animateCamera(update); Log.d(TAG, "setMapLocation: " + l); TextView text = (TextView) findViewById(R.id.text); text.setText(String.format("Lat/Lnt %f/%f, provider: %s", l.getLatitude(), l.getLongitude(), l.getProvider())); // Desenha uma bolinha vermelha CircleOptions circle = new CircleOptions().center(latLng); circle.fillColor(Color.RED); circle.radius(25); // Em metros map.clear(); map.addCircle(circle); } }
private void refreshMap(){ map.clear(); if(mWaitingDriver) { addMarkerAsal(); addMarkerTujuan(); DrawRoutePoly(); } getDriverCurrentLocation(); addMarkerDrivers(); } private void initControls(){
@Override public void onMapClick(LatLng latLng) { map.clear(); map.addMarker(new MarkerOptions() .position(new LatLng(latLng.latitude, latLng.longitude)) .title("Starting Point") .icon(BitmapDescriptorFactory.fromResource(R.drawable.antar)) ); myLatLng=latLng; } @Override