I have code that allows me to input the location name with the lat and longitude and then the map displays the location with a marker.
The issue i am having is that i want the map to show all the locations, each with its own marker on the map.
Below is the code i have used to get the one location showing on the map
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
googleMap.setOnMarkerClickListener(this);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
mVenues.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot s : dataSnapshot.getChildren()){
Venue venue = s.getValue(Venue.class);
LatLng location=new LatLng(venue.venueLat,venue.venueLong);
mMap.addMarker(new MarkerOptions().position(location).title(venue.venueName)).setIcon(BitmapDescriptorFactory.defaultMarker());
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
Any help is much apreciated
I have no errors just shows the one location that i have added to the firebasedatabase