Class PolylineManager

  • All Implemented Interfaces:
    com.google.android.gms.maps.GoogleMap.OnPolylineClickListener

    public class PolylineManager
    extends java.lang.Object
    implements com.google.android.gms.maps.GoogleMap.OnPolylineClickListener
    Keeps track of collections of polylines on the map. Delegates all Polyline-related events to each collection's individually managed listeners.

    All polyline operations (adds and removes) should occur via its collection class. That is, don't add a polyline via a collection, then remove it via Polyline.remove()

    • Constructor Detail

      • PolylineManager

        public PolylineManager​(@NonNull
                               com.google.android.gms.maps.GoogleMap map)
    • Method Detail

      • onPolylineClick

        public void onPolylineClick​(@NonNull
                                    com.google.android.gms.maps.model.Polyline polyline)
        Specified by:
        onPolylineClick in interface com.google.android.gms.maps.GoogleMap.OnPolylineClickListener
      • newCollection

        public C newCollection​(java.lang.String id)
        Create a new named collection, which can later be looked up by getCollection(String)
        Parameters:
        id - a unique id for this collection.
      • getCollection

        public C getCollection​(java.lang.String id)
        Gets a named collection that was created by newCollection(String)
        Parameters:
        id - the unique id for this collection.
      • remove

        public boolean remove​(O object)
        Removes an object from its collection.
        Parameters:
        object - the object to remove.
        Returns:
        true if the object was removed.