forked from mapbox/mapbox-gl-js-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (29 loc) · 1.04 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function FakeControl() { }
/* Old Control API */
FakeControl.prototype.addTo = function() { return this; }
/* New Control API */
FakeControl.prototype.onAdd = function() {}
FakeControl.prototype.onRemove = function() {}
FakeControl.prototype._setupUI = function() {}
FakeControl.prototype._onMove = function() {}
FakeControl.prototype._updateAttributions = function() {}
FakeControl.prototype._updateEditLink = function() {}
FakeControl.prototype._updateCompact = function() {}
function FakePopup(){
this.setLngLat = () => { return this; };
this.setHTML = (html) => { this.html = html;return this; };
this.remove = () => { return this; };
this.addTo = (map) => { map.popups.push(this);return this; };
this.getElement = () => document;
}
module.exports = {
Map: require('./classes/map'),
LngLat: require('mapbox-gl').LngLat,
LngLatBounds: require('mapbox-gl').LngLatBounds,
NavigationControl: FakeControl,
ScaleControl: FakeControl,
AttributionControl: FakeControl,
Popup: FakePopup,
Marker: FakePopup,
GeolocateControl: FakeControl
}