Stefce 146 Posting Pro

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.