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.
-
-
Constructor Summary
Constructors Constructor Description MapEventsHandler(PTRMapWidgetFragment mapWidgetFragment)
-
Method Summary
Modifier and Type Method Description Unit
mapDidStartLoading(PTRMapFragment mapFragment)
This function is triggered when the map starts loading. Unit
mapDidEndLoading(PTRMapFragment mapFragment)
This function is triggered when the map finishes loading. Unit
mapDidUpdateStyle(PTRMapFragment mapFragment)
This function is triggered when Style of the map updated. Unit
mapDidFailToLoad(PTRMapFragment mapFragment, Exception failure)
This function is triggered when the map fails to load. Unit
mapDidFailToLoad(PTRMapFragment mapFragment, PTRError ptrError)
This function is triggered when the map fails to load. Unit
mapDidReceiveTapOnPoi(PTRMapFragment mapFragment, Poi poi)
This function is triggered when a poi is tapped on the map. Unit
mapDidReceiveTapOnBuilding(PTRMapFragment mapFragment, Building building)
This function is triggered when a building is tapped on the map. Unit
mapDidReceiveTapOnSite(PTRMapFragment mapFragment, Site site)
This function is triggered when a site is tapped on the map. Unit
mapDidReceiveTapOnMarker(PTRMapViewMarker marker)
This function is triggered when a marker is tapped on the map. Unit
mapDidReceiveTapOnFeature(PTRMapFragment mapFragment, Feature feature)
This function is triggered when a feature is tapped on the map. Unit
mapDidReceiveTap(PTRMapFragment mapFragment, CalculatedLocation tappedLocation)
This function is triggered when the map is tapped. Unit
mapDidChangeLevel(PTRMapFragment mapFragment, Level level, Boolean shouldZoomToLevel)
This function is triggered when the map level changes. Unit
mapDidChangeTrackingMode(PTRMapFragment mapFragment, MapTrackingMode previousTrackingMode, MapTrackingMode newTrackingMode)
This function is triggered when the map tracking mode changes. Unit
mapDidDetectFocusedSite(PTRMapFragment mapFragment, Site site, List<Building> buildings)
Method to be called every time the focussed site or facilities changes Unit
mapDidChangeRegion(PTRMapFragment mapFragment, Boolean animated)
Method to be triggered after map changes displayed region Unit
mapDidReceiveFling(PTRMapFragment mapFragment)
Method to be triggered when a fling gesture is detected. Unit
mapDidRotate(PTRMapFragment mapFragment, Double rotationalDirection)
This function is triggered when the map rotates. Unit
mapDidScrollTo(PTRMapFragment mapFragment, PTRMapViewBounds bounds)
This function is triggered when the map view scrolls. Unit
mapDidZoom(PTRMapFragment mapFragment, Double zoomValue)
This function is triggered when the map changes the zoom level. Unit
mapDidDetectVisibleSites(PTRMapFragment mapFragment, List<Site> site, List<Building> buildings)
This function is triggered when the visible sites/buildings changes. -
-
Constructor Detail
-
MapEventsHandler
MapEventsHandler(PTRMapWidgetFragment mapWidgetFragment)
-
-
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
-
mapDidReceiveTapOnBuilding
Unit mapDidReceiveTapOnBuilding(PTRMapFragment mapFragment, Building building)
This function is triggered when a building is tapped on the map.
- Parameters:
mapFragment
- The map that triggered the event.building
- Tapped Building
-
mapDidReceiveTapOnSite
Unit mapDidReceiveTapOnSite(PTRMapFragment mapFragment, Site site)
This function is triggered when a site is tapped on the map.
- Parameters:
mapFragment
- The map that triggered the event.site
- Tapped Site
-
mapDidReceiveTapOnMarker
Unit mapDidReceiveTapOnMarker(PTRMapViewMarker marker)
This function is triggered when a marker is tapped on the map.
- Parameters:
marker
- The annotation object which was tapped.
-
mapDidReceiveTapOnFeature
Unit mapDidReceiveTapOnFeature(PTRMapFragment mapFragment, Feature feature)
This function is triggered when a feature is tapped on the map.
- Parameters:
feature
- The feature 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.
-
mapDidChangeTrackingMode
Unit mapDidChangeTrackingMode(PTRMapFragment mapFragment, MapTrackingMode previousTrackingMode, MapTrackingMode newTrackingMode)
This function is triggered when the map tracking mode changes. The default behavior is to update LocationUpdatesEventsHandler.
- Parameters:
mapFragment
- The map that triggered the event.previousTrackingMode
- Previously selected tracking mode.newTrackingMode
- Newly selected tracking mode.
-
mapDidDetectFocusedSite
Unit mapDidDetectFocusedSite(PTRMapFragment mapFragment, Site site, List<Building> buildings)
Method to be called every time the focussed site or facilities changes
- Parameters:
site
- : The focussed site.buildings
- : The focussed facilities.
-
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.
-
mapDidReceiveFling
Unit mapDidReceiveFling(PTRMapFragment mapFragment)
Method to be triggered when a fling gesture is detected.
-
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.
-
mapDidScrollTo
Unit mapDidScrollTo(PTRMapFragment mapFragment, PTRMapViewBounds bounds)
This function is triggered when the map view scrolls.
- Parameters:
bounds
- New visible bounds after scrolling
-
mapDidZoom
Unit mapDidZoom(PTRMapFragment mapFragment, Double zoomValue)
This function is triggered when the map changes the zoom level.
- Parameters:
zoomValue
- The new zoom level.
-
mapDidDetectVisibleSites
Unit mapDidDetectVisibleSites(PTRMapFragment mapFragment, List<Site> site, List<Building> buildings)
This function is triggered when the visible sites/buildings changes.
-
-
-
-