Maps SDK for Web
tt.plugins.ZoomControls
A plugin that provides the ability to zoom map using ui controls (including range slider).
Constructor
tt.plugins.ZoomControls([animate=true], [className=''])
Example
const ttZoomControls = new tt.plugins.ZoomControls({
className: 'my-class-name', // default = ''
animate: false // default = true
});
const map = tt.map({
key: '<your-tomtom-maps-sdk-key>',
container: 'map',
theme: {
style: 'main',
layer: 'basic',
source: 'raster'
}
}, {
center: [19.45773, 51.76217],
zoom: 12,
minZoom: 9,
maxZoom:12
});
map.addControl(ttZoomControls, 'top-left');
Methods
onAdd(map): HTMLElement
Binds map with plugin instance.
Parameters
Name | Description |
---|---|
map
Maps.Map default:None |
Returns
container
onRemove( ): Void
Removes plugin from the map.
Returns