Class GoogleMapsMapProvider
- java.lang.Object
-
- com.neotropic.kuwaiba.modules.commercial.ospman.providers.google.GoogleMapsMapProvider
-
- All Implemented Interfaces:
MapProvider
public class GoogleMapsMapProvider extends Object implements MapProvider
Map implementation to Google Maps- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.neotropic.kuwaiba.modules.commercial.ospman.api.MapProvider
MapProvider.IdleEvent, MapProvider.MouseMoveEvent, MapProvider.RightClickEvent, MapProvider.ZoomChangedEvent
-
-
Field Summary
Fields Modifier and Type Field Description static String
LABEL_CLASS_NAME_FOR_MARKERS
static String
LABEL_CLASS_NAME_FOR_POLYLINES
static String
LABEL_CLASS_NAME_FOR_SELECTED_MARKERS
static String
LABEL_CLASS_NAME_FOR_SELECTED_POLYLINES
static String
LIBRARIES
static String
PROPERTY_API_KEY
static String
PROPERTY_CENTER
static String
PROPERTY_COLOR_FOR_LABELS
static String
PROPERTY_FILL_COLOR_FOR_MARKER_LABELS
static String
PROPERTY_FILL_COLOR_FOR_POLYLINE_LABELS
static String
PROPERTY_FILL_COLOR_FOR_SELECTED_MARKER_LABELS
static String
PROPERTY_FILL_COLOR_FOR_SELECTED_POLYLINE_LABELS
static String
PROPERTY_FONT_SIZE_FOR_LABELS
static String
PROPERTY_ZOOM
-
Constructor Summary
Constructors Constructor Description GoogleMapsMapProvider()
-
Method Summary
All Methods Instance Methods Concrete 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
-
-
-
Field Detail
-
LIBRARIES
public static final String LIBRARIES
- See Also:
- Constant Field Values
-
PROPERTY_API_KEY
public static final String PROPERTY_API_KEY
- See Also:
- Constant Field Values
-
PROPERTY_CENTER
public static final String PROPERTY_CENTER
- See Also:
- Constant Field Values
-
PROPERTY_ZOOM
public static final String PROPERTY_ZOOM
- See Also:
- Constant Field Values
-
PROPERTY_COLOR_FOR_LABELS
public static final String PROPERTY_COLOR_FOR_LABELS
- See Also:
- Constant Field Values
-
PROPERTY_FONT_SIZE_FOR_LABELS
public static final String PROPERTY_FONT_SIZE_FOR_LABELS
- See Also:
- Constant Field Values
-
PROPERTY_FILL_COLOR_FOR_MARKER_LABELS
public static final String PROPERTY_FILL_COLOR_FOR_MARKER_LABELS
- See Also:
- Constant Field Values
-
PROPERTY_FILL_COLOR_FOR_POLYLINE_LABELS
public static final String PROPERTY_FILL_COLOR_FOR_POLYLINE_LABELS
- See Also:
- Constant Field Values
-
PROPERTY_FILL_COLOR_FOR_SELECTED_MARKER_LABELS
public static final String PROPERTY_FILL_COLOR_FOR_SELECTED_MARKER_LABELS
- See Also:
- Constant Field Values
-
PROPERTY_FILL_COLOR_FOR_SELECTED_POLYLINE_LABELS
public static final String PROPERTY_FILL_COLOR_FOR_SELECTED_POLYLINE_LABELS
- See Also:
- Constant Field Values
-
LABEL_CLASS_NAME_FOR_MARKERS
public static final String LABEL_CLASS_NAME_FOR_MARKERS
- See Also:
- Constant Field Values
-
LABEL_CLASS_NAME_FOR_POLYLINES
public static final String LABEL_CLASS_NAME_FOR_POLYLINES
- See Also:
- Constant Field Values
-
LABEL_CLASS_NAME_FOR_SELECTED_MARKERS
public static final String LABEL_CLASS_NAME_FOR_SELECTED_MARKERS
- See Also:
- Constant Field Values
-
LABEL_CLASS_NAME_FOR_SELECTED_POLYLINES
public static final String LABEL_CLASS_NAME_FOR_SELECTED_POLYLINES
- See Also:
- Constant Field Values
-
-
Method Detail
-
createComponent
public void createComponent(ApplicationEntityManager aem, MetadataEntityManager mem, ResourceFactory resourceFactory, TranslationService ts)
Description copied from interface:MapProvider
Create a component that represents a map.- Specified by:
createComponent
in interfaceMapProvider
- Parameters:
aem
- The Application Entity Managermem
- The Metadata Entity ManagerresourceFactory
- The resource factory. Used to get node iconsts
- The Translation Service
-
getComponent
public com.vaadin.flow.component.Component getComponent()
Description copied from interface:MapProvider
Gets a component that represents a map.- Specified by:
getComponent
in interfaceMapProvider
- Returns:
- The map provider component.
-
getCenter
public GeoCoordinate getCenter()
Description copied from interface:MapProvider
Gets the map center- Specified by:
getCenter
in interfaceMapProvider
- Returns:
- map center
-
setCenter
public void setCenter(GeoCoordinate center)
Description copied from interface:MapProvider
Set map center- Specified by:
setCenter
in interfaceMapProvider
- Parameters:
center
- map center
-
getZoom
public double getZoom()
Description copied from interface:MapProvider
Gets the map zoom- Specified by:
getZoom
in interfaceMapProvider
- Returns:
- map zoom
-
setZoom
public void setZoom(double zoom)
Description copied from interface:MapProvider
Set the map zoom- Specified by:
setZoom
in interfaceMapProvider
- Parameters:
zoom
- map zoom
-
getMinZoomForLabels
public double getMinZoomForLabels()
Description copied from interface:MapProvider
Gets the minimum zoom level for the map when displaying labels.- Specified by:
getMinZoomForLabels
in interfaceMapProvider
- Returns:
- The minimum zoom level for the map when displaying labels.
-
setMinZoomForLabels
public void setMinZoomForLabels(double minZoomForLabels)
Description copied from interface:MapProvider
Sets the minimum zoom level for the map when displaying labels.- Specified by:
setMinZoomForLabels
in interfaceMapProvider
- Parameters:
minZoomForLabels
- The minimum zoom level for the map when displaying labels.
-
getMapTypeId
public String getMapTypeId()
Description copied from interface:MapProvider
Gets the map type id.- Specified by:
getMapTypeId
in interfaceMapProvider
- Returns:
- The map type id.
-
setMapTypeId
public void setMapTypeId(String mapTypeId)
Description copied from interface:MapProvider
Sets the map type id.- Specified by:
setMapTypeId
in interfaceMapProvider
- Parameters:
mapTypeId
- The map type id.
-
getMapTypeIds
public List<String> getMapTypeIds()
Description copied from interface:MapProvider
Gets the map type ids.- Specified by:
getMapTypeIds
in interfaceMapProvider
- Returns:
- The map type ids.
-
setHandMode
public void setHandMode()
Description copied from interface:MapProvider
Set the map hand mode.- Specified by:
setHandMode
in interfaceMapProvider
-
setDrawingMarkerMode
public void setDrawingMarkerMode(Consumer<GeoCoordinate> drawingMarkerComplete)
Description copied from interface:MapProvider
Sets the drawing mode to marker.- Specified by:
setDrawingMarkerMode
in interfaceMapProvider
- Parameters:
drawingMarkerComplete
- Operation that accepts a coordinate
-
setDrawingEdgeMode
public void setDrawingEdgeMode(BiConsumer<HashMap<String,Object>,Runnable> callbackEdgeComplete)
Description copied from interface:MapProvider
Sets the drawing mode to edge.- Specified by:
setDrawingEdgeMode
in interfaceMapProvider
- Parameters:
callbackEdgeComplete
- Callback to execute when drawing edge complete.
-
setPathSelectionMode
public void setPathSelectionMode(BiConsumer<List<BusinessObjectViewEdge>,Runnable> callbackPathSelectionComplete)
Description copied from interface:MapProvider
Sets the path selection mode.- Specified by:
setPathSelectionMode
in interfaceMapProvider
- Parameters:
callbackPathSelectionComplete
- Callback to execute when path selection complete.
-
getComputeEdgesLength
public boolean getComputeEdgesLength()
Description copied from interface:MapProvider
Gets if compute edges length.- Specified by:
getComputeEdgesLength
in interfaceMapProvider
- Returns:
- If compute edges length.
-
setComputeEdgesLength
public void setComputeEdgesLength(boolean computeEdgesLength)
Description copied from interface:MapProvider
Sets if compute edges length.- Specified by:
setComputeEdgesLength
in interfaceMapProvider
- Parameters:
computeEdgesLength
- True to compute edges length.
-
getUnitOfLength
public UnitOfLength getUnitOfLength()
Description copied from interface:MapProvider
Gets the unit of length of map.- Specified by:
getUnitOfLength
in interfaceMapProvider
- Returns:
- The unit of length of map.
-
setUnitOfLength
public void setUnitOfLength(UnitOfLength unitOfLength)
Description copied from interface:MapProvider
Sets the unit of length of map.- Specified by:
setUnitOfLength
in interfaceMapProvider
- Parameters:
unitOfLength
- Unit of length of map.
-
getNodeSelectionManager
public MapSelectionManager.NodeSelectionManager getNodeSelectionManager()
Description copied from interface:MapProvider
Gets the map node selection manager.- Specified by:
getNodeSelectionManager
in interfaceMapProvider
- Returns:
- The nodes selection manager.
-
getEdgeSelectionManager
public MapSelectionManager.EdgeSelectionManager getEdgeSelectionManager()
Description copied from interface:MapProvider
Gets the map edge selection manager.- Specified by:
getEdgeSelectionManager
in interfaceMapProvider
- Returns:
- The edges selection manager.
-
addIdleEventListener
public void addIdleEventListener(MapProvider.IdleEvent.IdleEventListener listener)
Description copied from interface:MapProvider
Adds an idle event listener.- Specified by:
addIdleEventListener
in interfaceMapProvider
- Parameters:
listener
- Callback executed when idle.
-
removeIdleEventListener
public void removeIdleEventListener(MapProvider.IdleEvent.IdleEventListener listener)
Description copied from interface:MapProvider
Removes an idle event listener.- Specified by:
removeIdleEventListener
in interfaceMapProvider
- Parameters:
listener
- Callback executed when idle.
-
removeAllIdleEventListener
public void removeAllIdleEventListener()
Description copied from interface:MapProvider
Removes all idle event listener.- Specified by:
removeAllIdleEventListener
in interfaceMapProvider
-
addZoomChangedEventListener
public void addZoomChangedEventListener(MapProvider.ZoomChangedEvent.ZoomChangedEventListener listener)
Description copied from interface:MapProvider
Adds a zoom changed event listener.- Specified by:
addZoomChangedEventListener
in interfaceMapProvider
-
removeZoomChangedEventListener
public void removeZoomChangedEventListener(MapProvider.ZoomChangedEvent.ZoomChangedEventListener listener)
Description copied from interface:MapProvider
Removes a zoom changed event listener.- Specified by:
removeZoomChangedEventListener
in interfaceMapProvider
-
removeAllsZoomChangedEventListener
public void removeAllsZoomChangedEventListener()
Description copied from interface:MapProvider
Removes all zoom changed event listener.- Specified by:
removeAllsZoomChangedEventListener
in interfaceMapProvider
-
addMouseMoveEventListener
public void addMouseMoveEventListener(MapProvider.MouseMoveEvent.MouseMoveEventListener listener)
Description copied from interface:MapProvider
Adds a mouse move event listener.- Specified by:
addMouseMoveEventListener
in interfaceMapProvider
-
removeMouseMoveEventListener
public void removeMouseMoveEventListener(MapProvider.MouseMoveEvent.MouseMoveEventListener listener)
Description copied from interface:MapProvider
Removes a mouse move event listener.- Specified by:
removeMouseMoveEventListener
in interfaceMapProvider
-
removeAllMouseMoveEventListener
public void removeAllMouseMoveEventListener()
Description copied from interface:MapProvider
Removes all mouse move event listener.- Specified by:
removeAllMouseMoveEventListener
in interfaceMapProvider
-
addRightClickEventListener
public void addRightClickEventListener(MapProvider.RightClickEvent.RightClickEventListener listener)
Description copied from interface:MapProvider
Adds a right click event listener.- Specified by:
addRightClickEventListener
in interfaceMapProvider
-
removeRightClickEventListener
public void removeRightClickEventListener(MapProvider.RightClickEvent.RightClickEventListener listener)
Description copied from interface:MapProvider
Removes a right click event listener.- Specified by:
removeRightClickEventListener
in interfaceMapProvider
-
removeAllRightClickEventListener
public void removeAllRightClickEventListener()
Description copied from interface:MapProvider
Removes all right click event listener.- Specified by:
removeAllRightClickEventListener
in interfaceMapProvider
-
callbackContainsLocation
public void callbackContainsLocation(GeoCoordinate coordinate, List<List<GeoCoordinate>> paths, Consumer<Boolean> callback)
Description copied from interface:MapProvider
Executes callback to calculate whether the given coordinate exist inside the specified path.- Specified by:
callbackContainsLocation
in interfaceMapProvider
- Parameters:
coordinate
- Coordinate to calculate if exist inside the specified path.paths
- Polygon paths.callback
- Callback to execute.
-
callbackContainsLocations
public void callbackContainsLocations(HashMap<String,GeoCoordinate> coordinates, List<List<GeoCoordinate>> paths, Consumer<HashMap<String,Boolean>> callback)
Description copied from interface:MapProvider
Executes callback to calculate whether the given coordinates exist inside the specified path.- Specified by:
callbackContainsLocations
in interfaceMapProvider
- Parameters:
coordinates
- Coordinates to calculate if exist inside the specified path.paths
- Polygon paths.callback
- Callback to execute.
-
addNode
public MapNode addNode(BusinessObjectViewNode viewNode)
Description copied from interface:MapProvider
Adds a node to map.- Specified by:
addNode
in interfaceMapProvider
- Parameters:
viewNode
- Node to add to map.- Returns:
-
addEdge
public MapEdge addEdge(BusinessObjectViewEdge viewEdge)
Description copied from interface:MapProvider
Adds an edge to map.- Specified by:
addEdge
in interfaceMapProvider
- Parameters:
viewEdge
- Edge to add to map.- Returns:
-
removeNode
public void removeNode(BusinessObjectViewNode viewNode)
Description copied from interface:MapProvider
Removes a node to map.- Specified by:
removeNode
in interfaceMapProvider
- Parameters:
viewNode
- Node to remove from map.
-
removeEdge
public void removeEdge(BusinessObjectViewEdge viewEdge)
Description copied from interface:MapProvider
Removes an edge to map.- Specified by:
removeEdge
in interfaceMapProvider
- Parameters:
viewEdge
- Edge to remove from map.
-
addHeatmap
public Heatmap addHeatmap(ViewHeatmap viewHeatmap)
Description copied from interface:MapProvider
Adds a heatmap to be displayed by the map provider.- Specified by:
addHeatmap
in interfaceMapProvider
- Parameters:
viewHeatmap
- The heatmap to be displayed by the map provider.- Returns:
- The heatmap displayed by the map provider.
-
removeHeatmap
public void removeHeatmap(ViewHeatmap viewHeatmap)
Description copied from interface:MapProvider
Removes a heatmap displayed by the map provider.- Specified by:
removeHeatmap
in interfaceMapProvider
- Parameters:
viewHeatmap
- The heatmap displayed by the map provider.
-
addOverlayView
public MapOverlayView addOverlayView(ViewOverlayView viewOverlayView)
Description copied from interface:MapProvider
Adds a view overlay view to be displayed by the ma provider.- Specified by:
addOverlayView
in interfaceMapProvider
- Parameters:
viewOverlayView
- The view overlay view to be displayed by the map provider.- Returns:
- The overlay view displayed by the map provider.
-
removeOverlayView
public void removeOverlayView(ViewOverlayView viewOverlayView)
Description copied from interface:MapProvider
Removes a view overlay view displayed by the map provider.- Specified by:
removeOverlayView
in interfaceMapProvider
- Parameters:
viewOverlayView
- The view overlay view displayed by the map provider.
-
-