forked from glenrobertson/leaflet-tilelayer-geojson
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTileLayer.Div.js
68 lines (54 loc) · 2.31 KB
/
TileLayer.Div.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
L.TileLayer.Div = L.TileLayer.extend({
initialize: function (vectorLayer) {
L.TileLayer.prototype.initialize.call(this, null, vectorLayer.options);
this.vectorLayer = vectorLayer;
},
onAdd: function (map) {
this.vectorLayer.on('tileloadstart', this._onTileLoadStart, this);
this.vectorLayer.on('tilerequest', this._onTileRequest, this);
this.vectorLayer.on('tileresponse', this._onTileResponse, this);
this.vectorLayer.on('tilerequestabort', this._onTileRequestAbort, this);
this.vectorLayer.on('tileerror', this._onTileError, this);
this.vectorLayer.on('tileload', this._onTileLoad, this);
this.vectorLayer.on('tileunload', this._onTileUnload, this);
L.TileLayer.prototype.onAdd.apply(this, arguments);
},
onRemove: function (map) {
L.TileLayer.prototype.onRemove.apply(this, arguments);
this.vectorLayer.off('tileloadstart', this._onTileLoadStart, this);
this.vectorLayer.off('tilerequest', this._onTileRequest, this);
this.vectorLayer.off('tileresponse', this._onTileResponse, this);
this.vectorLayer.off('tilerequestabort', this._onTileRequestAbort, this);
this.vectorLayer.off('tileerror', this._onTileError, this);
this.vectorLayer.off('tileload', this._onTileLoad, this);
this.vectorLayer.off('tileunload', this._onTileUnload, this);
},
_onTileLoadStart: function(evt) {
this.onTileLoadStart(evt.tile.key);
},
_onTileRequest: function(evt) {
this.onTileRequest(evt.tile.key);
},
_onTileResponse: function(evt) {
this.onTileResponse(evt.tile.key);
},
_onTileRequestAbort: function(evt) {
this.onTileRequestAbort(evt.tile.key);
},
_onTileError: function(evt) {
this.onTileError(evt.tile.key);
},
_onTileLoad: function(evt) {
this.onTileLoad(evt.tile.key);
},
_onTileUnload: function(evt) {
this.onTileUnload(evt.tile.key);
},
onTileLoadStart: function(key) {},
onTileRequest: function(key) {},
onTileResponse: function(key) {},
onTileRequestAbort: function(key) {},
onTileError: function(key) {},
onTileLoad: function(key) {},
onTileUnload: function(key) {}
});