Class MapEventsHandler

  • All Implemented Interfaces:
    com.pointrlabs.core.management.PTRListener , com.pointrlabs.core.map.models.events_listeners.MapEventsListener

    
    public class MapEventsHandler
     implements MapEventsListener
                        

    Default handler PTRMapFragment. This class is responsible to act on user interactions and view presentation.

    This is the appropriate class to override if it's required customize the certain behaviours while keeping the defaults.

    • Method Detail

      • mapDidStartLoading

         Unit mapDidStartLoading(PTRMapFragment mapFragment)

        This function is triggered when the map starts loading. The default behavior is to display the loading view and update any visible action buttons.

        Parameters:
        mapFragment - The map that triggered the event.
      • mapDidEndLoading

         Unit mapDidEndLoading(PTRMapFragment mapFragment)

        This function is triggered when the map finishes loading. The default behavior is to hide the loading view if visible, update any visible action buttons and zoom to predefined POI if defined.

        Parameters:
        mapFragment - The map that triggered the event.
      • mapDidUpdateStyle

         Unit mapDidUpdateStyle(PTRMapFragment mapFragment)

        This function is triggered when Style of the map updated.

        Parameters:
        mapFragment - The map that triggered the event.
      • mapDidFailToLoad

        @Deprecated(message = "use [mapDidFailToLoad(mapFragment: PTRMapFragment, ptrError: PTRError)] instead", replaceWith = @ReplaceWith(imports = {"com.pointrlabs.core.map.models.events_listeners.MapEventsListener"}, expression = "mapDidFailToLoad(mapFragment: PTRMapFragment, ptrError: PTRError)")) Unit mapDidFailToLoad(PTRMapFragment mapFragment, Exception failure)

        This function is triggered when the map fails to load. The default behavior is to display a dialog about error.

        Parameters:
        mapFragment - The map that triggered the event.
        failure - Information about the error
      • mapDidFailToLoad

         Unit mapDidFailToLoad(PTRMapFragment mapFragment, PTRError ptrError)

        This function is triggered when the map fails to load. The default behavior is to display a dialog about error.

        Parameters:
        mapFragment - The map that triggered the event.
        ptrError - Information about the error
      • mapDidReceiveTapOnPoi

         Unit mapDidReceiveTapOnPoi(PTRMapFragment mapFragment, Poi poi)

        This function is triggered when a poi is tapped on the map. The default behavior is to zoom to the poi's location, highlight and display the POI detail view.

        Parameters:
        mapFragment - The map that triggered the event.
        poi - Tapped Poi
      • onMapDidReceiveTapOnCar

         Unit onMapDidReceiveTapOnCar(PTRMapFragment mapFragment, Feature feature)

        This function is triggered when a feature of type car is tapped on the map.

        Parameters:
        feature - The feature of type car object which was tapped.
      • mapDidReceiveTap

         Unit mapDidReceiveTap(PTRMapFragment mapFragment, CalculatedLocation tappedLocation)

        This function is triggered when the map is tapped.

        Parameters:
        mapFragment - The map that triggered the event.
        tappedLocation - Tapped Location information
      • mapDidChangeLevel

         Unit mapDidChangeLevel(PTRMapFragment mapFragment, Level level, Boolean shouldZoomToLevel)

        This function is triggered when the map level changes. The default behavior is to update the level selector.

        Parameters:
        mapFragment - The map that triggered the event.
        level - The current displayed level.
        shouldZoomToLevel - A flag to decide whether to zoom to the level or not.
      • mapDidChangeRegion

         Unit mapDidChangeRegion(PTRMapFragment mapFragment, Boolean animated)

        Method to be triggered after map changes displayed region

        Parameters:
        animated - True if the change was animated, false otherwise.
      • mapDidRotate

         Unit mapDidRotate(PTRMapFragment mapFragment, Double rotationalDirection)

        This function is triggered when the map rotates.

        Parameters:
        rotationalDirection - Rotational direction in degrees clockwise from true north.
      • mapDidZoom

         Unit mapDidZoom(PTRMapFragment mapFragment, Double zoomValue)

        This function is triggered when the map changes the zoom level.

        Parameters:
        zoomValue - The new zoom level.