@progress/kendo-charts 1.23.0-dev.202201170823 → 1.23.0-dev.202202150641
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/barcode/barcode.js +8 -7
- package/dist/es/barcode/surface-size.js +19 -0
- package/dist/es/chart/heatmap-chart/color-scale.js +1 -1
- package/dist/es/chart/heatmap-chart/heatmap-chart.js +1 -1
- package/dist/es/core/numeric-axis.js +2 -1
- package/dist/es/map/attribution.js +7 -6
- package/dist/es/map/layers/marker.js +0 -1
- package/dist/es/map/layers/shape.js +0 -1
- package/dist/es/map/layers/tile.js +13 -3
- package/dist/es/map/map.js +38 -22
- package/dist/es/map/navigator.js +3 -2
- package/dist/es/map/scroller/observable.js +24 -0
- package/dist/es/map/scroller/user-events.js +1 -0
- package/dist/es/qrcode/qrcode.js +5 -1
- package/dist/es2015/barcode/barcode.js +8 -7
- package/dist/es2015/barcode/surface-size.js +19 -0
- package/dist/es2015/chart/heatmap-chart/color-scale.js +1 -1
- package/dist/es2015/chart/heatmap-chart/heatmap-chart.js +1 -1
- package/dist/es2015/core/numeric-axis.js +2 -1
- package/dist/es2015/map/attribution.js +3 -2
- package/dist/es2015/map/layers/marker.js +0 -1
- package/dist/es2015/map/layers/shape.js +0 -1
- package/dist/es2015/map/layers/tile.js +13 -3
- package/dist/es2015/map/map.js +33 -23
- package/dist/es2015/map/navigator.js +3 -2
- package/dist/es2015/map/scroller/observable.js +22 -0
- package/dist/es2015/map/scroller/user-events.js +1 -0
- package/dist/es2015/qrcode/qrcode.js +5 -1
- package/dist/npm/main.js +253 -182
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +2 -2
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from '../core';
|
|
21
21
|
|
|
22
22
|
import { Encodings } from './encodings/main';
|
|
23
|
+
import { surfaceSize } from './surface-size';
|
|
23
24
|
|
|
24
25
|
var DEFAULT_BARCODE_WIDTH = 300;
|
|
25
26
|
var DEFAULT_BARCODE_HEIGHT = 100;
|
|
@@ -84,7 +85,7 @@ var Barcode = (function (Class) {
|
|
|
84
85
|
Barcode.prototype._initSurfaceElement = function _initSurfaceElement () {
|
|
85
86
|
if (!this.surfaceElement) {
|
|
86
87
|
this.surfaceElement = document.createElement('div');
|
|
87
|
-
this.surfaceElement.style.position =
|
|
88
|
+
this.surfaceElement.style.position = 'relative';
|
|
88
89
|
this.element.appendChild(this.surfaceElement);
|
|
89
90
|
}
|
|
90
91
|
};
|
|
@@ -98,6 +99,7 @@ var Barcode = (function (Class) {
|
|
|
98
99
|
|
|
99
100
|
Barcode.prototype.setOptions = function setOptions (options) {
|
|
100
101
|
this._setOptions(options);
|
|
102
|
+
this._initSurface();
|
|
101
103
|
this.redraw();
|
|
102
104
|
};
|
|
103
105
|
|
|
@@ -184,16 +186,15 @@ var Barcode = (function (Class) {
|
|
|
184
186
|
|
|
185
187
|
Barcode.prototype._getSize = function _getSize () {
|
|
186
188
|
var element = this.element;
|
|
187
|
-
var
|
|
188
|
-
var elementHeight = element.clientHeight;
|
|
189
|
+
var elementSize = surfaceSize(element, this.options.renderAs);
|
|
189
190
|
var size = new geom.Size(DEFAULT_BARCODE_WIDTH, DEFAULT_BARCODE_HEIGHT);
|
|
190
191
|
|
|
191
|
-
if (
|
|
192
|
-
size.width =
|
|
192
|
+
if (elementSize.width > 0) {
|
|
193
|
+
size.width = elementSize.width;
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
if (
|
|
196
|
-
size.height =
|
|
196
|
+
if (elementSize.height > 0) {
|
|
197
|
+
size.height = elementSize.height;
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
if (this.options.width) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function surfaceSize(element, surfaceType) {
|
|
2
|
+
var display = element.style.display;
|
|
3
|
+
if (surfaceType === 'canvas') {
|
|
4
|
+
// The Canvas default size is different from SVG for
|
|
5
|
+
// inline-block containers such as the Barcode and QR Code.
|
|
6
|
+
//
|
|
7
|
+
// Switch to display: block to get same dimensions.
|
|
8
|
+
element.style.display = 'block';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var size = {
|
|
12
|
+
width: element.clientWidth,
|
|
13
|
+
height: element.clientHeight
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
element.style.display = display;
|
|
17
|
+
|
|
18
|
+
return size;
|
|
19
|
+
}
|
|
@@ -8,7 +8,7 @@ var colorScale = function (color, minLightnessOffset) {
|
|
|
8
8
|
var offset = 1 - minLightnessOffset;
|
|
9
9
|
|
|
10
10
|
return function (value) {
|
|
11
|
-
var hsl = baseColor
|
|
11
|
+
var hsl = baseColor.toHSL();
|
|
12
12
|
var range = 100 - hsl.l;
|
|
13
13
|
var point = offset - value;
|
|
14
14
|
hsl.l += Math.min(point * range, range);
|
|
@@ -121,7 +121,7 @@ var HeatmapChart = (function (ChartElement) {
|
|
|
121
121
|
|
|
122
122
|
if (isFunction(series.color)) {
|
|
123
123
|
color = pointOptions.color;
|
|
124
|
-
} else {
|
|
124
|
+
} else if (this.valueRange.max !== 0) {
|
|
125
125
|
var scale = colorScale(color);
|
|
126
126
|
color = scale(value.value / this.valueRange.max);
|
|
127
127
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Class,
|
|
3
2
|
addClass,
|
|
4
3
|
defined,
|
|
5
4
|
valueOrDefault,
|
|
@@ -14,11 +13,13 @@ import {
|
|
|
14
13
|
removeChildren
|
|
15
14
|
} from './utils';
|
|
16
15
|
|
|
16
|
+
import { Observable } from './scroller/observable';
|
|
17
|
+
|
|
17
18
|
var template = TemplateService.compile;
|
|
18
19
|
|
|
19
|
-
export var Attribution = (function (
|
|
20
|
+
export var Attribution = (function (Observable) {
|
|
20
21
|
function Attribution(element, options) {
|
|
21
|
-
|
|
22
|
+
Observable.call(this);
|
|
22
23
|
this.element = element;
|
|
23
24
|
|
|
24
25
|
this._initOptions(options);
|
|
@@ -27,8 +28,8 @@ export var Attribution = (function (Class) {
|
|
|
27
28
|
addClass(this.element, 'k-widget k-attribution');
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
if (
|
|
31
|
-
Attribution.prototype = Object.create(
|
|
31
|
+
if ( Observable ) Attribution.__proto__ = Observable;
|
|
32
|
+
Attribution.prototype = Object.create( Observable && Observable.prototype );
|
|
32
33
|
Attribution.prototype.constructor = Attribution;
|
|
33
34
|
|
|
34
35
|
Attribution.prototype._initOptions = function _initOptions (options) {
|
|
@@ -147,7 +148,7 @@ export var Attribution = (function (Class) {
|
|
|
147
148
|
};
|
|
148
149
|
|
|
149
150
|
return Attribution;
|
|
150
|
-
}(
|
|
151
|
+
}(Observable));
|
|
151
152
|
|
|
152
153
|
setDefaultOptions(Attribution, {
|
|
153
154
|
name: 'Attribution',
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
setDefaultOptions
|
|
14
14
|
} from '../../common';
|
|
15
15
|
|
|
16
|
+
import { removeChildren } from '../utils';
|
|
17
|
+
|
|
16
18
|
import { Layer } from './layer';
|
|
17
19
|
|
|
18
20
|
import TemplateService from '../../services/template-service';
|
|
@@ -203,7 +205,7 @@ export var TileView = (function (Class) {
|
|
|
203
205
|
};
|
|
204
206
|
|
|
205
207
|
TileView.prototype.destroy = function destroy () {
|
|
206
|
-
this.element
|
|
208
|
+
removeChildren(this.element);
|
|
207
209
|
this.pool.empty();
|
|
208
210
|
};
|
|
209
211
|
|
|
@@ -226,6 +228,7 @@ export var TileView = (function (Class) {
|
|
|
226
228
|
x: firstTileIndex.x + x,
|
|
227
229
|
y: firstTileIndex.y + y
|
|
228
230
|
});
|
|
231
|
+
|
|
229
232
|
if (!tile.visible) {
|
|
230
233
|
tile.show();
|
|
231
234
|
}
|
|
@@ -265,6 +268,7 @@ export var TileView = (function (Class) {
|
|
|
265
268
|
|
|
266
269
|
TileView.prototype.wrapIndex = function wrapIndex (index) {
|
|
267
270
|
var boundary = math.pow(2, this._zoom);
|
|
271
|
+
|
|
268
272
|
return {
|
|
269
273
|
x: this.wrapValue(index.x, boundary),
|
|
270
274
|
y: limitValue(index.y, 0, boundary - 1)
|
|
@@ -302,8 +306,14 @@ export var ImageTile = (function (Class) {
|
|
|
302
306
|
ImageTile.prototype.constructor = ImageTile;
|
|
303
307
|
|
|
304
308
|
ImageTile.prototype.destroy = function destroy () {
|
|
305
|
-
|
|
306
|
-
|
|
309
|
+
var element = this.element;
|
|
310
|
+
var parentNode = element ? element.parentNode : null;
|
|
311
|
+
|
|
312
|
+
if (element) {
|
|
313
|
+
if (parentNode) {
|
|
314
|
+
parentNode.removeChild(element);
|
|
315
|
+
}
|
|
316
|
+
|
|
307
317
|
this.element = null;
|
|
308
318
|
}
|
|
309
319
|
};
|
package/dist/es/map/map.js
CHANGED
|
@@ -117,27 +117,8 @@ var Map = (function (Observable) {
|
|
|
117
117
|
|
|
118
118
|
Observable.call(this);
|
|
119
119
|
|
|
120
|
-
this.support = getSupportedFeatures();
|
|
121
|
-
|
|
122
|
-
this.initObserver(context);
|
|
123
|
-
this.initServices(context);
|
|
124
|
-
|
|
125
|
-
this._initOptions(options);
|
|
126
|
-
this.bind(this.events, options);
|
|
127
|
-
this.crs = new EPSG3857();
|
|
128
|
-
|
|
129
|
-
this._initElement(element);
|
|
130
|
-
|
|
131
|
-
this._viewOrigin = this._getOrigin();
|
|
132
|
-
|
|
133
|
-
this._initScroller();
|
|
134
|
-
this._initMarkers();
|
|
135
|
-
this._initControls();
|
|
136
|
-
this._initLayers();
|
|
137
|
-
this._reset();
|
|
138
120
|
|
|
139
|
-
this.
|
|
140
|
-
on(this.element, MOUSEWHEEL, this._mousewheelHandler);
|
|
121
|
+
this._init(element, options, themeOptions, context);
|
|
141
122
|
}
|
|
142
123
|
|
|
143
124
|
if ( Observable ) Map.__proto__ = Observable;
|
|
@@ -176,6 +157,35 @@ var Map = (function (Observable) {
|
|
|
176
157
|
Observable.prototype.destroy.call(this);
|
|
177
158
|
};
|
|
178
159
|
|
|
160
|
+
Map.prototype._init = function _init (element, options, themeOptions, context) {
|
|
161
|
+
if ( options === void 0 ) options = {};
|
|
162
|
+
if ( themeOptions === void 0 ) themeOptions = {};
|
|
163
|
+
if ( context === void 0 ) context = {};
|
|
164
|
+
|
|
165
|
+
this.support = getSupportedFeatures();
|
|
166
|
+
this.context = context;
|
|
167
|
+
|
|
168
|
+
this.initObserver(context);
|
|
169
|
+
this.initServices(context);
|
|
170
|
+
|
|
171
|
+
this._initOptions(options);
|
|
172
|
+
this._setEvents(options);
|
|
173
|
+
this.crs = new EPSG3857();
|
|
174
|
+
|
|
175
|
+
this._initElement(element);
|
|
176
|
+
|
|
177
|
+
this._viewOrigin = this._getOrigin();
|
|
178
|
+
|
|
179
|
+
this._initScroller();
|
|
180
|
+
this._initMarkers();
|
|
181
|
+
this._initControls();
|
|
182
|
+
this._initLayers();
|
|
183
|
+
this._reset();
|
|
184
|
+
|
|
185
|
+
this._mousewheelHandler = this._mousewheel.bind(this);
|
|
186
|
+
on(this.element, MOUSEWHEEL, this._mousewheelHandler);
|
|
187
|
+
};
|
|
188
|
+
|
|
179
189
|
Map.prototype._initOptions = function _initOptions (options) {
|
|
180
190
|
this.options = deepExtend({}, this.options, options);
|
|
181
191
|
};
|
|
@@ -188,7 +198,6 @@ var Map = (function (Observable) {
|
|
|
188
198
|
element.setAttribute("data-role", "map");
|
|
189
199
|
removeChildren(element);
|
|
190
200
|
|
|
191
|
-
|
|
192
201
|
var div = convertToHtml("<div />");
|
|
193
202
|
this.element.appendChild(div);
|
|
194
203
|
};
|
|
@@ -315,7 +324,14 @@ var Map = (function (Observable) {
|
|
|
315
324
|
};
|
|
316
325
|
|
|
317
326
|
Map.prototype.setOptions = function setOptions (options) {
|
|
318
|
-
|
|
327
|
+
if ( options === void 0 ) options = {};
|
|
328
|
+
|
|
329
|
+
var element = this.element;
|
|
330
|
+
|
|
331
|
+
this.destroy();
|
|
332
|
+
removeChildren(element);
|
|
333
|
+
this._init(element, options, {}, this.context);
|
|
334
|
+
|
|
319
335
|
this._reset();
|
|
320
336
|
};
|
|
321
337
|
|
package/dist/es/map/navigator.js
CHANGED
|
@@ -75,7 +75,8 @@ export var Navigator = (function (Observable) {
|
|
|
75
75
|
this._keyroot = parentElement ? parentElement : this.element;
|
|
76
76
|
this._tabindex(this._keyroot);
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
this._keydownHandler = proxy(this._keydown, this);
|
|
79
|
+
on(this._keyroot, "keydown", this._keydownHandler);
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
if ( Observable ) Navigator.__proto__ = Observable;
|
|
@@ -88,7 +89,7 @@ export var Navigator = (function (Observable) {
|
|
|
88
89
|
|
|
89
90
|
// originates from the kendo.jquery version
|
|
90
91
|
Navigator.prototype.dispose = function dispose () {
|
|
91
|
-
off(this._keyroot, this.
|
|
92
|
+
off(this._keyroot, "keydown", this._keydownHandler);
|
|
92
93
|
};
|
|
93
94
|
|
|
94
95
|
Navigator.prototype._tabindex = function _tabindex (target) {
|
|
@@ -23,6 +23,10 @@ export var Observable = (function (Class) {
|
|
|
23
23
|
Observable.prototype = Object.create( Class && Class.prototype );
|
|
24
24
|
Observable.prototype.constructor = Observable;
|
|
25
25
|
|
|
26
|
+
Observable.prototype.destroy = function destroy () {
|
|
27
|
+
this.unbind();
|
|
28
|
+
};
|
|
29
|
+
|
|
26
30
|
Observable.prototype.bind = function bind (event, handlers, one) {
|
|
27
31
|
var that = this,
|
|
28
32
|
idx,
|
|
@@ -147,5 +151,25 @@ export var Observable = (function (Class) {
|
|
|
147
151
|
return that;
|
|
148
152
|
};
|
|
149
153
|
|
|
154
|
+
Observable.prototype._setEvents = function _setEvents (options) {
|
|
155
|
+
var this$1 = this;
|
|
156
|
+
|
|
157
|
+
var length = (this.events || []).length;
|
|
158
|
+
|
|
159
|
+
for (var idx = 0; idx < length; idx ++) {
|
|
160
|
+
var e = this$1.events[idx];
|
|
161
|
+
|
|
162
|
+
if (this$1.options[e] && options[e]) {
|
|
163
|
+
this$1.unbind(e, this$1.options[e]);
|
|
164
|
+
|
|
165
|
+
if (this$1._events && this$1._events[e]) {
|
|
166
|
+
delete this$1._events[e];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
this.bind(this.events, options);
|
|
172
|
+
};
|
|
173
|
+
|
|
150
174
|
return Observable;
|
|
151
175
|
}(Class));
|
|
@@ -358,6 +358,7 @@ export var UserEvents = (function (Observable) {
|
|
|
358
358
|
/* eslint-disable no-param-reassign */
|
|
359
359
|
options = options || {};
|
|
360
360
|
/* eslint-enable no-param-reassign */
|
|
361
|
+
this.options = options;
|
|
361
362
|
|
|
362
363
|
filter = that.filter = options.filter;
|
|
363
364
|
that.threshold = options.threshold || DEFAULT_THRESHOLD;
|
package/dist/es/qrcode/qrcode.js
CHANGED
|
@@ -15,6 +15,8 @@ import { Box } from '../core';
|
|
|
15
15
|
import { encodeData } from './encodings/encoding';
|
|
16
16
|
import { extend } from './utils';
|
|
17
17
|
|
|
18
|
+
import { surfaceSize } from '../barcode/surface-size';
|
|
19
|
+
|
|
18
20
|
var round = Math.round;
|
|
19
21
|
var crossPattern = [[0, 1], [1, 1], [1, 2], [2, 2], [2, 1], [3, 1], [3, 0], [2, 0], [2, -1], [1, -1], [1, 0]];
|
|
20
22
|
var squarePattern = [[0, 1], [1, 1], [1, 0]];
|
|
@@ -253,7 +255,8 @@ var QRCode = (function (Class) {
|
|
|
253
255
|
size = parseInt(this.options.size, 10);
|
|
254
256
|
} else {
|
|
255
257
|
var element = this.element;
|
|
256
|
-
var
|
|
258
|
+
var elementSize = surfaceSize(element, this.options.renderAs);
|
|
259
|
+
var min = Math.min(elementSize.width, elementSize.height);
|
|
257
260
|
|
|
258
261
|
if (min > 0) {
|
|
259
262
|
size = min;
|
|
@@ -344,6 +347,7 @@ var QRCode = (function (Class) {
|
|
|
344
347
|
this._value = String(this.options.value);
|
|
345
348
|
}
|
|
346
349
|
|
|
350
|
+
this._initSurface();
|
|
347
351
|
this.redraw();
|
|
348
352
|
};
|
|
349
353
|
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from '../core';
|
|
21
21
|
|
|
22
22
|
import { Encodings } from './encodings/main';
|
|
23
|
+
import { surfaceSize } from './surface-size';
|
|
23
24
|
|
|
24
25
|
const DEFAULT_BARCODE_WIDTH = 300;
|
|
25
26
|
const DEFAULT_BARCODE_HEIGHT = 100;
|
|
@@ -76,7 +77,7 @@ class Barcode extends Class {
|
|
|
76
77
|
_initSurfaceElement() {
|
|
77
78
|
if (!this.surfaceElement) {
|
|
78
79
|
this.surfaceElement = document.createElement('div');
|
|
79
|
-
this.surfaceElement.style.position =
|
|
80
|
+
this.surfaceElement.style.position = 'relative';
|
|
80
81
|
this.element.appendChild(this.surfaceElement);
|
|
81
82
|
}
|
|
82
83
|
}
|
|
@@ -90,6 +91,7 @@ class Barcode extends Class {
|
|
|
90
91
|
|
|
91
92
|
setOptions(options) {
|
|
92
93
|
this._setOptions(options);
|
|
94
|
+
this._initSurface();
|
|
93
95
|
this.redraw();
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -176,16 +178,15 @@ class Barcode extends Class {
|
|
|
176
178
|
|
|
177
179
|
_getSize() {
|
|
178
180
|
const element = this.element;
|
|
179
|
-
const
|
|
180
|
-
const elementHeight = element.clientHeight;
|
|
181
|
+
const elementSize = surfaceSize(element, this.options.renderAs);
|
|
181
182
|
const size = new geom.Size(DEFAULT_BARCODE_WIDTH, DEFAULT_BARCODE_HEIGHT);
|
|
182
183
|
|
|
183
|
-
if (
|
|
184
|
-
size.width =
|
|
184
|
+
if (elementSize.width > 0) {
|
|
185
|
+
size.width = elementSize.width;
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
if (
|
|
188
|
-
size.height =
|
|
188
|
+
if (elementSize.height > 0) {
|
|
189
|
+
size.height = elementSize.height;
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
if (this.options.width) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function surfaceSize(element, surfaceType) {
|
|
2
|
+
const display = element.style.display;
|
|
3
|
+
if (surfaceType === 'canvas') {
|
|
4
|
+
// The Canvas default size is different from SVG for
|
|
5
|
+
// inline-block containers such as the Barcode and QR Code.
|
|
6
|
+
//
|
|
7
|
+
// Switch to display: block to get same dimensions.
|
|
8
|
+
element.style.display = 'block';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const size = {
|
|
12
|
+
width: element.clientWidth,
|
|
13
|
+
height: element.clientHeight
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
element.style.display = display;
|
|
17
|
+
|
|
18
|
+
return size;
|
|
19
|
+
}
|
|
@@ -6,7 +6,7 @@ const colorScale = (color, minLightnessOffset = 0.05) => {
|
|
|
6
6
|
const offset = 1 - minLightnessOffset;
|
|
7
7
|
|
|
8
8
|
return (value) => {
|
|
9
|
-
const hsl = baseColor
|
|
9
|
+
const hsl = baseColor.toHSL();
|
|
10
10
|
const range = 100 - hsl.l;
|
|
11
11
|
const point = offset - value;
|
|
12
12
|
hsl.l += Math.min(point * range, range);
|
|
@@ -112,7 +112,7 @@ class HeatmapChart extends ChartElement {
|
|
|
112
112
|
|
|
113
113
|
if (isFunction(series.color)) {
|
|
114
114
|
color = pointOptions.color;
|
|
115
|
-
} else {
|
|
115
|
+
} else if (this.valueRange.max !== 0) {
|
|
116
116
|
const scale = colorScale(color);
|
|
117
117
|
color = scale(value.value / this.valueRange.max);
|
|
118
118
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Class,
|
|
3
2
|
addClass,
|
|
4
3
|
defined,
|
|
5
4
|
valueOrDefault,
|
|
@@ -14,9 +13,11 @@ import {
|
|
|
14
13
|
removeChildren
|
|
15
14
|
} from './utils';
|
|
16
15
|
|
|
16
|
+
import { Observable } from './scroller/observable';
|
|
17
|
+
|
|
17
18
|
let template = TemplateService.compile;
|
|
18
19
|
|
|
19
|
-
export class Attribution extends
|
|
20
|
+
export class Attribution extends Observable {
|
|
20
21
|
constructor(element, options) {
|
|
21
22
|
super();
|
|
22
23
|
this.element = element;
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
setDefaultOptions
|
|
14
14
|
} from '../../common';
|
|
15
15
|
|
|
16
|
+
import { removeChildren } from '../utils';
|
|
17
|
+
|
|
16
18
|
import { Layer } from './layer';
|
|
17
19
|
|
|
18
20
|
import TemplateService from '../../services/template-service';
|
|
@@ -193,7 +195,7 @@ export class TileView extends Class {
|
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
destroy() {
|
|
196
|
-
this.element
|
|
198
|
+
removeChildren(this.element);
|
|
197
199
|
this.pool.empty();
|
|
198
200
|
}
|
|
199
201
|
|
|
@@ -214,6 +216,7 @@ export class TileView extends Class {
|
|
|
214
216
|
x: firstTileIndex.x + x,
|
|
215
217
|
y: firstTileIndex.y + y
|
|
216
218
|
});
|
|
219
|
+
|
|
217
220
|
if (!tile.visible) {
|
|
218
221
|
tile.show();
|
|
219
222
|
}
|
|
@@ -253,6 +256,7 @@ export class TileView extends Class {
|
|
|
253
256
|
|
|
254
257
|
wrapIndex(index) {
|
|
255
258
|
let boundary = math.pow(2, this._zoom);
|
|
259
|
+
|
|
256
260
|
return {
|
|
257
261
|
x: this.wrapValue(index.x, boundary),
|
|
258
262
|
y: limitValue(index.y, 0, boundary - 1)
|
|
@@ -284,8 +288,14 @@ export class ImageTile extends Class {
|
|
|
284
288
|
}
|
|
285
289
|
|
|
286
290
|
destroy() {
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
const element = this.element;
|
|
292
|
+
const parentNode = element ? element.parentNode : null;
|
|
293
|
+
|
|
294
|
+
if (element) {
|
|
295
|
+
if (parentNode) {
|
|
296
|
+
parentNode.removeChild(element);
|
|
297
|
+
}
|
|
298
|
+
|
|
289
299
|
this.element = null;
|
|
290
300
|
}
|
|
291
301
|
}
|
package/dist/es2015/map/map.js
CHANGED
|
@@ -113,27 +113,8 @@ class Map extends Observable {
|
|
|
113
113
|
constructor(element, options = {}, themeOptions = {}, context = {}) {
|
|
114
114
|
super();
|
|
115
115
|
|
|
116
|
-
this.support = getSupportedFeatures();
|
|
117
|
-
|
|
118
|
-
this.initObserver(context);
|
|
119
|
-
this.initServices(context);
|
|
120
|
-
|
|
121
|
-
this._initOptions(options);
|
|
122
|
-
this.bind(this.events, options);
|
|
123
|
-
this.crs = new EPSG3857();
|
|
124
|
-
|
|
125
|
-
this._initElement(element);
|
|
126
116
|
|
|
127
|
-
this.
|
|
128
|
-
|
|
129
|
-
this._initScroller();
|
|
130
|
-
this._initMarkers();
|
|
131
|
-
this._initControls();
|
|
132
|
-
this._initLayers();
|
|
133
|
-
this._reset();
|
|
134
|
-
|
|
135
|
-
this._mousewheelHandler = this._mousewheel.bind(this);
|
|
136
|
-
on(this.element, MOUSEWHEEL, this._mousewheelHandler);
|
|
117
|
+
this._init(element, options, themeOptions, context);
|
|
137
118
|
}
|
|
138
119
|
|
|
139
120
|
destroy() {
|
|
@@ -166,6 +147,31 @@ class Map extends Observable {
|
|
|
166
147
|
super.destroy();
|
|
167
148
|
}
|
|
168
149
|
|
|
150
|
+
_init(element, options = {}, themeOptions = {}, context = {}) {
|
|
151
|
+
this.support = getSupportedFeatures();
|
|
152
|
+
this.context = context;
|
|
153
|
+
|
|
154
|
+
this.initObserver(context);
|
|
155
|
+
this.initServices(context);
|
|
156
|
+
|
|
157
|
+
this._initOptions(options);
|
|
158
|
+
this._setEvents(options);
|
|
159
|
+
this.crs = new EPSG3857();
|
|
160
|
+
|
|
161
|
+
this._initElement(element);
|
|
162
|
+
|
|
163
|
+
this._viewOrigin = this._getOrigin();
|
|
164
|
+
|
|
165
|
+
this._initScroller();
|
|
166
|
+
this._initMarkers();
|
|
167
|
+
this._initControls();
|
|
168
|
+
this._initLayers();
|
|
169
|
+
this._reset();
|
|
170
|
+
|
|
171
|
+
this._mousewheelHandler = this._mousewheel.bind(this);
|
|
172
|
+
on(this.element, MOUSEWHEEL, this._mousewheelHandler);
|
|
173
|
+
}
|
|
174
|
+
|
|
169
175
|
_initOptions(options) {
|
|
170
176
|
this.options = deepExtend({}, this.options, options);
|
|
171
177
|
}
|
|
@@ -178,7 +184,6 @@ class Map extends Observable {
|
|
|
178
184
|
element.setAttribute("data-role", "map");
|
|
179
185
|
removeChildren(element);
|
|
180
186
|
|
|
181
|
-
|
|
182
187
|
const div = convertToHtml("<div />");
|
|
183
188
|
this.element.appendChild(div);
|
|
184
189
|
}
|
|
@@ -296,8 +301,13 @@ class Map extends Observable {
|
|
|
296
301
|
return result;
|
|
297
302
|
}
|
|
298
303
|
|
|
299
|
-
setOptions(options) {
|
|
300
|
-
|
|
304
|
+
setOptions(options = {}) {
|
|
305
|
+
const element = this.element;
|
|
306
|
+
|
|
307
|
+
this.destroy();
|
|
308
|
+
removeChildren(element);
|
|
309
|
+
this._init(element, options, {}, this.context);
|
|
310
|
+
|
|
301
311
|
this._reset();
|
|
302
312
|
}
|
|
303
313
|
|
|
@@ -75,7 +75,8 @@ export class Navigator extends Observable {
|
|
|
75
75
|
this._keyroot = parentElement ? parentElement : this.element;
|
|
76
76
|
this._tabindex(this._keyroot);
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
this._keydownHandler = proxy(this._keydown, this);
|
|
79
|
+
on(this._keyroot, "keydown", this._keydownHandler);
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
destroy() {
|
|
@@ -84,7 +85,7 @@ export class Navigator extends Observable {
|
|
|
84
85
|
|
|
85
86
|
// originates from the kendo.jquery version
|
|
86
87
|
dispose() {
|
|
87
|
-
off(this._keyroot, this.
|
|
88
|
+
off(this._keyroot, "keydown", this._keydownHandler);
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
_tabindex(target) {
|