First of all my question is a bit different from other questions about GeoFencing in gmap in Android.
When the user start to define a circle as a GeoFence area I want to show a fixed circle in the center of the screen. In this stage the user should be able to move the map and map's zoom level. Neither move action nor zoom in/out action can change the size of the circle relative to the screen.
When the user press to save button I want to pin that circle to the map as a CircleOption object. Then I will be able to get lon/lat and radius of CircleOption object in meters.
I am currently working on RelativeLayout issue. I draw a fixed circle with RelativeLayout as I expect however I couldn't get current radius of that RelativeLayout circle. You can see how my RelativeLayout looks like right now:
I am not sure about the correct way of doing this. My searches redirected me to use RelativeLayout and then CircleOption. What is your advice?
Thanks in advance!
https://developers.google.com/android/reference/com/google/android/gms/maps/model/Circle
CircleOptions circleOptions = new CircleOptions()
.center( new LatLng(fence.getLatitude(), fence.getLongitude()) )
.radius( fence.getRadius() )
.fillColor(0x40ff0000) <Your Color code>
.strokeColor(Color.TRANSPARENT)
.strokeWidth(2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With