@progress/kendo-react-map 5.3.0-dev.202205051853
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 +11 -0
- package/NOTICE.txt +111 -0
- package/README.md +47 -0
- package/about.md +3 -0
- package/dist/cdn/js/kendo-react-map.js +1 -0
- package/dist/es/Map.d.ts +81 -0
- package/dist/es/Map.js +235 -0
- package/dist/es/MapContext.d.ts +15 -0
- package/dist/es/MapContext.js +6 -0
- package/dist/es/MapProps.d.ts +96 -0
- package/dist/es/MapProps.js +0 -0
- package/dist/es/common/events.d.ts +15 -0
- package/dist/es/common/events.js +16 -0
- package/dist/es/common/map-types.d.ts +1 -0
- package/dist/es/common/map-types.js +2 -0
- package/dist/es/components/BubbleLayer.d.ts +9 -0
- package/dist/es/components/BubbleLayer.js +18 -0
- package/dist/es/components/Layers.d.ts +9 -0
- package/dist/es/components/Layers.js +21 -0
- package/dist/es/components/MarkerLayer.d.ts +9 -0
- package/dist/es/components/MarkerLayer.js +18 -0
- package/dist/es/components/ShapeLayer.d.ts +9 -0
- package/dist/es/components/ShapeLayer.js +18 -0
- package/dist/es/components/TileLayer.d.ts +9 -0
- package/dist/es/components/TileLayer.js +18 -0
- package/dist/es/components/base/CollectionConfigurationComponent.d.ts +19 -0
- package/dist/es/components/base/CollectionConfigurationComponent.js +61 -0
- package/dist/es/components/base/ConfigurationComponent.d.ts +24 -0
- package/dist/es/components/base/ConfigurationComponent.js +82 -0
- package/dist/es/components/main.d.ts +6 -0
- package/dist/es/components/main.js +6 -0
- package/dist/es/defaults.d.ts +1 -0
- package/dist/es/defaults.js +15 -0
- package/dist/es/events/base-event.d.ts +14 -0
- package/dist/es/events/base-event.js +13 -0
- package/dist/es/events/before-reset-event.d.ts +12 -0
- package/dist/es/events/before-reset-event.js +28 -0
- package/dist/es/events/map-click-event.d.ts +20 -0
- package/dist/es/events/map-click-event.js +31 -0
- package/dist/es/events/map-event-builder.d.ts +6 -0
- package/dist/es/events/map-event-builder.js +27 -0
- package/dist/es/events/marker-activate-event.d.ts +20 -0
- package/dist/es/events/marker-activate-event.js +31 -0
- package/dist/es/events/marker-click-event.d.ts +20 -0
- package/dist/es/events/marker-click-event.js +31 -0
- package/dist/es/events/marker-created-event.d.ts +22 -0
- package/dist/es/events/marker-created-event.js +33 -0
- package/dist/es/events/pan-end-event.d.ts +24 -0
- package/dist/es/events/pan-end-event.js +32 -0
- package/dist/es/events/pan-event.d.ts +24 -0
- package/dist/es/events/pan-event.js +32 -0
- package/dist/es/events/preventable-event.d.ts +18 -0
- package/dist/es/events/preventable-event.js +44 -0
- package/dist/es/events/reset-event.d.ts +14 -0
- package/dist/es/events/reset-event.js +30 -0
- package/dist/es/events/shape-click-event.d.ts +25 -0
- package/dist/es/events/shape-click-event.js +32 -0
- package/dist/es/events/shape-created-event.d.ts +29 -0
- package/dist/es/events/shape-created-event.js +35 -0
- package/dist/es/events/shape-feature-created-event.d.ts +29 -0
- package/dist/es/events/shape-feature-created-event.js +33 -0
- package/dist/es/events/shape-mouse-enter-event.d.ts +28 -0
- package/dist/es/events/shape-mouse-enter-event.js +35 -0
- package/dist/es/events/shape-mouse-leave-event.d.ts +28 -0
- package/dist/es/events/shape-mouse-leave-event.js +35 -0
- package/dist/es/events/zoom-end-event.d.ts +16 -0
- package/dist/es/events/zoom-end-event.js +30 -0
- package/dist/es/events/zoom-start-event.d.ts +18 -0
- package/dist/es/events/zoom-start-event.js +32 -0
- package/dist/es/main.d.ts +6 -0
- package/dist/es/main.js +5 -0
- package/dist/es/package-metadata.d.ts +5 -0
- package/dist/es/package-metadata.js +11 -0
- package/dist/es/store/reducer.d.ts +10 -0
- package/dist/es/store/reducer.js +75 -0
- package/dist/es/store/store.d.ts +22 -0
- package/dist/es/store/store.js +22 -0
- package/dist/npm/Map.d.ts +81 -0
- package/dist/npm/Map.js +237 -0
- package/dist/npm/MapContext.d.ts +15 -0
- package/dist/npm/MapContext.js +8 -0
- package/dist/npm/MapProps.d.ts +96 -0
- package/dist/npm/MapProps.js +2 -0
- package/dist/npm/common/events.d.ts +15 -0
- package/dist/npm/common/events.js +33 -0
- package/dist/npm/common/map-types.d.ts +1 -0
- package/dist/npm/common/map-types.js +6 -0
- package/dist/npm/components/BubbleLayer.d.ts +9 -0
- package/dist/npm/components/BubbleLayer.js +20 -0
- package/dist/npm/components/Layers.d.ts +9 -0
- package/dist/npm/components/Layers.js +23 -0
- package/dist/npm/components/MarkerLayer.d.ts +9 -0
- package/dist/npm/components/MarkerLayer.js +20 -0
- package/dist/npm/components/ShapeLayer.d.ts +9 -0
- package/dist/npm/components/ShapeLayer.js +20 -0
- package/dist/npm/components/TileLayer.d.ts +9 -0
- package/dist/npm/components/TileLayer.js +20 -0
- package/dist/npm/components/base/CollectionConfigurationComponent.d.ts +19 -0
- package/dist/npm/components/base/CollectionConfigurationComponent.js +63 -0
- package/dist/npm/components/base/ConfigurationComponent.d.ts +24 -0
- package/dist/npm/components/base/ConfigurationComponent.js +84 -0
- package/dist/npm/components/main.d.ts +6 -0
- package/dist/npm/components/main.js +12 -0
- package/dist/npm/defaults.d.ts +1 -0
- package/dist/npm/defaults.js +17 -0
- package/dist/npm/events/base-event.d.ts +14 -0
- package/dist/npm/events/base-event.js +15 -0
- package/dist/npm/events/before-reset-event.d.ts +12 -0
- package/dist/npm/events/before-reset-event.js +30 -0
- package/dist/npm/events/map-click-event.d.ts +20 -0
- package/dist/npm/events/map-click-event.js +33 -0
- package/dist/npm/events/map-event-builder.d.ts +6 -0
- package/dist/npm/events/map-event-builder.js +29 -0
- package/dist/npm/events/marker-activate-event.d.ts +20 -0
- package/dist/npm/events/marker-activate-event.js +33 -0
- package/dist/npm/events/marker-click-event.d.ts +20 -0
- package/dist/npm/events/marker-click-event.js +33 -0
- package/dist/npm/events/marker-created-event.d.ts +22 -0
- package/dist/npm/events/marker-created-event.js +35 -0
- package/dist/npm/events/pan-end-event.d.ts +24 -0
- package/dist/npm/events/pan-end-event.js +34 -0
- package/dist/npm/events/pan-event.d.ts +24 -0
- package/dist/npm/events/pan-event.js +34 -0
- package/dist/npm/events/preventable-event.d.ts +18 -0
- package/dist/npm/events/preventable-event.js +46 -0
- package/dist/npm/events/reset-event.d.ts +14 -0
- package/dist/npm/events/reset-event.js +32 -0
- package/dist/npm/events/shape-click-event.d.ts +25 -0
- package/dist/npm/events/shape-click-event.js +34 -0
- package/dist/npm/events/shape-created-event.d.ts +29 -0
- package/dist/npm/events/shape-created-event.js +37 -0
- package/dist/npm/events/shape-feature-created-event.d.ts +29 -0
- package/dist/npm/events/shape-feature-created-event.js +35 -0
- package/dist/npm/events/shape-mouse-enter-event.d.ts +28 -0
- package/dist/npm/events/shape-mouse-enter-event.js +37 -0
- package/dist/npm/events/shape-mouse-leave-event.d.ts +28 -0
- package/dist/npm/events/shape-mouse-leave-event.js +37 -0
- package/dist/npm/events/zoom-end-event.d.ts +16 -0
- package/dist/npm/events/zoom-end-event.js +32 -0
- package/dist/npm/events/zoom-start-event.d.ts +18 -0
- package/dist/npm/events/zoom-start-event.js +34 -0
- package/dist/npm/main.d.ts +6 -0
- package/dist/npm/main.js +10 -0
- package/dist/npm/package-metadata.d.ts +5 -0
- package/dist/npm/package-metadata.js +13 -0
- package/dist/npm/store/reducer.d.ts +10 -0
- package/dist/npm/store/reducer.js +78 -0
- package/dist/npm/store/store.d.ts +22 -0
- package/dist/npm/store/store.js +24 -0
- package/dist/systemjs/kendo-react-map.js +1 -0
- package/package.json +61 -0
package/dist/es/Map.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Represents the [KendoReact Map component]({% slug overview_map %}).
|
|
9
|
+
*/
|
|
10
|
+
export declare class Map extends React.Component<MapProps, {}> {
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
static propTypes: {
|
|
15
|
+
dir: PropTypes.Requireable<string>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
static defaultProps: {};
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
mapInstance: KendoMap | null;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
readonly element: HTMLDivElement;
|
|
29
|
+
protected _element: HTMLDivElement | null;
|
|
30
|
+
protected optionsStore: any;
|
|
31
|
+
protected optionsUnsubscriber: Function;
|
|
32
|
+
protected observersStore: any;
|
|
33
|
+
protected mapObserver: InstanceObserver;
|
|
34
|
+
protected childrenObserver: InstanceObserver;
|
|
35
|
+
protected contextValue: MapContextType;
|
|
36
|
+
constructor(props: MapProps);
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
componentDidMount(): void;
|
|
41
|
+
/**
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
componentWillUnmount(): void;
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
componentDidUpdate(prevProps: MapProps): void;
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
render(): any;
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
getMapOptions(): any;
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
refresh(): void;
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
instantiateCoreMap(): void;
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
trigger(name: string, e: any): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
requiresHandlers(names: string[]): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @hidden
|
|
75
|
+
*/
|
|
76
|
+
onRender: (e: any) => void;
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
onWindowResize: () => void;
|
|
81
|
+
}
|
package/dist/es/Map.js
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17
|
+
t[p] = s[p];
|
|
18
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
19
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
import * as PropTypes from 'prop-types';
|
|
25
|
+
import { InstanceObserver, Map as KendoMap } from '@progress/kendo-charts';
|
|
26
|
+
import { create as createEvent } from './events/map-event-builder';
|
|
27
|
+
import createStore from './store/store';
|
|
28
|
+
import { optionsReducer, observersReducer } from './store/reducer';
|
|
29
|
+
import './defaults';
|
|
30
|
+
import { MapContext } from './MapContext';
|
|
31
|
+
import { validatePackage } from '@progress/kendo-react-common';
|
|
32
|
+
import { packageMetadata } from './package-metadata';
|
|
33
|
+
/**
|
|
34
|
+
* Represents the [KendoReact Map component]({% slug overview_map %}).
|
|
35
|
+
*/
|
|
36
|
+
var Map = /** @class */ (function (_super) {
|
|
37
|
+
__extends(Map, _super);
|
|
38
|
+
function Map(props) {
|
|
39
|
+
var _this = _super.call(this, props) || this;
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
_this.mapInstance = null;
|
|
44
|
+
_this._element = null;
|
|
45
|
+
_this.optionsStore = {};
|
|
46
|
+
_this.optionsUnsubscriber = Function.prototype;
|
|
47
|
+
_this.observersStore = {};
|
|
48
|
+
/* Map handlers */
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
_this.onRender = function (e) {
|
|
53
|
+
if (_this.mapInstance !== null) {
|
|
54
|
+
_this.trigger('render', e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/* Dom event handlers */
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
_this.onWindowResize = function () {
|
|
62
|
+
if (_this.mapInstance !== null) {
|
|
63
|
+
// this.mapInstance.resize();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
validatePackage(packageMetadata);
|
|
67
|
+
_this.optionsStore = createStore(optionsReducer);
|
|
68
|
+
_this.observersStore = createStore(observersReducer);
|
|
69
|
+
_this.childrenObserver = new InstanceObserver(_this, { onMouseLeave: 'onChildMouseLeave' });
|
|
70
|
+
_this.contextValue = {
|
|
71
|
+
optionsStore: _this.optionsStore,
|
|
72
|
+
observersStore: _this.observersStore,
|
|
73
|
+
childrenObserver: _this.childrenObserver
|
|
74
|
+
};
|
|
75
|
+
_this.mapObserver = new InstanceObserver(_this, {
|
|
76
|
+
// render: 'onRender',
|
|
77
|
+
});
|
|
78
|
+
return _this;
|
|
79
|
+
}
|
|
80
|
+
Object.defineProperty(Map.prototype, "element", {
|
|
81
|
+
/**
|
|
82
|
+
* @hidden
|
|
83
|
+
*/
|
|
84
|
+
get: function () {
|
|
85
|
+
return this._element;
|
|
86
|
+
},
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* @hidden
|
|
92
|
+
*/
|
|
93
|
+
Map.prototype.componentDidMount = function () {
|
|
94
|
+
this.instantiateCoreMap();
|
|
95
|
+
this.optionsUnsubscriber = this.optionsStore.subscribe(this.refresh.bind(this));
|
|
96
|
+
window.addEventListener('resize', this.onWindowResize);
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
*/
|
|
101
|
+
Map.prototype.componentWillUnmount = function () {
|
|
102
|
+
this.optionsUnsubscriber();
|
|
103
|
+
if (this.mapInstance !== null) {
|
|
104
|
+
this.mapInstance.destroy();
|
|
105
|
+
this.mapInstance = null;
|
|
106
|
+
}
|
|
107
|
+
window.removeEventListener('resize', this.onWindowResize);
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
Map.prototype.componentDidUpdate = function (prevProps) {
|
|
113
|
+
var _a = this.props, dir = _a.dir, children = _a.children, spreadProps = __rest(_a, ["dir", "children"]);
|
|
114
|
+
if (this.mapInstance !== null) {
|
|
115
|
+
var shouldUpdate = Object.entries(prevProps)
|
|
116
|
+
.filter(function (keyValue) { return (keyValue[0] !== 'dir' && keyValue[0] !== 'children'); })
|
|
117
|
+
.some(function (keyValue) {
|
|
118
|
+
var key = keyValue[0], value = keyValue[1];
|
|
119
|
+
return !(spreadProps.hasOwnProperty(key) && spreadProps[key] === value);
|
|
120
|
+
});
|
|
121
|
+
if (shouldUpdate) {
|
|
122
|
+
this.refresh();
|
|
123
|
+
}
|
|
124
|
+
if (prevProps.dir !== dir) {
|
|
125
|
+
// TODO: Set k-rtl instead
|
|
126
|
+
// this.mapInstance.setDirection(this.getDirection(dir));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @hidden
|
|
132
|
+
*/
|
|
133
|
+
Map.prototype.render = function () {
|
|
134
|
+
var _this = this;
|
|
135
|
+
var _a = this.props, _b = _a.style, style = _b === void 0 ? {} : _b, className = _a.className, children = _a.children;
|
|
136
|
+
var mapStyles = Object.assign({}, style, { position: 'relative' });
|
|
137
|
+
var content = React.createElement('div', {
|
|
138
|
+
className: className,
|
|
139
|
+
style: mapStyles,
|
|
140
|
+
key: 'mapElement'
|
|
141
|
+
}, (React.createElement("div", { ref: function (el) { return _this._element = el; }, className: "k-map" }, children)));
|
|
142
|
+
return (React.createElement(MapContext.Provider, { value: this.contextValue }, content));
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @hidden
|
|
146
|
+
*/
|
|
147
|
+
Map.prototype.getMapOptions = function () {
|
|
148
|
+
var _a = this.props, center = _a.center, controls = _a.controls, minZoom = _a.minZoom, maxZoom = _a.maxZoom, minSize = _a.minSize, pannable = _a.pannable, wraparound = _a.wraparound, zoom = _a.zoom, zoomable = _a.zoomable;
|
|
149
|
+
var mapOptions = {
|
|
150
|
+
center: center,
|
|
151
|
+
controls: controls,
|
|
152
|
+
minZoom: minZoom,
|
|
153
|
+
maxZoom: maxZoom,
|
|
154
|
+
minSize: minSize,
|
|
155
|
+
pannable: pannable,
|
|
156
|
+
wraparound: wraparound,
|
|
157
|
+
zoom: zoom,
|
|
158
|
+
zoomable: zoomable
|
|
159
|
+
};
|
|
160
|
+
mapOptions = Object.assign(mapOptions, this.optionsStore.getState());
|
|
161
|
+
return mapOptions;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* @hidden
|
|
165
|
+
*/
|
|
166
|
+
Map.prototype.refresh = function () {
|
|
167
|
+
if (this.mapInstance !== null) {
|
|
168
|
+
var mapOptions = this.getMapOptions();
|
|
169
|
+
this.mapInstance.setOptions(mapOptions);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* @hidden
|
|
174
|
+
*/
|
|
175
|
+
Map.prototype.instantiateCoreMap = function () {
|
|
176
|
+
// const { dir } = this.props;
|
|
177
|
+
var mapOptions = this.getMapOptions();
|
|
178
|
+
this.mapInstance = new KendoMap(this.element, mapOptions, {}, {
|
|
179
|
+
// rtl: this.getDirection(dir),
|
|
180
|
+
observer: this.mapObserver,
|
|
181
|
+
sender: this
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
/* Triggers public dom event handlers */
|
|
185
|
+
/**
|
|
186
|
+
* @hidden
|
|
187
|
+
*/
|
|
188
|
+
Map.prototype.trigger = function (name, e) {
|
|
189
|
+
var alias = name === 'click' ? 'mapClick' : name;
|
|
190
|
+
var target = this;
|
|
191
|
+
var eventObject = createEvent(alias, e, target);
|
|
192
|
+
var handler = 'on' + alias.charAt(0).toUpperCase() + alias.slice(1);
|
|
193
|
+
var observers = this.observersStore.getState();
|
|
194
|
+
var isDefaultPrevented = false;
|
|
195
|
+
for (var idx = 0; idx < observers.length; idx++) {
|
|
196
|
+
if (observers[idx].trigger(alias, e)) {
|
|
197
|
+
isDefaultPrevented = true;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/* We have not prevented the event internally, now pass it to the user */
|
|
201
|
+
if (isDefaultPrevented === false
|
|
202
|
+
&& eventObject
|
|
203
|
+
&& this.props.hasOwnProperty(handler)) {
|
|
204
|
+
this.props[handler].call(undefined, eventObject);
|
|
205
|
+
return eventObject.isDefaultPrevented && eventObject.isDefaultPrevented();
|
|
206
|
+
}
|
|
207
|
+
return isDefaultPrevented;
|
|
208
|
+
};
|
|
209
|
+
/* Used by (event)InstanceObserver to check the wrapper for supported events */
|
|
210
|
+
/**
|
|
211
|
+
* @hidden
|
|
212
|
+
*/
|
|
213
|
+
Map.prototype.requiresHandlers = function (names) {
|
|
214
|
+
for (var idx = 0; idx < names.length; idx++) {
|
|
215
|
+
var name_1 = names[idx];
|
|
216
|
+
var handler = 'on' + name_1.charAt(0).toUpperCase() + name_1.slice(1);
|
|
217
|
+
if (this.props.hasOwnProperty(handler)) {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return false;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* @hidden
|
|
225
|
+
*/
|
|
226
|
+
Map.propTypes = {
|
|
227
|
+
dir: PropTypes.string
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* @hidden
|
|
231
|
+
*/
|
|
232
|
+
Map.defaultProps = {};
|
|
233
|
+
return Map;
|
|
234
|
+
}(React.Component));
|
|
235
|
+
export { Map };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Store } from './store/store';
|
|
3
|
+
import { InstanceObserver } from '@progress/kendo-charts';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
export interface MapContextType {
|
|
8
|
+
optionsStore: Store;
|
|
9
|
+
observersStore: Store;
|
|
10
|
+
childrenObserver: InstanceObserver;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export declare const MapContext: React.Context<MapContextType>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MapOptions } from '@progress/kendo-charts';
|
|
3
|
+
import { BeforeResetEvent, MapClickEvent, MarkerActivateEvent, MarkerClickEvent, MarkerCreatedEvent, PanEndEvent, PanEvent, ResetEvent, ShapeClickEvent, ShapeCreatedEvent, ShapeFeatureCreatedEvent, ShapeMouseEnterEvent, ShapeMouseLeaveEvent, ZoomEndEvent, ZoomStartEvent } from './common/events';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the props of the KendoReact Map component.
|
|
6
|
+
*/
|
|
7
|
+
export interface MapProps extends MapOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Represents the `dir` HTML attribute.
|
|
10
|
+
*/
|
|
11
|
+
dir?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The styles that are applied to the component.
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
/**
|
|
17
|
+
* Sets additional CSS classes to the component.
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
children?: any;
|
|
24
|
+
/**
|
|
25
|
+
* Fired immediately before the map is reset. This event is typically used for cleanup by layer implementers.
|
|
26
|
+
*/
|
|
27
|
+
onBeforeReset?: (event: BeforeResetEvent) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Fired when the user clicks on the map.
|
|
30
|
+
*/
|
|
31
|
+
onMapClick?: (event: MapClickEvent) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Fired when a marker has been displayed and has a DOM element assigned.
|
|
34
|
+
*/
|
|
35
|
+
onMarkerActivate?: (event: MarkerActivateEvent) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Fired when a marker has been clicked or tapped.
|
|
38
|
+
*/
|
|
39
|
+
onMarkerClick?: (event: MarkerClickEvent) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Fired when a marker has been created and is about to be displayed.
|
|
42
|
+
*
|
|
43
|
+
* Cancelling the event will prevent the marker from being shown.
|
|
44
|
+
*/
|
|
45
|
+
onMarkerCreated?: (event: MarkerCreatedEvent) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Fires after the map viewport has been moved.
|
|
48
|
+
*/
|
|
49
|
+
onPanEnd?: (event: PanEndEvent) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Fired while the map viewport is being moved.
|
|
52
|
+
*/
|
|
53
|
+
onPan?: (event: PanEvent) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Fired when the map is reset.
|
|
56
|
+
*
|
|
57
|
+
* This typically occurs on initial load and after a zoom/center change.
|
|
58
|
+
*/
|
|
59
|
+
onReset?: (event: ResetEvent) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Fired when a shape is clicked or tapped.
|
|
62
|
+
*/
|
|
63
|
+
onShapeClick?: (event: ShapeClickEvent) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Fired when a shape is created, but is not rendered yet.
|
|
66
|
+
*/
|
|
67
|
+
onShapeCreated?: (event: ShapeCreatedEvent) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Fired when a [GeoJSON Feature](https://geojson.org/geojson-spec.html#feature-objects) is created on a shape layer.
|
|
70
|
+
*/
|
|
71
|
+
onShapeFeatureCreated?: (event: ShapeFeatureCreatedEvent) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Fired when the mouse enters a shape.
|
|
74
|
+
*
|
|
75
|
+
* > This event will fire reliably only for shapes that have set fill color.
|
|
76
|
+
* > The opacity can still be set to 0 so the shapes appear to have no fill.
|
|
77
|
+
*/
|
|
78
|
+
onShapeMouseEnter?: (event: ShapeMouseEnterEvent) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Fired when the mouse leaves a shape.
|
|
81
|
+
*
|
|
82
|
+
* > This event will fire reliably only for shapes that have set fill color.
|
|
83
|
+
* > The opacity can still be set to 0 so the shapes appear to have no fill.
|
|
84
|
+
*/
|
|
85
|
+
onShapeMouseLeave?: (event: ShapeMouseLeaveEvent) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Fired when the map zoom level is about to change.
|
|
88
|
+
*
|
|
89
|
+
* Cancelling the event will prevent the user action.
|
|
90
|
+
*/
|
|
91
|
+
onZoomStart?: (event: ZoomStartEvent) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Fired when the map zoom level has changed.
|
|
94
|
+
*/
|
|
95
|
+
onZoomEnd?: (event: ZoomEndEvent) => void;
|
|
96
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { BeforeResetEvent } from '../events/before-reset-event';
|
|
2
|
+
export { MapClickEvent } from '../events/map-click-event';
|
|
3
|
+
export { MarkerActivateEvent } from '../events/marker-activate-event';
|
|
4
|
+
export { MarkerClickEvent } from '../events/marker-click-event';
|
|
5
|
+
export { MarkerCreatedEvent } from '../events/marker-created-event';
|
|
6
|
+
export { PanEndEvent } from '../events/pan-end-event';
|
|
7
|
+
export { PanEvent } from '../events/pan-event';
|
|
8
|
+
export { ResetEvent } from '../events/reset-event';
|
|
9
|
+
export { ShapeClickEvent } from '../events/shape-click-event';
|
|
10
|
+
export { ShapeCreatedEvent } from '../events/shape-created-event';
|
|
11
|
+
export { ShapeFeatureCreatedEvent } from '../events/shape-feature-created-event';
|
|
12
|
+
export { ShapeMouseEnterEvent } from '../events/shape-mouse-enter-event';
|
|
13
|
+
export { ShapeMouseLeaveEvent } from '../events/shape-mouse-leave-event';
|
|
14
|
+
export { ZoomEndEvent } from '../events/zoom-end-event';
|
|
15
|
+
export { ZoomStartEvent } from '../events/zoom-start-event';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Re-export event types
|
|
2
|
+
export { BeforeResetEvent } from '../events/before-reset-event';
|
|
3
|
+
export { MapClickEvent } from '../events/map-click-event';
|
|
4
|
+
export { MarkerActivateEvent } from '../events/marker-activate-event';
|
|
5
|
+
export { MarkerClickEvent } from '../events/marker-click-event';
|
|
6
|
+
export { MarkerCreatedEvent } from '../events/marker-created-event';
|
|
7
|
+
export { PanEndEvent } from '../events/pan-end-event';
|
|
8
|
+
export { PanEvent } from '../events/pan-event';
|
|
9
|
+
export { ResetEvent } from '../events/reset-event';
|
|
10
|
+
export { ShapeClickEvent } from '../events/shape-click-event';
|
|
11
|
+
export { ShapeCreatedEvent } from '../events/shape-created-event';
|
|
12
|
+
export { ShapeFeatureCreatedEvent } from '../events/shape-feature-created-event';
|
|
13
|
+
export { ShapeMouseEnterEvent } from '../events/shape-mouse-enter-event';
|
|
14
|
+
export { ShapeMouseLeaveEvent } from '../events/shape-mouse-leave-event';
|
|
15
|
+
export { ZoomEndEvent } from '../events/zoom-end-event';
|
|
16
|
+
export { ZoomStartEvent } from '../events/zoom-start-event';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MapLayer, MapLayerOptions, MapMarker, BubbleLayerSymbolArgs, BubbleLayerSymbol, MapControls, MapControlsPosition, TileUrlTemplateArgs, Location, Extent } from '@progress/kendo-charts';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BubbleLayerOptions } from '@progress/kendo-charts';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the KendoReact MapBubbleLayer component.
|
|
5
|
+
*/
|
|
6
|
+
export interface MapBubbleLayerProps extends BubbleLayerOptions {
|
|
7
|
+
}
|
|
8
|
+
declare const MapBubbleLayer: React.SFC<MapBubbleLayerProps>;
|
|
9
|
+
export default MapBubbleLayer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import ConfigurationComponent from './base/ConfigurationComponent';
|
|
14
|
+
var MapBubbleLayer = function (props) {
|
|
15
|
+
return (React.createElement(ConfigurationComponent, __assign({ type: "bubble" }, props)));
|
|
16
|
+
};
|
|
17
|
+
MapBubbleLayer.displayName = 'MapBubbleLayer';
|
|
18
|
+
export default MapBubbleLayer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import * as PropTypes from 'prop-types';
|
|
14
|
+
import CollectionConfigurationComponent from './base/CollectionConfigurationComponent';
|
|
15
|
+
var MapLayers = function (props) {
|
|
16
|
+
return (React.createElement(CollectionConfigurationComponent, __assign({}, props, { _mapKey: "layers" })));
|
|
17
|
+
};
|
|
18
|
+
MapLayers.propTypes = {
|
|
19
|
+
children: PropTypes.array
|
|
20
|
+
};
|
|
21
|
+
export default MapLayers;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MarkerLayerOptions } from '@progress/kendo-charts';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the KendoReact MapMarkerLayer component.
|
|
5
|
+
*/
|
|
6
|
+
export interface MapMarkerLayerProps extends MarkerLayerOptions {
|
|
7
|
+
}
|
|
8
|
+
declare const MapMarkerLayer: React.SFC<MapMarkerLayerProps>;
|
|
9
|
+
export default MapMarkerLayer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import ConfigurationComponent from './base/ConfigurationComponent';
|
|
14
|
+
var MapMarkerLayer = function (props) {
|
|
15
|
+
return (React.createElement(ConfigurationComponent, __assign({ type: "marker" }, props)));
|
|
16
|
+
};
|
|
17
|
+
MapMarkerLayer.displayName = 'MapMarkerLayer';
|
|
18
|
+
export default MapMarkerLayer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ShapeLayerOptions } from '@progress/kendo-charts';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the KendoReact MapShapeLayer component.
|
|
5
|
+
*/
|
|
6
|
+
export interface MapShapeLayerProps extends ShapeLayerOptions {
|
|
7
|
+
}
|
|
8
|
+
declare const MapShapeLayer: React.SFC<MapShapeLayerProps>;
|
|
9
|
+
export default MapShapeLayer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import ConfigurationComponent from './base/ConfigurationComponent';
|
|
14
|
+
var MapShapeLayer = function (props) {
|
|
15
|
+
return (React.createElement(ConfigurationComponent, __assign({ type: "shape" }, props)));
|
|
16
|
+
};
|
|
17
|
+
MapShapeLayer.displayName = 'MapShapeLayer';
|
|
18
|
+
export default MapShapeLayer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TileLayerOptions } from '@progress/kendo-charts';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the KendoReact MapTileLayer component.
|
|
5
|
+
*/
|
|
6
|
+
export interface MapTileLayerProps extends TileLayerOptions {
|
|
7
|
+
}
|
|
8
|
+
declare const MapTileLayer: React.SFC<MapTileLayerProps>;
|
|
9
|
+
export default MapTileLayer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import ConfigurationComponent from './base/ConfigurationComponent';
|
|
14
|
+
var MapTileLayer = function (props) {
|
|
15
|
+
return (React.createElement(ConfigurationComponent, __assign({ type: "tile" }, props)));
|
|
16
|
+
};
|
|
17
|
+
MapTileLayer.displayName = 'MapTileLayer';
|
|
18
|
+
export default MapTileLayer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
export interface CollectionConfigurationProps {
|
|
6
|
+
_mapKey: string;
|
|
7
|
+
_parentStore?: any;
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export default class CollectionConfigurationComponent extends React.Component<CollectionConfigurationProps> {
|
|
14
|
+
static contextType: React.Context<import("../../MapContext").MapContextType>;
|
|
15
|
+
optionsStore: any;
|
|
16
|
+
constructor(props: any, context: any);
|
|
17
|
+
renderChildren(child: any, index: number): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
18
|
+
render(): any;
|
|
19
|
+
}
|