Add current location marker and remove circle around it

This commit is contained in:
neslihanturan 2019-06-01 14:39:56 +03:00
parent 05fba7da03
commit a7d35ed02d

View file

@ -245,15 +245,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
MarkerOptions currentLocationMarkerOptions = new MarkerOptions() MarkerOptions currentLocationMarkerOptions = new MarkerOptions()
.position(new com.mapbox.mapboxsdk.geometry.LatLng(curLatLng.getLatitude(), curLatLng.getLongitude())); .position(new com.mapbox.mapboxsdk.geometry.LatLng(curLatLng.getLatitude(), curLatLng.getLongitude()));
currentLocationMarkerOptions.setIcon(icon); // Set custom icon currentLocationMarkerOptions.setIcon(icon); // Set custom icon
mapboxMap.addMarker(currentLocationMarkerOptions);
List<com.mapbox.mapboxsdk.geometry.LatLng> circle = createCircleArray(curLatLng.getLatitude(), curLatLng.getLongitude(),
curLatLng.getAccuracy() * 2, 100);
PolygonOptions currentLocationPolygonOptions = new PolygonOptions()
.addAll(circle)
.strokeColor(Color.parseColor("#55000000"))
.fillColor(Color.parseColor("#11000000"));
mapboxMap.addPolygon(currentLocationPolygonOptions);
} }
//TODO: go to util //TODO: go to util