Class JBMap
- All Implemented Interfaces:
com.jbstrap.ui.Animatable<JBMap>
,com.jbstrap.ui.CanDrop<JBMap>
,com.jbstrap.ui.Draggable<JBMap>
,com.jbstrap.ui.HandleMouseEvents<JBMap>
Interactive map component created using the Leaflet JavaScript library.
The interactive map displays POIs with images, popups and HTML content. You can place shapes (circle, rectangle, line) or a freeform shape on the map. These shapes are called layers.
The map is based on the geographical system of longitudes and latitudes.
The tile layer (the map layer itself) is placed on this coordinate system.
You can use various map service providers to access this layer. To access the map service, you have to extend the BaseMapLayer
class.
By default, the OpenStreetMap map provider is used. OpenStreetMapLayer
You can add layers to the map using the LayerGroup
. That is, you can add layers to layer groups and add layer groups to the map.
You can use the geolocation feature to identify the user's location by using the getLocation(LocationFoundHandler)
method.
The JBMap offers a built-in geocoding service OSMGeoCoding
. Use it to search for an address or coordinate.
If you want to use a different service provider, you can do so by extending the GeoCodingBase
class.
Supported events of the map component:
MapClickHandler
AnimationStart
,
AnimationEnd
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
- Since:
- 4.0
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
Fields inherited from interface com.jbstrap.ui.Animatable
h
Fields inherited from interface com.jbstrap.ui.CanDrop
i
Fields inherited from interface com.jbstrap.ui.Draggable
j
-
Constructor Summary
ConstructorDescriptionJBMap()
Creates the map component.JBMap
(BaseMapLayer<?> baseMapLayer) Creates the map component by setting a default tile layer.Creates the map with a unique ID.JBMap
(String id, BaseMapLayer<?> baseMapLayer) Creates the map with a unique ID by setting a default tile layer.Creates the map with a unique ID by specifying a language.JBMap
(String id, String language, BaseMapLayer<?> baseMapLayer) Creates the map with a unique ID by specifying a language and setting a default tile layer. -
Method Summary
Modifier and TypeMethodDescriptionaddBaseMapLayer
(BaseMapLayer<?> baseMapLayer) Adds a unique tile layer to the map.addClickHandler
(MapClickEventHandler handler) Adds a map click event handler to the map.addDivLayer
(DivLayer divLayer) Adds a divLayer to the map.addLayerGroup
(LayerGroup layerGroup) Adds a new layer group to the map.addLayerGroups
(LayerGroup... layerGroups) Adds one or more layer groups to the map.addLayerGroups
(List<LayerGroup> layerGroups) Adds a list of layer groups to the map.protected JBMap
addLayerStyle
(LayerStyle layerStyle) Adds a LayerStyle to the JBMap.protected JBMap
addPointImage
(PointImage pointImage) Adds a PointImage to the JBMap.void
Automatically fetches LayerGroups from a DataDescriptor if the return value of theLayerGroup.isAutoFetchData()
method istrue
.flyTo
(Coordinates coordinates, Integer zoom) "Flying to a point" on the map.BaseMapLayer<?>
getBaseMapLayerByName
(String name) Gets a tile layer from the map by its name.Gets the specified center coordinate of the map.List<com.jbstrap.core.event.handlers.BrowserEventHandler>
Gets a list of map click event handlers.List<com.jbstrap.ui.Component<?>>
Gets a list of components added to all layers.Gets the set map height.getLayerGroupByName
(String layerGroupName) Gets a layer group by its unique name.Gets the specified layer groups in a list.getLocation
(LocationFoundHandler handler) Gets the user's location and sets the location found event handler.final LocationFoundHandler
int
Gets the maximum zoom value.int
Gets the minimum zoom value.protected com.jbstrap.core.Parameters
Gets the JBMap parameters.getTitle()
Gets the map title.Get the map title color.Gets the map title font size.Gets the map title font weight.protected com.jbstrap.core.Parameters
Gets the map title position.int
getZoom()
Gets the map's zoom setting.double
Gets the zoom delta's set value.Gets the map's "zoom in" button content.Gets the "zoom in" button's tooltip content.Gets the "zoom out" button content.Gets the "zoom out" button's tooltip content.double
Gets the zoom snap value.void
init()
boolean
Checks if the box zoom is enabled.boolean
Checks if the automatic closing of popups is enabled when the user clicks on the map.boolean
Checks if the double click zoom is enabled.boolean
Gets the dragging feature.boolean
Gets the map scale visibility setting.boolean
Checks if the mouse scrolling zoom is enabled.boolean
Checks if the border is displayed on the map container.boolean
Checks if the shadow is visible on the map container.boolean
Checks if the map title is displayed.boolean
Checks if the "tracking resize" feature of the map is enabled.boolean
Checks if the zoom animation is enabled.boolean
Gets the map zoom controls' visibility setting.void
onShow()
Removes all tile layers from the map.removeBaseMapLayer
(BaseMapLayer<?> baseMapLayer) Deletes a tile layer from the map.removeClickHandler
(MapClickEventHandler handler) Removes a map click event handler from the list of map click event handlers.removeLayerGroup
(LayerGroup layerGroup) Removes a layerGroup from the map.protected void
Executing JavaScript for all JBMap containers.protected void
Executing JavaScript for the JBMap.protected final void
runOnHideOnLayer
(com.jbstrap.ui.Component<?> layerComponent) setBoxZoom
(boolean boxZoom) Enables the box zoom feature.setCenterCoordinates
(Coordinates coordinates) Sets the map to a specified coordinate.setClosePopupOnClick
(boolean closePopupOnClick) Enables the automatic closing of popups when the user clicks on the map.setDivLayers
(DivLayer... divLayers) Sets the divLayers by passing an array of divLayers.setDivLayers
(List<DivLayer> divLayers) Sets the divLayer by passing a list of divLayers.setDoubleClickZoom
(boolean doubleClickZoom) Sets the double click zoom feature on the map.setDragging
(boolean dragging) Sets the dragging feature.Sets the map container height.setLayerGroups
(LayerGroup... layerGroups) Sets the layer group.setLayerGroups
(List<LayerGroup> layerGroups) Sets the map layer groupLayerGroup
.protected JBMap
setLayerStyles
(LayerStyle... layerStyles) Adds a LayerStyle array to the JBMap.protected JBMap
setLayerStyles
(List<LayerStyle> layerStyles) Adds a list of LayerStyles to the JBMap.setMaxZoom
(int maxZoom) Sets the maximum zoom value.setMinZoom
(int minZoom) Sets the minimum zoom value.protected JBMap
setPointImages
(PointImage... pointImages) Sets a PointImage array in JBMap.protected JBMap
setPointImages
(List<PointImage> pointImages) Sets a list of PointImages in the JBMap.setScaleShow
(boolean scaleShow) Sets the scale visibility in the lower left corner of the map.setScrollWheelZoom
(boolean scrollWheelZoom) Sets the mouse scrolling zoom feature.setShowBorder
(boolean showBorder) Sets if a border should be displayed on the map container.setShowShadow
(boolean showShadow) Sets if there should be a shadow on the map container.setShowTitle
(boolean showTitle) Sets if the map title should be displayed on the map.Sets the map title.setTitleFontColor
(String color) Sets the map title color.setTitleFontSize
(String fontSize) Sets the map title font size.setTitleFontWeight
(FontWeight fontWeight) Sets the map title font weight.setTitlePosition
(MapTitlePosition titlePosition) Sets the map title position.setTrackResize
(boolean trackResize) "Tracking resize" feature of the map.setZoom
(int zoom) The map's zoom setting.setZoomAnimation
(boolean zoomAnimation) Sets the zoom animation feature.setZoomControlVisible
(boolean zoomControlVisible) Sets the map zoom controls' visibility.setZoomDelta
(double zoomDelta) Controls how much the map's zoom level will change after pressing + or - on the keyboard, or using the zoom controls.setZoomInText
(String zoomInText) Sets the map's "zoom in" button content.setZoomInTitle
(String zoomInTitle) Sets the "zoom in" button's tooltip content.setZoomOutText
(String zoomOutText) Sets the "zoom out" button content.setZoomOutTitle
(String zoomOutTitle) Sets the "zoom out" button's tooltip content.setZoomSnap
(double zoomSnap) Forces the map's zoom level to always be a multiple of this, particularly right after a fitBounds() or a pinch-zoom.boolean
writeHTML
(StringWriter writer) Methods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, b, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, f, flattendComponentTree, g, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getName, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, openTag, redraw, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEnabled, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setMargin, setName, setOverflow, setPadding, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setVisible, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
b, c, closeMessageBus, d, e, messageBusOpened, openMessageBus, sendMessageToMessageBus, subscribeMessageBus, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
-
Field Details
-
POPUP_CONTENT
- See Also:
-
-
Constructor Details
-
JBMap
public JBMap()Creates the map component. -
JBMap
Creates the map component by setting a default tile layer. You can read more about how to create this layer in theBaseMapLayer
class.- Parameters:
baseMapLayer
- The tile layer instance; Ifnull
, the default layer isOpenStreetMapLayer
-
JBMap
Creates the map with a unique ID.- Parameters:
id
- Unique component ID The ID specified here will appear in the HTML tag as an ID attribute.
-
JBMap
Creates the map with a unique ID by setting a default tile layer. You can read more about how to create this layer in theBaseMapLayer
class.- Parameters:
id
- Unique component ID The ID specified here will appear in the HTML tag as an ID attribute.baseMapLayer
- The tile layer instance; Ifnull
, the default layer isOpenStreetMapLayer
-
JBMap
Creates the map with a unique ID by specifying a language.- Parameters:
id
- Unique component ID The ID specified here will appear in the HTML tag as an ID attribute.language
- The client language code. If specified as null, the component will use the default language.The default language is set in the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE_CODE
.- Throws:
IllegalStateException
- - If the component is set to be both Private and Public.
-
JBMap
Creates the map with a unique ID by specifying a language and setting a default tile layer. You can read more about how to create this layer in theBaseMapLayer
class.- Parameters:
id
- Unique component ID The ID specified here will appear in the HTML tag as an ID attribute.language
- The client language code. If specified as null, the component will use the default language.The default language is set in the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE_CODE
.baseMapLayer
- The tile layer instance; Ifnull
, the default layer isOpenStreetMapLayer
- Throws:
IllegalStateException
- - If the component is set to be both Private and Public.
-
-
Method Details
-
addBaseMapLayer
Adds a unique tile layer to the map. You can read more about how to create this layer in theBaseMapLayer
class.- Parameters:
baseMapLayer
- Tile layer instance- Returns:
- JBMap instance
-
getBaseMapLayerByName
Gets a tile layer from the map by its name.- Parameters:
name
- Tile layer unique name- Returns:
- Tile layer instance If no tile layer was found based on the
name
parameter,null
is returned.
-
removeBaseMapLayer
Deletes a tile layer from the map.- Parameters:
baseMapLayer
- Tile layer instance- Returns:
- JBMap instance
-
removeAllBaseMapLayer
Removes all tile layers from the map.- Returns:
- JBMap instance
-
init
public void init() throws com.jbstrap.core.websocket.JavaScriptLoadError- Overrides:
init
in classcom.jbstrap.ui.Component<JBMap>
- Throws:
com.jbstrap.core.websocket.JavaScriptLoadError
-
runOnHideOnLayer
protected final void runOnHideOnLayer(com.jbstrap.ui.Component<?> layerComponent) - Parameters:
layerComponent
- Layer component
-
writeHTML
- Specified by:
writeHTML
in classcom.jbstrap.ui.Component<JBMap>
-
setHeight
Sets the map container height. By default, the map height is automatically calculated.- Parameters:
height
- Map height in pixels If the specified height is 0 or smaller than 0, the map height is automatically calculated.- Returns:
- JBMap component instance
-
getHeight
Gets the set map height.- Returns:
- Map height in pixels or
null
, if the map height is not specified
-
setShowBorder
Sets if a border should be displayed on the map container. The default setting is that the border is not displayed.- Parameters:
showBorder
- Iftrue
is specified, the border is displayed on the map container Otherwise the border is not displayed.- Returns:
- JBMap component instance
-
isShowBorder
public boolean isShowBorder()Checks if the border is displayed on the map container.- Returns:
- If
true
, the border is displayed on the map container Otherwise the border is not displayed.
-
setShowShadow
Sets if there should be a shadow on the map container. The default setting is that no shadow is displayed on the map container.- Parameters:
showShadow
- Iftrue
is specified, a shadow is displayed on the map container Iffalse
, no shadow is displayed.- Returns:
- JBMap component instance
-
isShowShadow
public boolean isShowShadow()Checks if the shadow is visible on the map container.- Returns:
- If
true
, the shadow is displayed on the map container Otherwise the shadow is not visible.
-
getTitleParams
protected com.jbstrap.core.Parameters getTitleParams()- Returns:
- Parameter class containing map title settings
-
setTitle
Sets the map title.- Parameters:
title
- Map title Ifnull
or an empty string is specified, the map title is not displayed.- Returns:
- JBMap component instance
-
getTitle
Gets the map title.- Returns:
- Map title or
null
, if no map title is specified
-
setTitleFontColor
Sets the map title color.- Parameters:
color
- Map title color. If no color is specified ornull
, the map title is displayed using the grey theme color. Use the parameter to specify any color in the CSS3 format.- Returns:
- JBMap component instance
-
getTitleFontColor
Get the map title color.- Returns:
- Map title color or
null
, if no color is specified
-
setTitlePosition
Sets the map title position. The map title, if specified correctly, is displayed aligned to the center above the map.- Parameters:
titlePosition
- Map title position Ifnull
is specified, the map title is displayed aligned to the center above the map. Available positions are listed inMapTitlePosition
.- Returns:
- JBMap component instance
-
getTitlePosition
Gets the map title position.- Returns:
- Map title position
-
setTitleFontSize
Sets the map title font size. The default map title font size is 14 pixels.- Parameters:
fontSize
- Map title font size in the CSS3 format- Returns:
- JBMap component instance
-
getTitleFontSize
Gets the map title font size.- Returns:
- Map title font size in the CSS3 format
-
setTitleFontWeight
Sets the map title font weight. By default, the map title is displayed with a bold font.- Parameters:
fontWeight
- Map title font weight Available font weights are listed in the enumFontWeight
.- Returns:
- JBMap component instance
-
getTitleFontWeight
Gets the map title font weight.- Returns:
- Map title font weight
-
setShowTitle
Sets if the map title should be displayed on the map. By default, if the specified title is notnull
or an empty string, it is displayed on the map.- Parameters:
showTitle
- Iftrue
is specified, the title is displayed on the map, otherwise not- Returns:
- JBMap component instance
-
isShowTitle
public boolean isShowTitle()Checks if the map title is displayed.- Returns:
- If
true
, the map title is displayed on the map container, otherwisefalse
-
setCenterCoordinates
Sets the map to a specified coordinate. The coordinate value is set to be in the center of the map.- Parameters:
coordinates
- Map center coordinates- Returns:
- The JBMap component instance
-
getCenterCoordinates
Gets the specified center coordinate of the map.- Returns:
- The specified center coordinate of the map
-
setZoom
The map's zoom setting.- Parameters:
zoom
- Map zoom setting- Returns:
- The JBMap component instance
-
getZoom
public int getZoom()Gets the map's zoom setting.- Returns:
- Map zoom setting
-
flyTo
"Flying to a point" on the map. The map "flies to" the set coordinates and zooms in using animation.- Parameters:
coordinates
- Map center coordinateszoom
- New map zoom setting- Returns:
- The JBMap component instance
-
getLocation
Gets the user's location and sets the location found event handler. This handler is executed if the user's location is found.- Parameters:
handler
-LocationFoundHandler
implementation- Returns:
- JBMap instance
-
getLocationFoundHandler
- Parameters:
id
- LocationFoundHandler unique ID- Returns:
- LocationFoundHandler
-
addClickHandler
Adds a map click event handler to the map. This handler is executed if the user clicks once on the map.- Parameters:
handler
- AMapClickEventHandler
implementation- Returns:
- JBMap instance
-
removeClickHandler
Removes a map click event handler from the list of map click event handlers. The removed event handler does not apply to the event.- Parameters:
handler
- TheMapClickEventHandler
to be removed- Returns:
- JBMap component instance
-
getClickHandlers
Gets a list of map click event handlers.- Returns:
- A list of map click event handlers assigned to the map
-
setScaleShow
Sets the scale visibility in the lower left corner of the map.- Parameters:
scaleShow
- Map visibility; Iftrue
, the map is visible, otherwise not.- Returns:
- JBMap instance
-
isScaleShow
public boolean isScaleShow()Gets the map scale visibility setting.- Returns:
- Map scale visibility
-
setZoomControlVisible
Sets the map zoom controls' visibility.- Parameters:
zoomControlVisible
- Map zoom controls' visibility- Returns:
- JBMap instance
-
isZoomControlVisible
public boolean isZoomControlVisible()Gets the map zoom controls' visibility setting.- Returns:
- Map zoom controls' visibility setting; If
true
, it is visible, otherwise not.
-
setZoomInText
Sets the map's "zoom in" button content. The default setting is"+"
.- Parameters:
zoomInText
- The "zoom in" button's content- Returns:
- JBMap instance
-
getZoomInText
Gets the map's "zoom in" button content.- Returns:
- The "zoom in" button content The default setting is
"+"
.
-
setZoomInTitle
Sets the "zoom in" button's tooltip content. The default setting is"Zoom in"
.- Parameters:
zoomInTitle
- The "zoom in" button's tooltip content- Returns:
- JBMap instance
-
getZoomInTitle
Gets the "zoom in" button's tooltip content.- Returns:
- The "zoom in" button's tooltip content The default setting is
"Zoom in"
.
-
setZoomOutText
Sets the "zoom out" button content. The default setting is"-"
.- Parameters:
zoomOutText
- The "zoom out" button content- Returns:
- JBMap instance
-
getZoomOutText
Gets the "zoom out" button content.- Returns:
- The "zoom out" button content The default setting is
"-"
.
-
setZoomOutTitle
Sets the "zoom out" button's tooltip content. The default setting is"Zoom out"
.- Parameters:
zoomOutTitle
- The "zoom out" button's tooltip content- Returns:
- JBMap instance
-
getZoomOutTitle
Gets the "zoom out" button's tooltip content.- Returns:
- The "zoom out" button's tooltip content The default setting is
"Zoom out"
.
-
setMinZoom
Sets the minimum zoom value.- Parameters:
minZoom
- Minimum zoom value The default setting is 0.- Returns:
- JBMap instance
-
getMinZoom
public int getMinZoom()Gets the minimum zoom value.- Returns:
- The minimum zoom value The default setting is 0.
-
setMaxZoom
Sets the maximum zoom value.- Parameters:
maxZoom
- The maximum zoom value The default setting is 18.- Returns:
- JBMap instance
-
getMaxZoom
public int getMaxZoom()Gets the maximum zoom value.- Returns:
- The maximum zoom value The default setting is 18.
-
setDoubleClickZoom
Sets the double click zoom feature on the map.- Parameters:
doubleClickZoom
- Double click zoom feature The default setting istrue
. If you double click on the map, a zoom event happens.- Returns:
- JBMap instance
-
isDoubleClickZoom
public boolean isDoubleClickZoom()Checks if the double click zoom is enabled.- Returns:
- If
true
, the double click zoom is enabled, otherwise not The default setting istrue
.
-
setDragging
Sets the dragging feature. This feature enables you to drag the map by pressing the mouse button. The default setting istrue
.- Parameters:
dragging
- Map dragging- Returns:
- JBMap instance
-
isDragging
public boolean isDragging()Gets the dragging feature.- Returns:
- Map dragging The default setting is
true
.
-
setScrollWheelZoom
Sets the mouse scrolling zoom feature. The default setting istrue
.- Parameters:
scrollWheelZoom
- Enables or disable the mouse scrolling zoom feature- Returns:
- JBMap instance
-
isScrollWheelZoom
public boolean isScrollWheelZoom()Checks if the mouse scrolling zoom is enabled.- Returns:
true
if the mouse scrolling zoom is enabled, otherwise not The default setting istrue
.
-
setZoomAnimation
Sets the zoom animation feature. The default setting istrue
.- Parameters:
zoomAnimation
- Enables or disable the zoom animation feature- Returns:
- JBMap instance
-
isZoomAnimation
public boolean isZoomAnimation()Checks if the zoom animation is enabled.- Returns:
true
if the zoom animation is enabled; Otherwise not enabled. The default setting istrue
.
-
setBoxZoom
Enables the box zoom feature.
If the box zoom feature is enabled, a rectangular selection can be created by pressing the Shift key and pressing the mouse button.
By releasing the mouse button, the map zooms in on the selected area.
- Parameters:
boxZoom
- Box zoom enabled setting The default setting istrue
.- Returns:
- JBMap instance
-
isBoxZoom
public boolean isBoxZoom()Checks if the box zoom is enabled.- Returns:
- The box zoom is enabled. If
true
, it is enabled, otherwise not
-
setClosePopupOnClick
Enables the automatic closing of popups when the user clicks on the map. The default setting istrue
.- Parameters:
closePopupOnClick
- Enables the automatic closing of popups when the user clicks on the map- Returns:
- JBMap instance
-
isClosePopupOnClick
public boolean isClosePopupOnClick()Checks if the automatic closing of popups is enabled when the user clicks on the map.- Returns:
- If
true
, popups automatically close on the map if the user clicks; otherwise not The default setting istrue
.
-
setTrackResize
"Tracking resize" feature of the map. The map fits to the available space in the window and its center is always the container's center.- Parameters:
trackResize
- Tracking resize setting The default setting istrue
.- Returns:
- JBMap instance
-
isTrackResize
public boolean isTrackResize()Checks if the "tracking resize" feature of the map is enabled.- Returns:
- If
true
, the tracking resize feature is enabled, otherwise not The default setting istrue
.
-
setZoomDelta
Controls how much the map's zoom level will change after pressing + or - on the keyboard, or using the zoom controls. Values smaller than 1 (e.g. 0.5) allow for greater granularity.- Parameters:
zoomDelta
- Zoom delta setting The default setting is 1.- Returns:
- JBMap instance
-
getZoomDelta
public double getZoomDelta()Gets the zoom delta's set value.- Returns:
- Zoom delta value
-
setZoomSnap
Forces the map's zoom level to always be a multiple of this, particularly right after a fitBounds() or a pinch-zoom. By default, the zoom level snaps to the nearest integer; lower values (e.g. 0.5 or 0.1) allow for greater granularity. A value of 0 means the zoom level will not be snapped after fitBounds or a pinch-zoom.- Parameters:
zoomSnap
- Zoom snap value The default setting is 1.- Returns:
- JBMap instance
-
getZoomSnap
public double getZoomSnap()Gets the zoom snap value.- Returns:
- Zoom snap value
-
setLayerGroups
Sets the map layer groupLayerGroup
.- Parameters:
layerGroups
- The new layer group list- Returns:
- JBMap instance
-
setLayerGroups
Sets the layer group.LayerGroup
- Parameters:
layerGroups
- The new layer group array- Returns:
- JBMap instance
-
addLayerGroup
Adds a new layer group to the map.LayerGroup
- Parameters:
layerGroup
- The new layer group- Returns:
- JBMap instance
- Throws:
IllegalArgumentException
- Thrown if the name of a layer group is the same as the layer group to be added
-
addLayerGroups
Adds one or more layer groups to the map.LayerGroup
- Parameters:
layerGroups
- The new layer group array- Returns:
- JBMap instance
- Throws:
IllegalArgumentException
- Thrown if the name of a layer group is the same as the layer group to be added
-
addLayerGroups
Adds a list of layer groups to the map.LayerGroup
- Parameters:
layerGroups
- A list of layer groups- Returns:
- JBMap instance
- Throws:
IllegalArgumentException
- Thrown if the unique name of a layer group is the same as the layer group to be added
-
getLayerGroups
Gets the specified layer groups in a list.LayerGroup
- Returns:
- A list of the specified layer groups
-
getLayerGroupByName
Gets a layer group by its unique name.LayerGroup
- Parameters:
layerGroupName
- The new layer group's unique name- Returns:
- Layer group
-
removeLayerGroup
Removes a layerGroup from the map.- Parameters:
layerGroup
- layerGroup instance- Returns:
- The created JBMap instance
-
addDivLayer
Adds a divLayer to the map.DivLayer
- Parameters:
divLayer
- The divLayer instance- Returns:
- JBMap instance
-
setDivLayers
Sets the divLayer by passing a list of divLayers.DivLayer
- Parameters:
divLayers
- A list of divLayers- Returns:
- JBMap instance
-
setDivLayers
Sets the divLayers by passing an array of divLayers.DivLayer
- Parameters:
divLayers
- divLayers array- Returns:
- JBMap instance
-
addLayerStyle
Adds a LayerStyle to the JBMap.- Parameters:
layerStyle
- The LayerStyle instance- Returns:
- JBMap instance
-
setLayerStyles
Adds a list of LayerStyles to the JBMap.- Parameters:
layerStyles
- A list of LayerStyle instances- Returns:
- JBMap instance
-
setLayerStyles
Adds a LayerStyle array to the JBMap.- Parameters:
layerStyles
- An array of LayerStyles- Returns:
- JBMap instance
-
addPointImage
Adds a PointImage to the JBMap.- Parameters:
pointImage
- The PointImage instance- Returns:
- JBMap instance
-
setPointImages
Sets a list of PointImages in the JBMap.- Parameters:
pointImages
- A list of PointImage instances- Returns:
- JBMap instance
-
setPointImages
Sets a PointImage array in JBMap.- Parameters:
pointImages
- An array of PointImage instances- Returns:
- JBMap instance
-
getParams
protected com.jbstrap.core.Parameters getParams()Gets the JBMap parameters.- Returns:
- The JBMap parameters
-
getComponents
Gets a list of components added to all layers.- Overrides:
getComponents
in classcom.jbstrap.ui.Component<JBMap>
-
runJS
Executing JavaScript for all JBMap containers.- Parameters:
script
-
-
runJSMap
Executing JavaScript for the JBMap.- Parameters:
script
-
-
afterDraw
public void afterDraw()Automatically fetches LayerGroups from a DataDescriptor if the return value of theLayerGroup.isAutoFetchData()
method istrue
.- Overrides:
afterDraw
in classcom.jbstrap.ui.Component<JBMap>
-
onShow
public void onShow()- Overrides:
onShow
in classcom.jbstrap.ui.Component<JBMap>
-