@progress/kendo-react-map 6.1.1 → 7.0.0-develop.2
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/LICENSE.md +1 -1
- package/{dist/es/Map.d.ts → Map.d.ts} +4 -1
- package/{dist/npm/MapContext.d.ts → MapContext.d.ts} +4 -0
- package/{dist/es/MapProps.d.ts → MapProps.d.ts} +4 -0
- package/{dist/es/common → common}/events.d.ts +4 -0
- package/common/map-types.d.ts +5 -0
- package/{dist/es/components → components}/BubbleLayer.d.ts +4 -0
- package/{dist/es/components → components}/BubbleLayerTooltip.d.ts +4 -0
- package/components/Layers.d.ts +13 -0
- package/{dist/es/components → components}/MarkerLayer.d.ts +4 -0
- package/{dist/es/components → components}/MarkerLayerTooltip.d.ts +4 -0
- package/{dist/npm/components → components}/ShapeLayer.d.ts +4 -0
- package/{dist/npm/components → components}/ShapeLayerTooltip.d.ts +4 -0
- package/components/TileLayer.d.ts +13 -0
- package/{dist/npm/components → components}/base/CollectionConfigurationComponent.d.ts +4 -0
- package/{dist/es/components → components}/base/ConfigurationComponent.d.ts +4 -0
- package/components/index.d.ts +13 -0
- package/dist/cdn/js/kendo-react-map.js +5 -1
- package/events/base-event.d.ts +18 -0
- package/{dist/npm/events → events}/before-reset-event.d.ts +4 -0
- package/{dist/npm/events → events}/dom-event.d.ts +4 -1
- package/{dist/npm/events → events}/map-click-event.d.ts +4 -0
- package/events/map-event-builder.d.ts +10 -0
- package/{dist/npm/events → events}/marker-activate-event.d.ts +4 -0
- package/{dist/npm/events → events}/marker-click-event.d.ts +4 -0
- package/{dist/npm/events → events}/marker-created-event.d.ts +4 -0
- package/{dist/es/events → events}/pan-end-event.d.ts +4 -0
- package/{dist/es/events → events}/pan-event.d.ts +4 -0
- package/{dist/es/events → events}/preventable-event.d.ts +4 -0
- package/{dist/es/events → events}/reset-event.d.ts +4 -0
- package/{dist/npm/events → events}/shape-click-event.d.ts +4 -0
- package/{dist/npm/events → events}/shape-created-event.d.ts +4 -0
- package/{dist/es/events → events}/shape-feature-created-event.d.ts +4 -0
- package/{dist/es/events → events}/shape-mouse-enter-event.d.ts +4 -0
- package/{dist/npm/events → events}/shape-mouse-leave-event.d.ts +4 -0
- package/{dist/es/events → events}/zoom-end-event.d.ts +4 -0
- package/{dist/npm/events → events}/zoom-start-event.d.ts +4 -0
- package/index.d.ts +13 -0
- package/index.js +5 -0
- package/index.mjs +803 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +29 -40
- package/store/reducer.d.ts +14 -0
- package/{dist/npm/store → store}/store.d.ts +4 -0
- package/{dist/npm/tooltip → tooltip}/BubbleTooltipContext.d.ts +5 -1
- package/{dist/npm/tooltip → tooltip}/MapTooltip.d.ts +6 -2
- package/{dist/npm/tooltip → tooltip}/MarkerTooltipContext.d.ts +5 -1
- package/{dist/es/tooltip → tooltip}/Popup.d.ts +5 -1
- package/tooltip/ShapeTooltipContext.d.ts +22 -0
- package/tooltip/index.d.ts +9 -0
- package/utils/index.d.ts +13 -0
- package/about.md +0 -3
- package/dist/es/Map.js +0 -469
- package/dist/es/MapContext.d.ts +0 -15
- package/dist/es/MapContext.js +0 -6
- package/dist/es/MapProps.js +0 -1
- package/dist/es/common/events.js +0 -16
- package/dist/es/common/map-types.d.ts +0 -1
- package/dist/es/common/map-types.js +0 -2
- package/dist/es/components/BubbleLayer.js +0 -25
- package/dist/es/components/BubbleLayerTooltip.js +0 -17
- package/dist/es/components/Layers.d.ts +0 -9
- package/dist/es/components/Layers.js +0 -21
- package/dist/es/components/MarkerLayer.js +0 -25
- package/dist/es/components/MarkerLayerTooltip.js +0 -17
- package/dist/es/components/ShapeLayer.d.ts +0 -10
- package/dist/es/components/ShapeLayer.js +0 -25
- package/dist/es/components/ShapeLayerTooltip.d.ts +0 -15
- package/dist/es/components/ShapeLayerTooltip.js +0 -17
- package/dist/es/components/TileLayer.d.ts +0 -9
- package/dist/es/components/TileLayer.js +0 -18
- package/dist/es/components/base/CollectionConfigurationComponent.d.ts +0 -19
- package/dist/es/components/base/CollectionConfigurationComponent.js +0 -63
- package/dist/es/components/base/ConfigurationComponent.js +0 -86
- package/dist/es/components/main.d.ts +0 -9
- package/dist/es/components/main.js +0 -9
- package/dist/es/defaults.d.ts +0 -1
- package/dist/es/defaults.js +0 -15
- package/dist/es/events/base-event.d.ts +0 -14
- package/dist/es/events/base-event.js +0 -13
- package/dist/es/events/before-reset-event.d.ts +0 -12
- package/dist/es/events/before-reset-event.js +0 -30
- package/dist/es/events/dom-event.d.ts +0 -23
- package/dist/es/events/dom-event.js +0 -21
- package/dist/es/events/map-click-event.d.ts +0 -20
- package/dist/es/events/map-click-event.js +0 -33
- package/dist/es/events/map-event-builder.d.ts +0 -6
- package/dist/es/events/map-event-builder.js +0 -27
- package/dist/es/events/marker-activate-event.d.ts +0 -20
- package/dist/es/events/marker-activate-event.js +0 -33
- package/dist/es/events/marker-click-event.d.ts +0 -20
- package/dist/es/events/marker-click-event.js +0 -33
- package/dist/es/events/marker-created-event.d.ts +0 -22
- package/dist/es/events/marker-created-event.js +0 -35
- package/dist/es/events/pan-end-event.js +0 -34
- package/dist/es/events/pan-event.js +0 -34
- package/dist/es/events/preventable-event.js +0 -46
- package/dist/es/events/reset-event.js +0 -32
- package/dist/es/events/shape-click-event.d.ts +0 -25
- package/dist/es/events/shape-click-event.js +0 -34
- package/dist/es/events/shape-created-event.d.ts +0 -29
- package/dist/es/events/shape-created-event.js +0 -38
- package/dist/es/events/shape-feature-created-event.js +0 -35
- package/dist/es/events/shape-mouse-enter-event.js +0 -37
- package/dist/es/events/shape-mouse-leave-event.d.ts +0 -28
- package/dist/es/events/shape-mouse-leave-event.js +0 -37
- package/dist/es/events/zoom-end-event.js +0 -32
- package/dist/es/events/zoom-start-event.d.ts +0 -18
- package/dist/es/events/zoom-start-event.js +0 -34
- package/dist/es/main.d.ts +0 -9
- package/dist/es/main.js +0 -8
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/store/reducer.d.ts +0 -10
- package/dist/es/store/reducer.js +0 -84
- package/dist/es/store/store.d.ts +0 -22
- package/dist/es/store/store.js +0 -22
- package/dist/es/tooltip/BubbleTooltipContext.d.ts +0 -22
- package/dist/es/tooltip/BubbleTooltipContext.js +0 -1
- package/dist/es/tooltip/MapTooltip.d.ts +0 -37
- package/dist/es/tooltip/MapTooltip.js +0 -123
- package/dist/es/tooltip/MarkerTooltipContext.d.ts +0 -22
- package/dist/es/tooltip/MarkerTooltipContext.js +0 -1
- package/dist/es/tooltip/Popup.js +0 -76
- package/dist/es/tooltip/ShapeTooltipContext.d.ts +0 -18
- package/dist/es/tooltip/ShapeTooltipContext.js +0 -1
- package/dist/es/tooltip/main.d.ts +0 -5
- package/dist/es/tooltip/main.js +0 -2
- package/dist/es/utils/main.d.ts +0 -10
- package/dist/es/utils/main.js +0 -28
- package/dist/npm/Map.d.ts +0 -189
- package/dist/npm/Map.js +0 -472
- package/dist/npm/MapContext.js +0 -9
- package/dist/npm/MapProps.d.ts +0 -100
- package/dist/npm/MapProps.js +0 -2
- package/dist/npm/common/events.d.ts +0 -15
- package/dist/npm/common/events.js +0 -34
- package/dist/npm/common/map-types.d.ts +0 -1
- package/dist/npm/common/map-types.js +0 -7
- package/dist/npm/components/BubbleLayer.d.ts +0 -10
- package/dist/npm/components/BubbleLayer.js +0 -28
- package/dist/npm/components/BubbleLayerTooltip.d.ts +0 -15
- package/dist/npm/components/BubbleLayerTooltip.js +0 -20
- package/dist/npm/components/Layers.d.ts +0 -9
- package/dist/npm/components/Layers.js +0 -24
- package/dist/npm/components/MarkerLayer.d.ts +0 -10
- package/dist/npm/components/MarkerLayer.js +0 -28
- package/dist/npm/components/MarkerLayerTooltip.d.ts +0 -15
- package/dist/npm/components/MarkerLayerTooltip.js +0 -20
- package/dist/npm/components/ShapeLayer.js +0 -28
- package/dist/npm/components/ShapeLayerTooltip.js +0 -20
- package/dist/npm/components/TileLayer.d.ts +0 -9
- package/dist/npm/components/TileLayer.js +0 -21
- package/dist/npm/components/base/CollectionConfigurationComponent.js +0 -65
- package/dist/npm/components/base/ConfigurationComponent.d.ts +0 -24
- package/dist/npm/components/base/ConfigurationComponent.js +0 -88
- package/dist/npm/components/main.d.ts +0 -9
- package/dist/npm/components/main.js +0 -19
- package/dist/npm/defaults.d.ts +0 -1
- package/dist/npm/defaults.js +0 -17
- package/dist/npm/events/base-event.d.ts +0 -14
- package/dist/npm/events/base-event.js +0 -16
- package/dist/npm/events/before-reset-event.js +0 -33
- package/dist/npm/events/dom-event.js +0 -24
- package/dist/npm/events/map-click-event.js +0 -36
- package/dist/npm/events/map-event-builder.d.ts +0 -6
- package/dist/npm/events/map-event-builder.js +0 -30
- package/dist/npm/events/marker-activate-event.js +0 -36
- package/dist/npm/events/marker-click-event.js +0 -36
- package/dist/npm/events/marker-created-event.js +0 -38
- package/dist/npm/events/pan-end-event.d.ts +0 -24
- package/dist/npm/events/pan-end-event.js +0 -37
- package/dist/npm/events/pan-event.d.ts +0 -24
- package/dist/npm/events/pan-event.js +0 -37
- package/dist/npm/events/preventable-event.d.ts +0 -18
- package/dist/npm/events/preventable-event.js +0 -49
- package/dist/npm/events/reset-event.d.ts +0 -14
- package/dist/npm/events/reset-event.js +0 -35
- package/dist/npm/events/shape-click-event.js +0 -37
- package/dist/npm/events/shape-created-event.js +0 -41
- package/dist/npm/events/shape-feature-created-event.d.ts +0 -29
- package/dist/npm/events/shape-feature-created-event.js +0 -38
- package/dist/npm/events/shape-mouse-enter-event.d.ts +0 -28
- package/dist/npm/events/shape-mouse-enter-event.js +0 -40
- package/dist/npm/events/shape-mouse-leave-event.js +0 -40
- package/dist/npm/events/zoom-end-event.d.ts +0 -16
- package/dist/npm/events/zoom-end-event.js +0 -35
- package/dist/npm/events/zoom-start-event.js +0 -37
- package/dist/npm/main.d.ts +0 -9
- package/dist/npm/main.js +0 -27
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/store/reducer.d.ts +0 -10
- package/dist/npm/store/reducer.js +0 -88
- package/dist/npm/store/store.js +0 -24
- package/dist/npm/tooltip/BubbleTooltipContext.js +0 -2
- package/dist/npm/tooltip/MapTooltip.js +0 -126
- package/dist/npm/tooltip/MarkerTooltipContext.js +0 -2
- package/dist/npm/tooltip/Popup.d.ts +0 -29
- package/dist/npm/tooltip/Popup.js +0 -79
- package/dist/npm/tooltip/ShapeTooltipContext.d.ts +0 -18
- package/dist/npm/tooltip/ShapeTooltipContext.js +0 -2
- package/dist/npm/tooltip/main.d.ts +0 -5
- package/dist/npm/tooltip/main.js +0 -5
- package/dist/npm/utils/main.d.ts +0 -10
- package/dist/npm/utils/main.js +0 -32
- package/dist/systemjs/kendo-react-map.js +0 -1
- package/e2e-next/basic.tests.ts +0 -24
package/dist/es/store/store.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { canUseDOM } from '@progress/kendo-react-common';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
var createStore = function (reducer) {
|
|
6
|
-
var state;
|
|
7
|
-
var listeners = [];
|
|
8
|
-
var getState = function () { return state; };
|
|
9
|
-
var dispatch = function (action) {
|
|
10
|
-
state = reducer(state, action);
|
|
11
|
-
if (canUseDOM) {
|
|
12
|
-
listeners.forEach(function (l) { return l(); });
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var subscribe = function (listener) {
|
|
16
|
-
listeners.push(listener);
|
|
17
|
-
return function () { return listeners = listeners.filter(function (l) { return l !== listener; }); };
|
|
18
|
-
};
|
|
19
|
-
dispatch({});
|
|
20
|
-
return { getState: getState, dispatch: dispatch, subscribe: subscribe };
|
|
21
|
-
};
|
|
22
|
-
export default createStore;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Location } from '../main';
|
|
2
|
-
/**
|
|
3
|
-
* Context object for bubble layer tooltips.
|
|
4
|
-
*/
|
|
5
|
-
export interface BubbleTooltipContext {
|
|
6
|
-
/**
|
|
7
|
-
* The original data item used to create the bubble.
|
|
8
|
-
*/
|
|
9
|
-
dataItem: any;
|
|
10
|
-
/**
|
|
11
|
-
* The index of the bubble layer in the map.
|
|
12
|
-
*/
|
|
13
|
-
layerIndex: number;
|
|
14
|
-
/**
|
|
15
|
-
* The location of the bubble.
|
|
16
|
-
*/
|
|
17
|
-
location: Location;
|
|
18
|
-
/**
|
|
19
|
-
* The numerical value of the bubble
|
|
20
|
-
*/
|
|
21
|
-
value: number;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Align, Offset } from '@progress/kendo-react-popup';
|
|
3
|
-
import { InstanceObserver } from '@progress/kendo-charts';
|
|
4
|
-
import { MarkerTooltipContext } from './MarkerTooltipContext';
|
|
5
|
-
import { ShapeTooltipContext } from './ShapeTooltipContext';
|
|
6
|
-
import { BubbleTooltipContext } from './BubbleTooltipContext';
|
|
7
|
-
import { MapContext } from '../MapContext';
|
|
8
|
-
declare type TooltipContext = MarkerTooltipContext | ShapeTooltipContext | BubbleTooltipContext;
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export interface MapTooltipState {
|
|
13
|
-
className?: string | undefined;
|
|
14
|
-
popupShown: boolean;
|
|
15
|
-
popupAlign?: Align;
|
|
16
|
-
popupOffset?: Offset;
|
|
17
|
-
popupStyles?: any;
|
|
18
|
-
popupContext?: TooltipContext;
|
|
19
|
-
shared?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
export declare class MapTooltip extends React.Component<{}, MapTooltipState> {
|
|
25
|
-
static contextType: React.Context<import("../MapContext").MapContextType | null>;
|
|
26
|
-
context: React.ContextType<typeof MapContext>;
|
|
27
|
-
readonly state: MapTooltipState;
|
|
28
|
-
mapObserver?: InstanceObserver;
|
|
29
|
-
componentDidMount(): void;
|
|
30
|
-
render(): JSX.Element | null;
|
|
31
|
-
componentWillUnmount(): void;
|
|
32
|
-
onShowTooltip(e: any): void;
|
|
33
|
-
onHideTooltip(): void;
|
|
34
|
-
createTooltipContext(e: any): TooltipContext;
|
|
35
|
-
findRenderFunctionByLayer(layerIndex: number): any;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
};
|
|
38
|
-
import * as React from 'react';
|
|
39
|
-
import { InstanceObserver } from '@progress/kendo-charts';
|
|
40
|
-
import { TooltipPopup } from './Popup';
|
|
41
|
-
import { MapContext } from '../MapContext';
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
var MapTooltip = /** @class */ (function (_super) {
|
|
46
|
-
__extends(MapTooltip, _super);
|
|
47
|
-
function MapTooltip() {
|
|
48
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
49
|
-
_this.context = null;
|
|
50
|
-
_this.state = {
|
|
51
|
-
popupShown: false
|
|
52
|
-
};
|
|
53
|
-
return _this;
|
|
54
|
-
}
|
|
55
|
-
MapTooltip.prototype.componentDidMount = function () {
|
|
56
|
-
this.mapObserver = new InstanceObserver(this, {
|
|
57
|
-
showTooltip: 'onShowTooltip',
|
|
58
|
-
hideTooltip: 'onHideTooltip'
|
|
59
|
-
});
|
|
60
|
-
this.context.observersStore.dispatch({
|
|
61
|
-
type: 'add',
|
|
62
|
-
payload: this.mapObserver
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
MapTooltip.prototype.render = function () {
|
|
66
|
-
var _a = this.state, popupContext = _a.popupContext, shared = _a.shared, className = _a.className, tooltipProps = __rest(_a, ["popupContext", "shared", "className"]);
|
|
67
|
-
if (!popupContext || !this.state.popupShown) {
|
|
68
|
-
// Popup closed.
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
var layerIndex = popupContext.layerIndex;
|
|
72
|
-
var render = this.findRenderFunctionByLayer(layerIndex);
|
|
73
|
-
if (!render) {
|
|
74
|
-
// No renderer set for layer tooltip.
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
var tooltipContent = function () { return (React.createElement("div", { className: "k-tooltip-content" }, render(popupContext))); };
|
|
78
|
-
var popupContainerClassName = "k-map-".concat(popupContext.type, "-tooltip");
|
|
79
|
-
return (React.createElement(TooltipPopup, __assign({}, tooltipProps, { popupContent: tooltipContent, className: popupContainerClassName })));
|
|
80
|
-
};
|
|
81
|
-
MapTooltip.prototype.componentWillUnmount = function () {
|
|
82
|
-
this.context.observersStore.dispatch({
|
|
83
|
-
type: 'remove',
|
|
84
|
-
payload: this.mapObserver
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
MapTooltip.prototype.onShowTooltip = function (e) {
|
|
88
|
-
var anchor = e.anchor, className = e.className;
|
|
89
|
-
var context = this.createTooltipContext(e);
|
|
90
|
-
this.setState({
|
|
91
|
-
popupShown: true,
|
|
92
|
-
popupAlign: { vertical: 'bottom', horizontal: 'center' },
|
|
93
|
-
popupOffset: anchor,
|
|
94
|
-
popupContext: context,
|
|
95
|
-
popupStyles: { position: 'relative' },
|
|
96
|
-
className: className
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
MapTooltip.prototype.onHideTooltip = function () {
|
|
100
|
-
this.setState({
|
|
101
|
-
popupShown: false,
|
|
102
|
-
popupStyles: {},
|
|
103
|
-
className: undefined
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
MapTooltip.prototype.createTooltipContext = function (e) {
|
|
107
|
-
return e;
|
|
108
|
-
};
|
|
109
|
-
MapTooltip.prototype.findRenderFunctionByLayer = function (layerIndex) {
|
|
110
|
-
var layers = this.context.optionsStore.getState().layers;
|
|
111
|
-
if (layers !== undefined
|
|
112
|
-
&& Array.isArray(layers)
|
|
113
|
-
&& layers[layerIndex] !== undefined
|
|
114
|
-
&& layers[layerIndex].hasOwnProperty('tooltip')
|
|
115
|
-
&& layers[layerIndex].tooltip.hasOwnProperty('render')) {
|
|
116
|
-
return layers[layerIndex].tooltip.render;
|
|
117
|
-
}
|
|
118
|
-
return null;
|
|
119
|
-
};
|
|
120
|
-
MapTooltip.contextType = MapContext;
|
|
121
|
-
return MapTooltip;
|
|
122
|
-
}(React.Component));
|
|
123
|
-
export { MapTooltip };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Location } from '../main';
|
|
2
|
-
/**
|
|
3
|
-
* Context object for marker tooltips.
|
|
4
|
-
*/
|
|
5
|
-
export interface MarkerTooltipContext {
|
|
6
|
-
/**
|
|
7
|
-
* The original data item used to create the marker.
|
|
8
|
-
*/
|
|
9
|
-
dataItem: any;
|
|
10
|
-
/**
|
|
11
|
-
* The index of the marker layer in the map.
|
|
12
|
-
*/
|
|
13
|
-
layerIndex: number;
|
|
14
|
-
/**
|
|
15
|
-
* The location of the marker.
|
|
16
|
-
*/
|
|
17
|
-
location: Location;
|
|
18
|
-
/**
|
|
19
|
-
* The title of the marker.
|
|
20
|
-
*/
|
|
21
|
-
title: string;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/es/tooltip/Popup.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
17
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
18
|
-
if (ar || !(i in from)) {
|
|
19
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
20
|
-
ar[i] = from[i];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
24
|
-
};
|
|
25
|
-
import * as React from 'react';
|
|
26
|
-
import { InstanceObserver } from '@progress/kendo-charts';
|
|
27
|
-
import { hasParent } from '../utils/main';
|
|
28
|
-
import { Popup } from '@progress/kendo-react-popup';
|
|
29
|
-
import { MapContext } from '../MapContext';
|
|
30
|
-
var COLLISION = { horizontal: 'fit', vertical: 'fit' };
|
|
31
|
-
var TOOLTIP_CLASSES = ['k-tooltip', 'k-map-tooltip'];
|
|
32
|
-
var POPUP_WRAPPER_CLASS = 'k-tooltip-wrapper';
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
var TooltipPopup = /** @class */ (function (_super) {
|
|
37
|
-
__extends(TooltipPopup, _super);
|
|
38
|
-
function TooltipPopup(props, context) {
|
|
39
|
-
var _this = _super.call(this, props, context) || this;
|
|
40
|
-
_this.context = null;
|
|
41
|
-
_this.element = null;
|
|
42
|
-
_this.onMapMouseLeave = function (e) {
|
|
43
|
-
var syntheticEvent = e.syntheticEvent;
|
|
44
|
-
if (hasParent(syntheticEvent.relatedTarget, _this.element)) {
|
|
45
|
-
/* prevent default behavior so that the tooltip won't be hidden */
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
};
|
|
50
|
-
_this.mapObserver = new InstanceObserver(_this, {
|
|
51
|
-
onMouseLeave: 'onMapMouseLeave'
|
|
52
|
-
});
|
|
53
|
-
context.observersStore.dispatch({
|
|
54
|
-
type: 'add',
|
|
55
|
-
payload: _this.mapObserver
|
|
56
|
-
});
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
TooltipPopup.prototype.render = function () {
|
|
60
|
-
var _this = this;
|
|
61
|
-
var _a = this.props, popupShown = _a.popupShown, popupAlign = _a.popupAlign, popupOffset = _a.popupOffset, popupStyles = _a.popupStyles, popupContent = _a.popupContent, className = _a.className;
|
|
62
|
-
var wrapperClass = __spreadArray(__spreadArray([], TOOLTIP_CLASSES, true), [className], false).join(' ').trim();
|
|
63
|
-
var popupComponent = (React.createElement(Popup, { animate: true, popupAlign: popupAlign, offset: popupOffset, show: popupShown, collision: COLLISION, className: POPUP_WRAPPER_CLASS },
|
|
64
|
-
React.createElement("div", { className: wrapperClass, style: popupStyles, ref: function (el) { return _this.element = el; } }, popupContent())));
|
|
65
|
-
return popupComponent;
|
|
66
|
-
};
|
|
67
|
-
TooltipPopup.prototype.componentWillUnmount = function () {
|
|
68
|
-
this.context.observersStore.dispatch({
|
|
69
|
-
type: 'remove',
|
|
70
|
-
payload: this.mapObserver
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
TooltipPopup.contextType = MapContext;
|
|
74
|
-
return TooltipPopup;
|
|
75
|
-
}(React.Component));
|
|
76
|
-
export { TooltipPopup };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Location } from '../main';
|
|
2
|
-
/**
|
|
3
|
-
* Context object for shape layer tooltips.
|
|
4
|
-
*/
|
|
5
|
-
export interface ShapeTooltipContext {
|
|
6
|
-
/**
|
|
7
|
-
* The original GeoJSON data item used to create the shape.
|
|
8
|
-
*/
|
|
9
|
-
dataItem: any;
|
|
10
|
-
/**
|
|
11
|
-
* The index of the shape layer in the map.
|
|
12
|
-
*/
|
|
13
|
-
layerIndex: number;
|
|
14
|
-
/**
|
|
15
|
-
* The location (center point) of the shape.
|
|
16
|
-
*/
|
|
17
|
-
location: Location;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { MapTooltip } from './MapTooltip';
|
|
2
|
-
import { MarkerTooltipContext } from './MarkerTooltipContext';
|
|
3
|
-
import { BubbleTooltipContext } from './BubbleTooltipContext';
|
|
4
|
-
import { ShapeTooltipContext } from './ShapeTooltipContext';
|
|
5
|
-
export { BubbleTooltipContext, MarkerTooltipContext, MapTooltip, ShapeTooltipContext };
|
package/dist/es/tooltip/main.js
DELETED
package/dist/es/utils/main.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
*/
|
|
5
|
-
declare function hasParent(element: any, parent: any): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
declare function validateChildren<P>(props: P, propName: string, componentName: string, childType: React.FunctionComponent): Error | null;
|
|
10
|
-
export { hasParent, validateChildren };
|
package/dist/es/utils/main.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
function hasParent(element, parent) {
|
|
5
|
-
var current = element;
|
|
6
|
-
while (current && current !== parent) {
|
|
7
|
-
current = current.parentNode;
|
|
8
|
-
}
|
|
9
|
-
return current ? true : false;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
function validateChildren(props, propName, componentName, childType) {
|
|
15
|
-
var prop = props[propName];
|
|
16
|
-
if (prop) {
|
|
17
|
-
if (Array.isArray(prop)) {
|
|
18
|
-
for (var _i = 0, prop_1 = prop; _i < prop_1.length; _i++) {
|
|
19
|
-
var value = prop_1[_i];
|
|
20
|
-
if (!value.type || value.type !== childType) {
|
|
21
|
-
return new Error("".concat(componentName, " children should be Array of type ").concat(childType.displayName, "."));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
export { hasParent, validateChildren };
|
package/dist/npm/Map.d.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { InstanceObserver, Map as KendoMap } from '@progress/kendo-charts';
|
|
4
|
-
import './defaults';
|
|
5
|
-
import { MapProps } from './MapProps';
|
|
6
|
-
import { MapContextType } from './MapContext';
|
|
7
|
-
import { DomEvent } from './events/dom-event';
|
|
8
|
-
import { geometry } from '@progress/kendo-drawing';
|
|
9
|
-
import { Extent, Location, MapLayer } from './common/map-types';
|
|
10
|
-
/**
|
|
11
|
-
* Represents the [KendoReact Map component]({% slug overview_map %}).
|
|
12
|
-
*/
|
|
13
|
-
export declare class Map extends React.Component<MapProps, {}> {
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
static propTypes: {
|
|
18
|
-
dir: PropTypes.Requireable<string>;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* @hidden
|
|
22
|
-
*/
|
|
23
|
-
static defaultProps: {};
|
|
24
|
-
/**
|
|
25
|
-
* @hidden
|
|
26
|
-
*/
|
|
27
|
-
mapInstance: KendoMap | null;
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
get element(): HTMLDivElement;
|
|
32
|
-
protected _element: HTMLDivElement | null;
|
|
33
|
-
protected optionsStore: any;
|
|
34
|
-
protected optionsUnsubscriber: Function;
|
|
35
|
-
protected observersStore: any;
|
|
36
|
-
protected mapObserver: InstanceObserver;
|
|
37
|
-
protected childrenObserver: InstanceObserver;
|
|
38
|
-
protected contextValue: MapContextType;
|
|
39
|
-
constructor(props: MapProps);
|
|
40
|
-
private iconsType;
|
|
41
|
-
private svgIcons;
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
componentDidMount(): void;
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
componentWillUnmount(): void;
|
|
50
|
-
/**
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
componentDidUpdate(prevProps: MapProps): void;
|
|
54
|
-
/**
|
|
55
|
-
* @hidden
|
|
56
|
-
*/
|
|
57
|
-
render(): any;
|
|
58
|
-
/**
|
|
59
|
-
* @hidden
|
|
60
|
-
*/
|
|
61
|
-
getMapOptions(): any;
|
|
62
|
-
/**
|
|
63
|
-
* The marker layers instances.
|
|
64
|
-
*/
|
|
65
|
-
get layers(): MapLayer[];
|
|
66
|
-
/**
|
|
67
|
-
* Gets the extent (visible area) of the map.
|
|
68
|
-
*/
|
|
69
|
-
get extent(): Extent | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* Sets the extent (visible area) of the map.
|
|
72
|
-
*/
|
|
73
|
-
set extent(extent: Extent | undefined);
|
|
74
|
-
/**
|
|
75
|
-
* Detects the size of the container and redraws the Map.
|
|
76
|
-
* Resizing is automatic unless you set the `resizeRateLimit` option to `0`.
|
|
77
|
-
*/
|
|
78
|
-
resize(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Retrieves the size of the visible portion of the map.
|
|
81
|
-
*
|
|
82
|
-
* @returns The size (width and height) of the visible portion of the map.
|
|
83
|
-
*/
|
|
84
|
-
viewSize(): {
|
|
85
|
-
width: number;
|
|
86
|
-
height: number;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Returns the event coordinates relative to the map element. Offset coordinates are not synchronized to a particular location on the map.
|
|
90
|
-
*
|
|
91
|
-
* @param e The mouse event.
|
|
92
|
-
* @returns The event coordinates relative to the map element.
|
|
93
|
-
*/
|
|
94
|
-
eventOffset(e: any): geometry.Point | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* Retrieves projected (layer) coordinates that correspond to this mouse event.
|
|
97
|
-
* Layer coordinates are absolute and change only when the zoom level is changed.
|
|
98
|
-
*
|
|
99
|
-
* @param e The mouse event.
|
|
100
|
-
* @returns The projected (layer) coordinates that correspond to this event.
|
|
101
|
-
*/
|
|
102
|
-
eventToLayer(e: any): geometry.Point | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* Retrieves the geographic location that correspond to this mouse event.
|
|
105
|
-
*
|
|
106
|
-
* @param e The mouse event.
|
|
107
|
-
* @returns The geographic location that correspond to this mouse event.
|
|
108
|
-
*/
|
|
109
|
-
eventToLocation(e: any): geometry.Point | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Retrieves relative (view) coordinates that correspond to this mouse event.
|
|
112
|
-
* Layer elements positioned on these coordinates will appear under the mouse cursor.
|
|
113
|
-
* View coordinates are no longer valid after a map reset.
|
|
114
|
-
*
|
|
115
|
-
* @param e The mouse event.
|
|
116
|
-
* @returns The relative (view) coordinates that correspond to this mouse event.
|
|
117
|
-
*/
|
|
118
|
-
eventToView(e: any): geometry.Point | undefined;
|
|
119
|
-
/**
|
|
120
|
-
* Transforms layer (projected) coordinates to geographical location.
|
|
121
|
-
*
|
|
122
|
-
* @param point The layer (projected) coordinates. An array argument is assumed to be in x, y order.
|
|
123
|
-
* @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
|
|
124
|
-
* @returns The geographic location that corresponds to the layer coordinates.
|
|
125
|
-
*/
|
|
126
|
-
layerToLocation(point: geometry.Point | number[], zoom?: number): Location | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* Returns the layer (projected) coordinates that correspond to a geographical location.
|
|
129
|
-
*
|
|
130
|
-
* @param location The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.
|
|
131
|
-
* @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
|
|
132
|
-
* @returns The layer (projected) coordinates.
|
|
133
|
-
*/
|
|
134
|
-
locationToLayer(location: Location | number[], zoom?: number): geometry.Point | undefined;
|
|
135
|
-
/**
|
|
136
|
-
* Returns the view (relative) coordinates that correspond to a geographical location.
|
|
137
|
-
*
|
|
138
|
-
* @param location The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.
|
|
139
|
-
* @returns The view coordinates that correspond to a geographical location.
|
|
140
|
-
*/
|
|
141
|
-
locationToView(location: Location | number[]): geometry.Point | undefined;
|
|
142
|
-
/**
|
|
143
|
-
* Returns the geographical location that correspond to the view (relative) coordinates.
|
|
144
|
-
*
|
|
145
|
-
* @param point The view coordinates. An array argument is assumed to be in x, y order.
|
|
146
|
-
* @param zoom Optional. Assumed zoom level. Defaults to the current zoom level.
|
|
147
|
-
* @returns The geographic location that corresponds to the view coordinates.
|
|
148
|
-
*/
|
|
149
|
-
viewToLocation(point: geometry.Point | number[], zoom?: number): Location | undefined;
|
|
150
|
-
/**
|
|
151
|
-
* Load markers in the Map. This method will clear the current markers and show the new ones.
|
|
152
|
-
*
|
|
153
|
-
* @param newMarkers An array of markers.
|
|
154
|
-
*/
|
|
155
|
-
loadMarkers(newMarkers: any[]): void;
|
|
156
|
-
/**
|
|
157
|
-
* @hidden
|
|
158
|
-
*/
|
|
159
|
-
refresh(): void;
|
|
160
|
-
/**
|
|
161
|
-
* @hidden
|
|
162
|
-
*/
|
|
163
|
-
instantiateCoreMap(): void;
|
|
164
|
-
/**
|
|
165
|
-
* @hidden
|
|
166
|
-
*/
|
|
167
|
-
trigger(name: string, e: any): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* @hidden
|
|
170
|
-
*/
|
|
171
|
-
requiresHandlers(names: string[]): boolean;
|
|
172
|
-
/**
|
|
173
|
-
* @hidden
|
|
174
|
-
*/
|
|
175
|
-
triggerDomEvent<T>(name: string, e: DomEvent<T>): boolean;
|
|
176
|
-
/**
|
|
177
|
-
* @hidden
|
|
178
|
-
*/
|
|
179
|
-
onInit: (e: any) => void;
|
|
180
|
-
/**
|
|
181
|
-
* @hidden
|
|
182
|
-
*/
|
|
183
|
-
onRender: (e: any) => void;
|
|
184
|
-
/**
|
|
185
|
-
* @hidden
|
|
186
|
-
*/
|
|
187
|
-
onMapMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
188
|
-
private setIcons;
|
|
189
|
-
}
|