Maps SDK for Web
tt.plugins.PanControls
Plugin that provides the ability to pan map using ui controls.
Constructor
tt.plugins.PanControls([panOffset=100], [className])
Example
const ttPanControls = new tt.plugins.PanControls({
className: 'my-class-name', // default = ''
panOffset: 150 // default = 100
});
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
});
map.addControl(ttPanControls, 'top-left');
Parameters
Methods
onAdd(map): HTMLElement
Binds the map with the plugin instance.
Parameters
Name | Description |
---|---|
map
Maps.Map default:None |
Returns
container
onRemove( ): Void
Removes the plugin from the map.
Returns