Android : Android Google Maps Increase/decreas radius after adding

on Friday, April 17, 2015


Right now this is my code for my Android App. It adds a marker on the Google Maps when Long Click, then when you click on the marker it creates a circle marker and removes the normal marker. However I want to adjust the radius of the circle when I add it. Like incrase or decrease it when I move my finger up or down.



mMap.setOnMapLongClickListener(new OnMapLongClickListener() {

@Override
public void onMapLongClick(LatLng latLng) {

MarkerOptions Marker = new MarkerOptions().position(latLng);

mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));

mMap.addMarker(Marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.human)).draggable(true));
}
});



@Override
public boolean onMarkerClick(final Marker marker) {

LatLng pos = marker.getPosition();
marker.remove();
mMap.addCircle(new CircleOptions()
.center(pos)
.radius(radius)
.strokeColor(0xFFF7941D)
.fillColor(0x90F7941D));

return true;
}


Sorry, but does anyone know how to or where I can read more about? Thank you very much.


0 comments:

Post a Comment