Interface MapProvider
-
- All Known Implementing Classes:
GoogleMapsMapProvider
public interface MapProvider
Operations to implement a map in the Outside Plant module.- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MapProvider.IdleEvent
Callback executed when idle.static class
MapProvider.MouseMoveEvent
Map mouse move event.static class
MapProvider.RightClickEvent
Map right click event.static class
MapProvider.ZoomChangedEvent
Map zoom change event
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MapEdge
addEdge(BusinessObjectViewEdge viewEdge)
Adds an edge to map.Heatmap
addHeatmap(ViewHeatmap viewHeatmap)
Adds a heatmap to be displayed by the map provider.void
addIdleEventListener(MapProvider.IdleEvent.IdleEventListener listener)
Adds an idle event listener.void
addMouseMoveEventListener(MapProvider.MouseMoveEvent.MouseMoveEventListener listener)
Adds a mouse move event listener.MapNode
addNode(BusinessObjectViewNode viewNode)
Adds a node to map.MapOverlayView
addOverlayView(ViewOverlayView viewOverlayView)
Adds a view overlay view to be displayed by the ma provider.void
addRightClickEventListener(MapProvider.RightClickEvent.RightClickEventListener listener)
Adds a right click event listener.void
addZoomChangedEventListener(MapProvider.ZoomChangedEvent.ZoomChangedEventListener listener)
Adds a zoom changed event listener.void
callbackContainsLocation(GeoCoordinate coordinate, List<List<GeoCoordinate>> paths, Consumer<Boolean> callback)
Executes callback to calculate whether the given coordinate exist inside the specified path.void
callbackContainsLocations(HashMap<String,GeoCoordinate> coordinates, List<List<GeoCoordinate>> paths, Consumer<HashMap<String,Boolean>> callback)
Executes callback to calculate whether the given coordinates exist inside the specified path.void
createComponent(ApplicationEntityManager aem, MetadataEntityManager mem, ResourceFactory resourceFactory, TranslationService ts)
Create a component that represents a map.GeoCoordinate
getCenter()
Gets the map centercom.vaadin.flow.component.Component
getComponent()
Gets a component that represents a map.boolean
getComputeEdgesLength()
Gets if compute edges length.MapSelectionManager.EdgeSelectionManager
getEdgeSelectionManager()
Gets the map edge selection manager.String
getMapTypeId()
Gets the map type id.List<String>
getMapTypeIds()
Gets the map type ids.double
getMinZoomForLabels()
Gets the minimum zoom level for the map when displaying labels.MapSelectionManager.NodeSelectionManager
getNodeSelectionManager()
Gets the map node selection manager.UnitOfLength
getUnitOfLength()
Gets the unit of length of map.double
getZoom()
Gets the map zoomvoid
removeAllIdleEventListener()
Removes all idle event listener.void
removeAllMouseMoveEventListener()
Removes all mouse move event listener.void
removeAllRightClickEventListener()
Removes all right click event listener.void
removeAllsZoomChangedEventListener()
Removes all zoom changed event listener.void
removeEdge(BusinessObjectViewEdge viewEdge)
Removes an edge to map.void
removeHeatmap(ViewHeatmap viewHeatmap)
Removes a heatmap displayed by the map provider.void
removeIdleEventListener(MapProvider.IdleEvent.IdleEventListener listener)
Removes an idle event listener.void
removeMouseMoveEventListener(MapProvider.MouseMoveEvent.MouseMoveEventListener listener)
Removes a mouse move event listener.void
removeNode(BusinessObjectViewNode viewNode)
Removes a node to map.void
removeOverlayView(ViewOverlayView viewOverlayView)
Removes a view overlay view displayed by the map provider.void
removeRightClickEventListener(MapProvider.RightClickEvent.RightClickEventListener listener)
Removes a right click event listener.void
removeZoomChangedEventListener(MapProvider.ZoomChangedEvent.ZoomChangedEventListener listener)
Removes a zoom changed event listener.void
setCenter(GeoCoordinate center)
Set map centervoid
setComputeEdgesLength(boolean computeEdgesLength)
Sets if compute edges length.void
setDrawingEdgeMode(BiConsumer<HashMap<String,Object>,Runnable> callbackEdgeComplete)
Sets the drawing mode to edge.void
setDrawingMarkerMode(Consumer<GeoCoordinate> drawingMarkerComplete)
Sets the drawing mode to marker.void
setHandMode()
Set the map hand mode.void
setMapTypeId(String mapTypeId)
Sets the map type id.void
setMinZoomForLabels(double minZoomForLabels)
Sets the minimum zoom level for the map when displaying labels.void
setPathSelectionMode(BiConsumer<List<BusinessObjectViewEdge>,Runnable> callbackPathSelectionComplete)
Sets the path selection mode.void
setUnitOfLength(UnitOfLength unitOfLength)
Sets the unit of length of map.void
setZoom(double zoom)
Set the map zoom
-
-
-
Method Detail
-
createComponent
void createComponent(ApplicationEntityManager aem, MetadataEntityManager mem, ResourceFactory resourceFactory, TranslationService ts)
Create a component that represents a map.- Parameters:
ts
- The Translation ServiceresourceFactory
- The resource factory. Used to get node iconsaem
- The Application Entity Managermem
- The Metadata Entity Manager
-
getComponent
com.vaadin.flow.component.Component getComponent()
Gets a component that represents a map.- Returns:
- The map provider component.
-
getCenter
GeoCoordinate getCenter()
Gets the map center- Returns:
- map center
-
setCenter
void setCenter(GeoCoordinate center)
Set map center- Parameters:
center
- map center
-
getZoom
double getZoom()
Gets the map zoom- Returns:
- map zoom
-
setZoom
void setZoom(double zoom)
Set the map zoom- Parameters:
zoom
- map zoom
-
getMinZoomForLabels
double getMinZoomForLabels()
Gets the minimum zoom level for the map when displaying labels.- Returns:
- The minimum zoom level for the map when displaying labels.
-
setMinZoomForLabels
void setMinZoomForLabels(double minZoomForLabels)
Sets the minimum zoom level for the map when displaying labels.- Parameters:
minZoomForLabels
- The minimum zoom level for the map when displaying labels.
-
getMapTypeId
String getMapTypeId()
Gets the map type id.- Returns:
- The map type id.
-
setMapTypeId
void setMapTypeId(String mapTypeId)
Sets the map type id.- Parameters:
mapTypeId
- The map type id.
-
setHandMode
void setHandMode()
Set the map hand mode.
-
setDrawingMarkerMode
void setDrawingMarkerMode(Consumer<GeoCoordinate> drawingMarkerComplete)
Sets the drawing mode to marker.- Parameters:
drawingMarkerComplete
- Operation that accepts a coordinate
-
setDrawingEdgeMode
void setDrawingEdgeMode(BiConsumer<HashMap<String,Object>,Runnable> callbackEdgeComplete)
Sets the drawing mode to edge.- Parameters:
callbackEdgeComplete
- Callback to execute when drawing edge complete.
-
setPathSelectionMode
void setPathSelectionMode(BiConsumer<List<BusinessObjectViewEdge>,Runnable> callbackPathSelectionComplete)
Sets the path selection mode.- Parameters:
callbackPathSelectionComplete
- Callback to execute when path selection complete.
-
getComputeEdgesLength
boolean getComputeEdgesLength()
Gets if compute edges length.- Returns:
- If compute edges length.
-
setComputeEdgesLength
void setComputeEdgesLength(boolean computeEdgesLength)
Sets if compute edges length.- Parameters:
computeEdgesLength
- True to compute edges length.
-
getUnitOfLength
UnitOfLength getUnitOfLength()
Gets the unit of length of map.- Returns:
- The unit of length of map.
-
setUnitOfLength
void setUnitOfLength(UnitOfLength unitOfLength)
Sets the unit of length of map.- Parameters:
unitOfLength
- Unit of length of map.
-
getNodeSelectionManager
MapSelectionManager.NodeSelectionManager getNodeSelectionManager()
Gets the map node selection manager.- Returns:
- The nodes selection manager.
-
getEdgeSelectionManager
MapSelectionManager.EdgeSelectionManager getEdgeSelectionManager()
Gets the map edge selection manager.- Returns:
- The edges selection manager.
-
addIdleEventListener
void addIdleEventListener(MapProvider.IdleEvent.IdleEventListener listener)
Adds an idle event listener.- Parameters:
listener
- Callback executed when idle.
-
removeIdleEventListener
void removeIdleEventListener(MapProvider.IdleEvent.IdleEventListener listener)
Removes an idle event listener.- Parameters:
listener
- Callback executed when idle.
-
removeAllIdleEventListener
void removeAllIdleEventListener()
Removes all idle event listener.
-
addZoomChangedEventListener
void addZoomChangedEventListener(MapProvider.ZoomChangedEvent.ZoomChangedEventListener listener)
Adds a zoom changed event listener.- Parameters:
listener
-
-
removeZoomChangedEventListener
void removeZoomChangedEventListener(MapProvider.ZoomChangedEvent.ZoomChangedEventListener listener)
Removes a zoom changed event listener.- Parameters:
listener
-
-
removeAllsZoomChangedEventListener
void removeAllsZoomChangedEventListener()
Removes all zoom changed event listener.
-
addMouseMoveEventListener
void addMouseMoveEventListener(MapProvider.MouseMoveEvent.MouseMoveEventListener listener)
Adds a mouse move event listener.- Parameters:
listener
-
-
removeMouseMoveEventListener
void removeMouseMoveEventListener(MapProvider.MouseMoveEvent.MouseMoveEventListener listener)
Removes a mouse move event listener.- Parameters:
listener
-
-
removeAllMouseMoveEventListener
void removeAllMouseMoveEventListener()
Removes all mouse move event listener.
-
addRightClickEventListener
void addRightClickEventListener(MapProvider.RightClickEvent.RightClickEventListener listener)
Adds a right click event listener.- Parameters:
listener
-
-
removeRightClickEventListener
void removeRightClickEventListener(MapProvider.RightClickEvent.RightClickEventListener listener)
Removes a right click event listener.- Parameters:
listener
-
-
removeAllRightClickEventListener
void removeAllRightClickEventListener()
Removes all right click event listener.
-
callbackContainsLocation
void callbackContainsLocation(GeoCoordinate coordinate, List<List<GeoCoordinate>> paths, Consumer<Boolean> callback)
Executes callback to calculate whether the given coordinate exist inside the specified path.- Parameters:
coordinate
- Coordinate to calculate if exist inside the specified path.paths
- Polygon paths.callback
- Callback to execute.
-
callbackContainsLocations
void callbackContainsLocations(HashMap<String,GeoCoordinate> coordinates, List<List<GeoCoordinate>> paths, Consumer<HashMap<String,Boolean>> callback)
Executes callback to calculate whether the given coordinates exist inside the specified path.- Parameters:
coordinates
- Coordinates to calculate if exist inside the specified path.paths
- Polygon paths.callback
- Callback to execute.
-
addNode
MapNode addNode(BusinessObjectViewNode viewNode)
Adds a node to map.- Parameters:
viewNode
- Node to add to map.- Returns:
-
addEdge
MapEdge addEdge(BusinessObjectViewEdge viewEdge)
Adds an edge to map.- Parameters:
viewEdge
- Edge to add to map.- Returns:
-
removeNode
void removeNode(BusinessObjectViewNode viewNode)
Removes a node to map.- Parameters:
viewNode
- Node to remove from map.
-
removeEdge
void removeEdge(BusinessObjectViewEdge viewEdge)
Removes an edge to map.- Parameters:
viewEdge
- Edge to remove from map.
-
addHeatmap
Heatmap addHeatmap(ViewHeatmap viewHeatmap)
Adds a heatmap to be displayed by the map provider.- Parameters:
viewHeatmap
- The heatmap to be displayed by the map provider.- Returns:
- The heatmap displayed by the map provider.
-
removeHeatmap
void removeHeatmap(ViewHeatmap viewHeatmap)
Removes a heatmap displayed by the map provider.- Parameters:
viewHeatmap
- The heatmap displayed by the map provider.
-
addOverlayView
MapOverlayView addOverlayView(ViewOverlayView viewOverlayView)
Adds a view overlay view to be displayed by the ma provider.- Parameters:
viewOverlayView
- The view overlay view to be displayed by the map provider.- Returns:
- The overlay view displayed by the map provider.
-
removeOverlayView
void removeOverlayView(ViewOverlayView viewOverlayView)
Removes a view overlay view displayed by the map provider.- Parameters:
viewOverlayView
- The view overlay view displayed by the map provider.
-
-