How do I replace my android app Google maps radius circle with a blue translucent one as in image also blue marker with blue circle?

I can make the circle have a particular outline and fill but it doesn't look anywhere near as nice as the one depicted in the image below. How do I do that? my code so far is below also.

Code:

   private GoogleMap googleMap;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            try {
                initilizeMap();

            } catch (Exception e) {
                e.printStackTrace();
            }

        }
        private void initilizeMap() {
            if (googleMap == null) {
                googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                        R.id.map)).getMap();


                  LatLng latLng = new LatLng(28.982518, -81.542272);
                  gooleMap.addMarker(new MarkerOptions().position(latLng));


                  Circle circle =  gooleMap.addCircle(new CircleOptions()
                  .center(new LatLng(28.982518, -81.542272))
                  .radius(1000)
                  .strokeColor(Color.RED)
                  .fillColor(Color.PURPLE));

    mMap.addCircle(new CircleOptions()
            .center(center)
            .radius(radius)
            .strokeWidth(0f)
            .fillColor(0x550000FF));

            }
        }

        @Override
        protected void onResume() {
            super.onResume();
            initilizeMap();
        }
    }

Android xml:

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <fragment
            android:id="@+id/map"
            android:name="com.google.android.gms.maps.MapFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </RelativeLayout>

Image:

[img]http://i.stack.imgur.com/gx99C.jpg[/img]

Recommended Answers

All 6 Replies

Couldn't remember the email I used to sign up. Are you able to help me on the question above?

Well you are applying just a colour as red and purple. From image it does appear that stroke is something around 7F77DE where fill has some opacity applied to it and is around DAD7DE. Obviously you need to apply some stronger colour and then play around with alpha settings for that colour

How do I alter the opacity? That's the bit that I'm stuck on. I've managed how to get the fill etc, the way I want it. It's just the opacity of the light blue I'm stuck on now

Colour can be 6 characters when it is RRGGBB (red, green, blue) or 8 characters AARRGGBB (alpha, red, green, blue) so you need to adjust alpha

May have figured it out :-)

What hex color would you say would be used in the fill of the circle above?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.