2018-02-09 17:38:42 +00:00
|
|
|
import Utils from '../Utils';
|
2018-03-29 18:25:20 +00:00
|
|
|
import L from 'leaflet';
|
2018-02-09 17:38:42 +00:00
|
|
|
|
|
|
|
const { assert } = Utils;
|
|
|
|
|
|
|
|
const leafletPreCheck = (options) => {
|
|
|
|
assert(options.map !== undefined);
|
2018-05-04 16:37:34 +00:00
|
|
|
assert(options.tiles !== undefined);
|
2018-02-09 17:38:42 +00:00
|
|
|
};
|
|
|
|
|
2019-07-02 15:01:49 +00:00
|
|
|
const layersControlPreCheck = (options) => {
|
2019-07-09 22:08:28 +00:00
|
|
|
assert(options.controls !== undefined);
|
2019-07-02 15:01:49 +00:00
|
|
|
leafletPreCheck(options);
|
|
|
|
}
|
|
|
|
|
2018-02-09 17:38:42 +00:00
|
|
|
export default {
|
|
|
|
namespace: "Map",
|
|
|
|
|
|
|
|
endpoints: [
|
2019-07-09 22:08:28 +00:00
|
|
|
["willAddControls", leafletPreCheck],
|
|
|
|
["didAddControls", layersControlPreCheck],
|
2018-04-29 20:43:45 +00:00
|
|
|
["addActionButton", leafletPreCheck],
|
2018-02-09 17:38:42 +00:00
|
|
|
]
|
|
|
|
};
|
|
|
|
|