@progress/kendo-charts 1.23.6 → 1.24.0-dev.202206130925
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/map/constants.js +2 -0
- package/dist/es/map/layers/bubble.js +21 -0
- package/dist/es/map/layers/layer.js +5 -0
- package/dist/es/map/layers/marker.js +25 -20
- package/dist/es/map/layers/shape.js +46 -14
- package/dist/es/map/map.js +33 -2
- package/dist/es/map/tooltip/tooltip.js +73 -0
- package/dist/es2015/map/constants.js +2 -0
- package/dist/es2015/map/layers/bubble.js +21 -0
- package/dist/es2015/map/layers/layer.js +5 -0
- package/dist/es2015/map/layers/marker.js +25 -20
- package/dist/es2015/map/layers/shape.js +44 -14
- package/dist/es2015/map/map.js +33 -2
- package/dist/es2015/map/tooltip/tooltip.js +63 -0
- package/dist/npm/main.js +201 -36
- package/dist/npm/map.d.ts +3 -0
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +1 -1
package/dist/es2015/map/map.js
CHANGED
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
limitValue,
|
|
12
12
|
deepExtend,
|
|
13
13
|
elementOffset,
|
|
14
|
-
isArray
|
|
14
|
+
isArray,
|
|
15
|
+
round
|
|
15
16
|
} from '../common';
|
|
16
17
|
|
|
17
18
|
import {
|
|
@@ -38,6 +39,8 @@ import {
|
|
|
38
39
|
Extent
|
|
39
40
|
} from './extent';
|
|
40
41
|
|
|
42
|
+
import { Tooltip } from './tooltip/tooltip';
|
|
43
|
+
|
|
41
44
|
import {
|
|
42
45
|
TileLayer
|
|
43
46
|
} from './layers/tile';
|
|
@@ -113,13 +116,16 @@ class Map extends Observable {
|
|
|
113
116
|
constructor(element, options = {}, themeOptions = {}, context = {}) {
|
|
114
117
|
super();
|
|
115
118
|
|
|
116
|
-
|
|
117
119
|
this._init(element, options, themeOptions, context);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
destroy() {
|
|
121
123
|
this.scroller.destroy();
|
|
122
124
|
|
|
125
|
+
if (this._tooltip) {
|
|
126
|
+
this._tooltip.destroy();
|
|
127
|
+
}
|
|
128
|
+
|
|
123
129
|
if (this.navigator) {
|
|
124
130
|
this.navigator.destroy();
|
|
125
131
|
}
|
|
@@ -162,6 +168,7 @@ class Map extends Observable {
|
|
|
162
168
|
|
|
163
169
|
this._viewOrigin = this._getOrigin();
|
|
164
170
|
|
|
171
|
+
this._tooltip = this._createTooltip();
|
|
165
172
|
this._initScroller();
|
|
166
173
|
this._initMarkers();
|
|
167
174
|
this._initControls();
|
|
@@ -394,6 +401,12 @@ class Map extends Observable {
|
|
|
394
401
|
return false;
|
|
395
402
|
}
|
|
396
403
|
|
|
404
|
+
hideTooltip() {
|
|
405
|
+
if (this._tooltip) {
|
|
406
|
+
this._tooltip.hide();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
397
410
|
_setOrigin(origin, zoom) {
|
|
398
411
|
let size = this.viewSize(),
|
|
399
412
|
topLeft;
|
|
@@ -609,6 +622,10 @@ class Map extends Observable {
|
|
|
609
622
|
return layer;
|
|
610
623
|
}
|
|
611
624
|
|
|
625
|
+
_createTooltip() {
|
|
626
|
+
return new Tooltip(this.widgetService, this.options.tooltip);
|
|
627
|
+
}
|
|
628
|
+
|
|
612
629
|
/* eslint-disable arrow-body-style */
|
|
613
630
|
_initMarkers() {
|
|
614
631
|
const markerLayers = (this.options.layers || []).filter(x => {
|
|
@@ -635,6 +652,9 @@ class Map extends Observable {
|
|
|
635
652
|
origin.y += offset.y;
|
|
636
653
|
this._scrollOffset = offset;
|
|
637
654
|
|
|
655
|
+
this._tooltip.offset = offset;
|
|
656
|
+
this.hideTooltip();
|
|
657
|
+
|
|
638
658
|
this._setOrigin(this.layerToLocation(origin));
|
|
639
659
|
|
|
640
660
|
this.trigger('pan', {
|
|
@@ -704,6 +724,7 @@ class Map extends Observable {
|
|
|
704
724
|
this._viewOrigin = this._getOrigin(true);
|
|
705
725
|
|
|
706
726
|
this._resetScroller();
|
|
727
|
+
this.hideTooltip();
|
|
707
728
|
|
|
708
729
|
this.trigger('beforeReset');
|
|
709
730
|
this.trigger('reset');
|
|
@@ -775,6 +796,7 @@ class Map extends Observable {
|
|
|
775
796
|
}
|
|
776
797
|
|
|
777
798
|
let cursor = this.eventOffset(e);
|
|
799
|
+
this.hideTooltip();
|
|
778
800
|
|
|
779
801
|
this.trigger('click', {
|
|
780
802
|
originalEvent: e,
|
|
@@ -824,6 +846,15 @@ class Map extends Observable {
|
|
|
824
846
|
}
|
|
825
847
|
}
|
|
826
848
|
}
|
|
849
|
+
|
|
850
|
+
_toDocumentCoordinates(point) {
|
|
851
|
+
const offset = elementOffset(this.element);
|
|
852
|
+
|
|
853
|
+
return {
|
|
854
|
+
left: round(point.x + offset.left),
|
|
855
|
+
top: round(point.y + offset.top)
|
|
856
|
+
};
|
|
857
|
+
}
|
|
827
858
|
}
|
|
828
859
|
|
|
829
860
|
setDefaultOptions(Map, {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Class, deepExtend, setDefaultOptions } from '../../common';
|
|
2
|
+
import { SHOW_TOOLTIP, HIDE_TOOLTIP } from '../constants';
|
|
3
|
+
|
|
4
|
+
export class Tooltip extends Class {
|
|
5
|
+
constructor(widgetService, options) {
|
|
6
|
+
super();
|
|
7
|
+
|
|
8
|
+
this.widgetService = widgetService;
|
|
9
|
+
this.options = deepExtend({}, this.options, options);
|
|
10
|
+
this.offset = { x: 0, y: 0 };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
show(anchor, args) {
|
|
14
|
+
if (this.location === args.location) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
this.anchor = anchor;
|
|
19
|
+
this.location = args.location;
|
|
20
|
+
|
|
21
|
+
this.widgetService.notify(SHOW_TOOLTIP,
|
|
22
|
+
Object.assign({ anchor: this.anchor }, args)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
this.visible = true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
hide() {
|
|
29
|
+
if (this.widgetService) {
|
|
30
|
+
this.widgetService.notify(HIDE_TOOLTIP);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
this.visible = false;
|
|
34
|
+
this.location = null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get anchor() {
|
|
38
|
+
return this._anchor;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
set anchor(anchor) {
|
|
42
|
+
const documentPoint = this.widgetService.widget._toDocumentCoordinates({
|
|
43
|
+
x: anchor.left - this.offset.x,
|
|
44
|
+
y: anchor.top - this.offset.y
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
this._anchor = {
|
|
48
|
+
left: documentPoint.left,
|
|
49
|
+
top: documentPoint.top
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
destroy() {
|
|
54
|
+
this.widgetService = null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
setDefaultOptions(Tooltip, {
|
|
59
|
+
border: {
|
|
60
|
+
width: 1
|
|
61
|
+
},
|
|
62
|
+
opacity: 1
|
|
63
|
+
});
|