MapMoveRequestRPC
Allows user to move the map to certain location.
Use cases
- Focus map to certain place
Description
Requests a map to be moved to certain zoom level and location. Triggers afterMapMoveEvent.
Parameters
(* means the parameter is required)
| Name | Type | Description | Default value |
|---|---|---|---|
| \* x | Number | x coordinate of the desired map location | |
| \* y | Number | y coordinate of the desired map location | |
| zoomLevel | Number|Object |
Desired zoomlevel as a number Or ```javascript { scale } // or { left, top, bottom, right } ``` |
|
| options | Object | Optional parameters ```javascript { srsName: 'EPSG:3857', animation: 'fly'|'pan' } ``` |
Examples
Move map
var sb = Oskari.getSandbox();
var x = 552935,
y = 7332639,
zoomLevel = 7;
sb.postRequestByName('MapMoveRequest', [x, y, zoomLevel]);Related api
- afterMapMoveEvent