new GeoBookmark(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Geobookmark's options Properties
|
- See:
Fires:
- event:add
- event:remove
- event:select
Example
var bm = new GeoBookmark ({ marks: { "Paris": {pos:ol.proj.transform([2.351828, 48.856578], 'EPSG:4326', 'EPSG:3857'), zoom:11, permanent: true }, "London": {pos:ol.proj.transform([-0.1275,51.507222], 'EPSG:4326', 'EPSG:3857'), zoom:12} } });
Extends
Methods
-
addBookmark(name, options, position, zoom, rotation, permanent)
-
Add a new Geo bookmark (replace existing one if any)
Parameters:
Name Type Description name
string name of the bookmark (display in the menu)
options
* position
ol.coordinate default current position
zoom
number default current map zoom
rotation
number default current map rotation
permanent
bool prevent from deletion, default false
-
getBookmarks()
-
Get Geo bookmarks
Returns:
a list of bookmarks : { BM1:{pos:ol.coordinates, zoom: integer}, BM2:{pos:ol.coordinates, zoom: integer} }
- Type
- any
-
removeBookmark(name)
-
Remove a Geo bookmark
Parameters:
Name Type Description name
string -
setBookmarks(bmark)
-
Set bookmarks
Parameters:
Name Type Description bmark
a list of bookmarks, default retreave in the localstorage
Example
bm.setBookmarks({ "Paris": {pos:_ol_proj_.transform([2.351828, 48.856578], 'EPSG:4326', 'EPSG:3857'), zoom:11, permanent: true }, "London": {pos:_ol_proj_.transform([-0.1275,51.507222], 'EPSG:4326', 'EPSG:3857'), zoom:12} });