I have drawn a line between two points in google maps. Now I want to add markers in that line for a particular distance.`
[![mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng latLng) {
MarkerOptions marker = new MarkerOptions().position(
new LatLng(latLng.latitude, latLng.longitude)).title("New Marker");
mMap.addMarker(marker).setDraggable(true);
mTempCollection.add(latLng);
mPolylineOptions.getPoints().clear();
mPolylineOptions.addAll(mTempCollection);
LatLngBounds latLngBounds = getPolygonCenterPoint(mTempCollection);
double distance = SphericalUtil.computeDistanceBetween(latLngBounds.southwest, latLngBounds.northeast);
Log.d(TAG, "distance: " + distance);
int plotmarkers = (int)(distance / 10);
mPolylineOptions.color(Color.GREEN);
mMap.addMarker(new MarkerOptions()
.position(latLngBounds.getCenter()));
mMap.addPolyline(mPolylineOptions);
}
});
`
In this line, I want to add markers of a particular distance.
I have found this link which in javascript can it be done for android?
How to add markers on Google Maps polylines based on distance along the line?