Class MapView
java.lang.Object
io.jmix.mapsflowui.kit.component.model.MapObservableObject
io.jmix.mapsflowui.kit.component.model.MapView
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GeoMapView,NoOpMapView
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Extentprotected Integerprotected Integerprotected CRSprotected Doubleprotected intFields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, removedChildren, syncId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetType()intgetZoom()voidSets the view extent.voidsetMaxZoom(Integer maxZoom) Sets the maximum zoom level for the view.voidsetMinZoom(Integer minZoom) Sets a minimum zoom level for the view.voidsetProjection(CRS projection) Sets the projection to view.voidsetRotation(Double rotation) Sets the rotation for the view in radians (positive rotation clockwise, 0 means North).voidsetZoom(int zoom) Zooms to a specific zoom level.Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSyncId, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, unmarkDirtyInDepth
-
Field Details
-
extent
-
projection
-
rotation
-
maxZoom
-
minZoom
-
zoom
protected int zoom
-
-
Constructor Details
-
MapView
public MapView()
-
-
Method Details
-
getExtent
- Returns:
- view extent or
nullif not set
-
setExtent
Sets the view extent. This extent is a constraint that does not enable to move map visible area outside specified extent.Note, extent attribute is set only at creation time and cannot be changed at runtime.
For more details see: View docs
- Parameters:
extent- extent to set
-
getProjection
- Returns:
- projection or
nullif not set
-
setProjection
Sets the projection to view. The default projection is "EPSG:3857" (WGS 84 / Pseudo-Mercator). If a source (based onTileImageSourceorImageSource) has a projection different from the current map view’s projection then the reprojection happens automatically.There are available two options:
-
CRSvalue - sets value as CRS constant, e.g.CRS.EPSG_4326or as anonymous implementation, e.g.setProjection(() -> "EPSG:4326");. -
Projectionvalue - sets custom projection.
- Parameters:
projection- projection to set
-
-
getRotation
- Returns:
- the rotation or
nullif not set
-
setRotation
Sets the rotation for the view in radians (positive rotation clockwise, 0 means North).For more details see: setRotation docs
- Parameters:
rotation- rotation to set
-
getMaxZoom
- Returns:
- maximum zoom level or
nullif not set
-
setMaxZoom
Sets the maximum zoom level for the view. The default value is28.For more details see: setMaxZoom docs
- Parameters:
maxZoom- maximum zoom to set
-
getMinZoom
- Returns:
- minimum zoom level or
nullif not set
-
setMinZoom
Sets a minimum zoom level for the view. The default value is0.For more details see: setMinZoom docs
- Parameters:
minZoom- minimum zoom level to set
-
getZoom
public int getZoom()- Returns:
- zoom level
-
setZoom
public void setZoom(int zoom) Zooms to a specific zoom level.- Parameters:
zoom- zoom level
-
getType
- Specified by:
getTypein classMapObservableObject
-