public static class MapOptions.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(LatLng center,
java.lang.Number zoom,
java.lang.Number minZoom)
Instantiates a new MapOtions builder.
|
Modifier and Type | Method and Description |
---|---|
MapOptions.Builder |
attributionControl(java.lang.Boolean attributionControl)
Whether the attribution control is added to the map by default.
|
MapOptions.Builder |
bounceAtZoomLimits(java.lang.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.Builder |
boxZoom(java.lang.Boolean boxZoom)
Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
|
MapOptions |
build()
Builds the options
|
MapOptions.Builder |
closePopupOnClick(java.lang.Boolean closePopupOnClick)
Set it to false if you don't want popups to close when user clicks the map.
|
MapOptions.Builder |
doubleClickZoom(java.lang.Boolean doubleClickZoom)
Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift.
|
MapOptions.Builder |
dragging(java.lang.Boolean dragging)
Whether the map is draggable with mouse/touch or not.
|
MapOptions.Builder |
fadeAnimation(java.lang.Boolean fadeAnimation)
Whether the tile fade animation is enabled.
|
MapOptions.Builder |
inertia(java.lang.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.Builder |
inertiaDeceleration(java.lang.Number inertiaDeceleration)
The rate with which the inertial movement slows down, in pixels/second2.
|
MapOptions.Builder |
inertiaMaxSpeed(java.lang.Number inertiaMaxSpeed)
Max speed of the inertial movement, in pixels/second.
|
MapOptions.Builder |
inertiaThreshold(java.lang.Number inertiaThreshold)
Number of milliseconds that should pass between stopping the movement and releasing the mouse or touch to prevent inertial movement.
|
MapOptions.Builder |
keyboard(java.lang.Boolean keyboard)
Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys.
|
MapOptions.Builder |
keyboardPanOffset(java.lang.Number keyboardPanOffset)
Amount of pixels to pan when pressing an arrow key.
|
MapOptions.Builder |
keyboardZoomOffset(java.lang.Number keyboardZoomOffset)
Number of zoom levels to change when pressing + or - key.
|
MapOptions.Builder |
layers(ILayer[] layers)
Layers that will be added to the map initially.
|
MapOptions.Builder |
markerZoomAnimation(java.lang.Boolean markerZoomAnimation)
Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation.
|
MapOptions.Builder |
maxBounds(LatLngBounds maxBounds)
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.Builder |
maxZoom(java.lang.Number maxZoom)
Maximum zoom level of the map.
|
MapOptions.Builder |
scrollWheelZoom(java.lang.Boolean scrollWheelZoom)
Whether the map can be zoomed by using the mouse wheel.
|
MapOptions.Builder |
tap(java.lang.Boolean tap)
Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).
|
MapOptions.Builder |
tapTolerance(java.lang.Number tapTolerance)
The max number of pixels a user can shift his finger during touch for it to be considered a valid tap.
|
MapOptions.Builder |
touchZoom(java.lang.Boolean touchZoom)
Whether the map can be zoomed by touch-dragging with two fingers.
|
MapOptions.Builder |
trackResize(java.lang.Boolean trackResize)
Whether the map automatically handles browser window resize to update itself.
|
MapOptions.Builder |
worldCopyJump(java.lang.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.Builder |
zoomAnimation(java.lang.Boolean zoomAnimation)
Whether the tile zoom animation is enabled.
|
MapOptions.Builder |
zoomAnimationThreshold(java.lang.Number zoomAnimationThreshold)
Won't animate zoom if the zoom difference exceeds this value.
|
MapOptions.Builder |
zoomControl(java.lang.Boolean zoomControl)
Whether the zoom control is added to the map by default.
|
public Builder(LatLng center, java.lang.Number zoom, java.lang.Number minZoom)
center
- Initial geographical center of the map.zoom
- Initial map zoom.minZoom
- Minimum zoom level of the map. Overrides any minZoom set on map layers.public MapOptions.Builder layers(ILayer[] layers)
layers
- the Layers that will be added to the map initially.public MapOptions.Builder maxZoom(java.lang.Number maxZoom)
maxZoom
- the max zoompublic MapOptions.Builder maxBounds(LatLngBounds maxBounds)
maxBounds
- the max boundspublic MapOptions.Builder dragging(java.lang.Boolean dragging)
dragging
- true or flasepublic MapOptions.Builder touchZoom(java.lang.Boolean touchZoom)
touchZoom
- true or falsepublic MapOptions.Builder scrollWheelZoom(java.lang.Boolean scrollWheelZoom)
scrollWheelZoom
- true or falsepublic MapOptions.Builder doubleClickZoom(java.lang.Boolean doubleClickZoom)
doubleClickZoom
- true or falsepublic MapOptions.Builder boxZoom(java.lang.Boolean boxZoom)
boxZoom
- true or falsepublic MapOptions.Builder tap(java.lang.Boolean tap)
tap
- true or falsepublic MapOptions.Builder tapTolerance(java.lang.Number tapTolerance)
tapTolerance
- the tap tolerance numberpublic MapOptions.Builder trackResize(java.lang.Boolean trackResize)
trackResize
- true or falsepublic MapOptions.Builder worldCopyJump(java.lang.Boolean worldCopyJump)
worldCopyJump
- true or falsepublic MapOptions.Builder closePopupOnClick(java.lang.Boolean closePopupOnClick)
closePopupOnClick
- true or falsepublic MapOptions.Builder bounceAtZoomLimits(java.lang.Boolean bounceAtZoomLimits)
closePopupOnClick
- true or falsepublic MapOptions.Builder keyboard(java.lang.Boolean keyboard)
keyboard
- true or falsepublic MapOptions.Builder keyboardPanOffset(java.lang.Number keyboardPanOffset)
keyboardPanOffset
- the keyboard pan offsetpublic MapOptions.Builder keyboardZoomOffset(java.lang.Number keyboardZoomOffset)
keyboardZoomOffset
- the keyboard zoom offsetpublic MapOptions.Builder inertia(java.lang.Boolean inertia)
inertia
- true or falsepublic MapOptions.Builder inertiaDeceleration(java.lang.Number inertiaDeceleration)
inertiaDeceleration
- the inertia decelerationpublic MapOptions.Builder inertiaMaxSpeed(java.lang.Number inertiaMaxSpeed)
inertiaMaxSpeed
- the inertia max speedpublic MapOptions.Builder inertiaThreshold(java.lang.Number inertiaThreshold)
inertiaThreshold
- the inertia thresholdpublic MapOptions.Builder zoomControl(java.lang.Boolean zoomControl)
zoomControl
- true or falsepublic MapOptions.Builder attributionControl(java.lang.Boolean attributionControl)
attributionControl
- true or falsepublic MapOptions.Builder fadeAnimation(java.lang.Boolean fadeAnimation)
fadeAnimation
- true or falsepublic MapOptions.Builder zoomAnimation(java.lang.Boolean zoomAnimation)
zoomAnimation
- the zoom animationpublic MapOptions.Builder zoomAnimationThreshold(java.lang.Number zoomAnimationThreshold)
zoomAnimationThreshold
- the zoom animation thresholdpublic MapOptions.Builder markerZoomAnimation(java.lang.Boolean markerZoomAnimation)
markerZoomAnimation
- true or falsepublic MapOptions build()