Stefan_1 94 Posting Pro in Training

I want to create circle around marker but im having some troubles i have this code

Circle circle = mMap.addCircle(new CircleOptions()
    .center(new LatLng(-33.87365, 151.20689))
    .radius(10000)
    .strokeColor(Color.RED)
    .fillColor(Color.BLUE));

this code is drawing circle around Sydney but i want to create where i place the marker here is the code together with the marker creation:

 mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {

            @Override
            public void onMapClick(LatLng latLng) {

                // Creating a marker
                MarkerOptions markerOptions = new MarkerOptions();

                // Setting the position for the marker
                markerOptions.position(latLng);

                // Setting the title for the marker.
                // This will be displayed on taping the marker
                markerOptions.title(latLng.latitude + " : " + latLng.longitude);
                String title = markerOptions.getTitle();
                // Clears the previously touched position
                mMap.clear();

                // Animating to the touched position
                mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));

                // Placing a marker on the touched position
                mMap.addMarker(markerOptions);
                //Create circle around the marker
                Circle circle = mMap.addCircle(new CircleOptions()
                        .center(new LatLng(-33.87365, 151.20689))
                        .radius(10000)
                        .strokeColor(Color.RED)
                        .fillColor(Color.BLUE));
            }
        });
Be a part of the DaniWeb community

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