Question: All of markers shows up on maps based from data latitude and longitude from firebase. And i want to show markers on maps only inside of the circle, circle radius from current place is 10 kilometers.

This is how i show all markers from Firebase

```
 LatLng newlocation = new LatLng(dataSnapshot.child("latitude").getValue(Double.class),dataSnapshot.child("longitude").getValue(Double.class));
      nama = new String(dataSnapshot.child("nama").getValue(String.class));
 googleMap.addMarker(new MarkerOptions().position(newlocation).title(nama+"")));

```

This is how i show a circle around current place location :

```
LatLng latLng = new LatLng(latitude, longitude);
    mMap.addCircle(new CircleOptions()
                            .center(latLng)
                            .radius(10000)
                            .strokeWidth(0f)
                            .fillColor(0x550000FF));

```

Please ask me for more detail!

Answer: 
Use this formula to find distance between two latitude and longitude this function will return distance in meter 

```
 double getDistance(double LAT1, double LONG1, double LAT2, double LONG2) {
    double distance = 2 * 6371000 * Math.asin(Math.sqrt(Math.pow((Math.sin((LAT2 * (3.14159 / 180) - LAT1 * (3.14159 / 180)) / 2)), 2) + Math.cos(LAT2 * (3.14159 / 180)) * Math.cos(LAT1 * (3.14159 / 180)) * Math.sin(Math.pow(((LONG2 * (3.14159 / 180) - LONG1 * (3.14159 / 180)) / 2), 2))));
    return distance;
}

```

you can implement the logical part associated with your problem easily
When you add markers to the map, store objects inside an array. Then use `computeDistanceBetween` to calculate distance and `setMap(null)` to hide away markers.

```
var markers;
// adding...
var centerLatlng = new google.maps.LatLng(-25.363882,131.044922);

markers.each(function(){
    var distance = google.maps.geometry.spherical.computeDistanceBetween (this.getPosition(), centerLatLng);
    if(distance > 10000) {
        this.setMap(null);
    }
});

```