Like the infoWindows click a specific Object,



  • google map filled with markers from ArrayList<Object>, Question in the following way for the infoWindows to transmit the specific Оbject

    public void onInfoWindowClick(Marker marker) {
    
            Intent route = new Intent(getActivity(), Details.class);
                                route.putExtra("route", route);
                                startActivity(route);
                            }
    



  • https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.html#addMarker%28com.google.android.gms.maps.model.MarkerOptions%29 returning the reference to the added value Marker♪ This reference can be retained in a separate table (type) HashMap<Marker, YourObject>and then get the object.

    GoogleMap does not guarantee that the facility is in onInfoWindowClick(Marker marker) It'll be the same as the object. marker = gmap.addMarker(..)so you need to use it to compare. marker.equals (sighs) HashMap This is the case.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2