Constructor and Description |
---|
MapOptions() |
Modifier and Type | Method and Description |
---|---|
MapOptions |
setAttributionControl(boolean attributionControl)
Whether the attribution control is added to the map by default.
|
MapOptions |
setBounceAtZoomLimits(boolean bounceAtZoomLimits)
Set it to
false if you don't want the map to zoom beyond
min/max zoom and then bounce back when pinch-zooming. |
MapOptions |
setBoxZoom(boolean boxZoom)
Whether the map can be zoomed to a rectangular area specified by dragging
the mouse while pressing shift.
|
MapOptions |
setCenter(LatLng latLng)
Initial geographical center of the map.
|
MapOptions |
setClosePopupOnClick(boolean closePopupOnClick)
Set it to
false if you don't want popups to close when user
clicks the map. |
MapOptions |
setCRS(ICRS crs)
Coordinate Reference System to use.
|
MapOptions |
setDoubleClickZoom(boolean doubleClickZoom)
Whether the map can be zoomed in by double clicking on it and zoomed out
by double clicking while holding shift.
|
MapOptions |
setDragging(boolean dragging)
Whether the map is draggable with mouse/touch or not.
|
MapOptions |
setFadeAnimation(boolean fadeAnimation)
Whether the tile fade animation is enabled.
|
MapOptions |
setInertia(boolean inertia)
If enabled, panning of the map will have an inertia effect where the map
builds momentum while dragging and continues moving in the same direction
for some time.
|
MapOptions |
setInertiaDeceleration(int inertiaDeceleration)
The rate with which the inertial movement slows down, in pixels/second^2.
|
MapOptions |
setInertiaMaxSpeed(int inertiaMaxSpeed)
Max speed of the inertial movement, in pixels/second.
|
MapOptions |
setInertiaThreshold(int inertiaThreshold)
Number of milliseconds that should pass between stopping the movement and
releasing the mouse or touch to prevent inertial movement. 32 for touch
devices and 14 for the rest by default.
|
MapOptions |
setKeyboard(boolean keyboard)
Makes the map focusable and allows users to navigate the map with
keyboard arrows and +/- keys.
|
MapOptions |
setKeyboardPanOffset(int keyboardPanOffset)
Amount of pixels to pan when pressing an arrow key.
|
MapOptions |
setKeyboardZoomOffset(int keyboardZoomOffset)
Number of zoom levels to change when pressing + or - key.
|
MapOptions |
setLayers(ILayer[] layers)
Layers that will be added to the map initially.
|
MapOptions |
setMarkerZoomAnimation(boolean markerZoomAnimation)
Whether markers animate their zoom with the zoom animation, if disabled
they will disappear for the length of the animation.
|
MapOptions |
setMaxBounds(LatLngBounds bounds)
When this option is set, the map restricts the view to the given
geographical bounds, bouncing the user back when he tries to pan outside
the view.
|
MapOptions |
setMaxZoom(int maxZoom)
Maximum zoom level of the map.
|
MapOptions |
setMinZoom(int minZoom)
Minimum zoom level of the map.
|
MapOptions |
setScrollWheelZoom(boolean scrollWheelZoom)
Whether the map can be zoomed by using the mouse wheel.
|
MapOptions |
setTap(boolean tap)
Enables mobile hacks for supporting instant taps (fixing 200ms click
delay on iOS/Android) and touch holds (fired as contextmenu events).
|
MapOptions |
setTapTolerance(int tapTolerance)
The max number of pixels a user can shift his finger during touch for it
to be considered a valid tap.
|
MapOptions |
setTouchZoom(boolean touchZoom)
Whether the map can be zoomed by touch-dragging with two fingers.
|
MapOptions |
setTrackResize(boolean trackResize)
Whether the map automatically handles browser window resize to update
itself.
|
MapOptions |
setWorldCopyJump(boolean worldCopyJump)
With this option enabled, the map tracks when you pan to another "copy"
of the world and seamlessly jumps to the original one so that all
overlays like markers and vector layers are still visible.
|
MapOptions |
setZoom(int zoom)
Initial map zoom.
|
MapOptions |
setZoomAnimation(boolean zoomAnimation)
Whether the tile zoom animation is enabled.
|
MapOptions |
setZoomAnimationThreshold(int zoomAnimationThreshold)
Won't animate zoom if the zoom difference exceeds this value.
|
MapOptions |
setZoomControl(boolean zoomControl)
Whether the zoom control is added to the map by default.
|
public MapOptions setCenter(LatLng latLng)
latLng
- The initial geographical center of the map.MapOptions
object with the set options.public MapOptions setZoom(int zoom)
zoom
- The initial map zoom.MapOptions
object with the set options.public MapOptions setLayers(ILayer[] layers)
layers
- The layers that will be added to the map initially.MapOptions
object with the set options.public MapOptions setMinZoom(int minZoom)
minZoom
- The minimum zoom level of the map.MapOptions
object with the set options.public MapOptions setMaxZoom(int maxZoom)
maxZoom
- The maximum zoom level of the map.MapOptions
object with the set options.public MapOptions setMaxBounds(LatLngBounds bounds)
bounds
- The geographical bounds.MapOptions
object with the set options.public MapOptions setCRS(ICRS crs)
crs
- The coordinate Reference System.MapOptions
object with the set options.public MapOptions setDragging(boolean dragging)
dragging
- The draggable option.MapOptions
object with the set options.public MapOptions setTouchZoom(boolean touchZoom)
touchZoom
- The touch zoom option.MapOptions
object with the set options.public MapOptions setScrollWheelZoom(boolean scrollWheelZoom)
scrollWheelZoom
- The mouse wheel zoom option.MapOptions
object with the set options.public MapOptions setDoubleClickZoom(boolean doubleClickZoom)
doubleClickZoom
- The double click zoom option.MapOptions
object with the set options.public MapOptions setBoxZoom(boolean boxZoom)
boxZoom
- The box zoom option.MapOptions
object with the set options.public MapOptions setTap(boolean tap)
tap
- The tap option.MapOptions
object with the set options.public MapOptions setTapTolerance(int tapTolerance)
tapTolerance
- The tap tolerance.MapOptions
object with the set options.public MapOptions setTrackResize(boolean trackResize)
trackResize
- The track resize option.MapOptions
object with the set options.public MapOptions setWorldCopyJump(boolean worldCopyJump)
worldCopyJump
- The world copy jump option.MapOptions
object with the set options.public MapOptions setClosePopupOnClick(boolean closePopupOnClick)
false
if you don't want popups to close when user
clicks the map.closePopupOnClick
- The close popup on click option.MapOptions
object with the set options.public MapOptions setBounceAtZoomLimits(boolean bounceAtZoomLimits)
false
if you don't want the map to zoom beyond
min/max zoom and then bounce back when pinch-zooming.bounceAtZoomLimits
- The bounce at zoom limits option.MapOptions
object with the set options.public MapOptions setKeyboard(boolean keyboard)
keyboard
- The keyboard option.MapOptions
object with the set options.public MapOptions setKeyboardPanOffset(int keyboardPanOffset)
keyboardPanOffset
- the keyboard pan offset.MapOptions
object with the set options.public MapOptions setKeyboardZoomOffset(int keyboardZoomOffset)
keyboardZoomOffset
- The keyboard zoom offset.MapOptions
object with the set options.public MapOptions setInertia(boolean inertia)
inertia
- The inertia option.MapOptions
object with the set options.public MapOptions setInertiaDeceleration(int inertiaDeceleration)
inertiaDeceleration
- The inertia deceleration.MapOptions
object with the set options.public MapOptions setInertiaMaxSpeed(int inertiaMaxSpeed)
inertiaMaxSpeed
- The inertia max speed.MapOptions
object with the set options.public MapOptions setInertiaThreshold(int inertiaThreshold)
inertiaThreshold
- The inertia threshold.MapOptions
object with the set options.public MapOptions setZoomControl(boolean zoomControl)
zoomControl
- The zoom control option.MapOptions
object with the set options.public MapOptions setAttributionControl(boolean attributionControl)
attributionControl
- The attribution control option.MapOptions
object with the set options.public MapOptions setFadeAnimation(boolean fadeAnimation)
fadeAnimation
- The fade animation option.MapOptions
object with the set options.public MapOptions setZoomAnimation(boolean zoomAnimation)
zoomAnimation
- The zoom animation option.MapOptions
object with the set options.public MapOptions setZoomAnimationThreshold(int zoomAnimationThreshold)
zoomAnimationThreshold
- The zoom animation threshold.MapOptions
object with the set options.public MapOptions setMarkerZoomAnimation(boolean markerZoomAnimation)
markerZoomAnimation
- The marker zoom animation option.MapOptions
object with the set options.Copyright © 2017. All rights reserved.