@progress/kendo-charts 1.23.3 → 1.23.4-dev.202205050627

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/npm/map.d.ts CHANGED
@@ -1,4 +1,869 @@
1
+ import { Element, geometry, Group, ShapeOptions } from '@progress/kendo-drawing';
2
+
3
+ /**
4
+ * @hidden
5
+ */
1
6
  export class Map {
2
- constructor(element: any, options: any);
3
- public setOptions(options: any): void;
7
+ options: MapOptions;
8
+ layers: any;
9
+ element: HTMLElement;
10
+
11
+ get center(): Location;
12
+ set center(center: Location | [number, number]);
13
+
14
+ get extent(): Extent;
15
+ set extent(extent: Extent);
16
+
17
+ get zoom(): number;
18
+ set zoom(level: number);
19
+
20
+ get viewSize(): any;
21
+
22
+ constructor(element: any, options: MapOptions, theme: any, context: any);
23
+
24
+ eventOffset(e: any): geometry.Point;
25
+ eventToLayer(e: any): geometry.Point;
26
+ eventToLocation(e: any): geometry.Point;
27
+ eventToView(e: any): geometry.Point;
28
+ layerToLocation(point: geometry.Point | [number, number], zoom: number): Location;
29
+ locationToLayer(location: Location | [number, number], zoom: number): geometry.Point;
30
+ locationToView(location: Location | [number, number]): geometry.Point;
31
+ resize(force?: boolean): void;
32
+ setOptions(options: any): void;
33
+ viewToLocation(point: geometry.Point | [number, number], zoom: number): Location;
34
+ }
35
+
36
+ /**
37
+ * Represents a geographic location.
38
+ */
39
+ export class Location {
40
+ /**
41
+ * The location latitude in decimal degrees.
42
+ */
43
+ lat: number;
44
+
45
+ /**
46
+ * The location longitude in decimal degrees.
47
+ */
48
+ lng: number;
49
+
50
+ /**
51
+ * Creates a new Location.
52
+ *
53
+ * @param lat The location latitude in decimal degrees.
54
+ * @param lng The location longitude in decimal degrees.
55
+ */
56
+ constructor(lat: number, lng: number);
57
+
58
+ /**
59
+ * Creates a Location instance from an [longitude, latitude] array.
60
+ *
61
+ * @param lnglat The [longitude, latitude] array.
62
+ * @returns The Location instance.
63
+ */
64
+ static fromLngLat(lnglat: [number, number] | number[]): Location;
65
+
66
+ /**
67
+ * Creates a Location instance from an [latitude, longitude] array.
68
+ *
69
+ * @param latlng The [latitude, longitude] array.
70
+ * @returns The Location instance.
71
+ */
72
+ static fromLatLng(latlng: [number, number] | number[]): Location;
73
+
74
+ /**
75
+ * Creates a new instance with the same coordinates.
76
+ *
77
+ * @returns The new Location instance.
78
+ */
79
+ clone(): Location;
80
+
81
+ /**
82
+ * Finds a destination at the given distance and bearing from this location.
83
+ *
84
+ * @param distance The distance to the destination in meters.
85
+ * @param bearing The initial bearing to the destination in decimal degrees.
86
+ * @returns The destination at the given distance and bearing.
87
+ */
88
+ destination(distance: number, bearing: number): Location;
89
+
90
+ /**
91
+ * Calculates the [great-circle distance](https://en.wikipedia.org/wiki/Great-circle_distance) to the given destination in meters.
92
+ *
93
+ * @param destination The destination location.
94
+ * @returns The distance to the specified location in meters.
95
+ */
96
+ distanceTo(destination: Location): number;
97
+
98
+ /**
99
+ * Compares this location with another instance.
100
+ *
101
+ * @param location The location to compare with.
102
+ * @returns true if the location coordinates match; false otherwise.
103
+ */
104
+ equals(location: Location): boolean;
105
+
106
+ /**
107
+ * Rounds the location coordinates to the specified number of fractional digits.
108
+ *
109
+ * @param digits Number of fractional digits.
110
+ * @returns The current Location instance.
111
+ */
112
+ round(digits: number): Location;
113
+
114
+ /**
115
+ * Returns the location coordinates as an [lat, lng] array.
116
+ *
117
+ * @returns An array representation of the location.
118
+ */
119
+ toArray(): [number, number];
120
+
121
+ /**
122
+ * Returns the location coordinates formatted as '{lat},{lng}'.
123
+ *
124
+ * @returns A string representation of the location.
125
+ */
126
+ toString(): string;
127
+
128
+ /**
129
+ * Wraps the latitude and longitude to fit into the [0, 90] and [0, 180] range.
130
+ *
131
+ * @returns The current Location instance.
132
+ */
133
+ wrap(): Location;
134
+ }
135
+
136
+ /**
137
+ * Represents a geographic region defined by two extreme locations (North West and South East).
138
+ */
139
+ export class Extent {
140
+ /**
141
+ * The North West extreme location.
142
+ */
143
+ nw: Location;
144
+
145
+ /**
146
+ * The South East extreme location.
147
+ */
148
+ se: Location;
149
+
150
+ /**
151
+ * Creates a new Extent.
152
+ *
153
+ * @param nw The North West extreme location.
154
+ * @param se The South East extreme location.
155
+ */
156
+ constructor(
157
+ nw: Location | [number, number] | number[],
158
+ se: Location | [number, number] | number[]
159
+ );
160
+
161
+ /**
162
+ * Tests if a location is contained within the extent.
163
+ *
164
+ * @param location The location to test for.
165
+ * @returns true if the extent contains the location, false otherwise.
166
+ */
167
+ contains(location: Location): boolean;
168
+
169
+ /**
170
+ * Tests if any of the locations is contained within the extent.
171
+ *
172
+ * @param locations An array of locations to test for.
173
+ * @returns true if the extent contains any of the locations, false otherwise.
174
+ */
175
+ containsAny(locations: Location[]): boolean;
176
+
177
+ /**
178
+ * Returns the center of the extent.
179
+ *
180
+ * @returns The extent center location.
181
+ */
182
+ center(): Location;
183
+
184
+ /**
185
+ * Grows the extent, if required, to contain the specified location.
186
+ *
187
+ * @param location The location to include in the extent.
188
+ */
189
+ include(location: Location): void;
190
+
191
+ /**
192
+ * Grows the extent, if required, to contain all specified locations.
193
+ *
194
+ * @param locations The locations to include in the extent.
195
+ */
196
+ includeAll(locations: any): void;
197
+
198
+ /**
199
+ * Returns the four extreme locations of the extent.
200
+ *
201
+ * @returns An object with nw, ne, se and sw locations.
202
+ */
203
+ edges(): { nw: Location, ne: Location, se: Location, sw: Location};
204
+
205
+ /**
206
+ * Returns the four extreme locations of the extent as an array.
207
+ *
208
+ * @returns An array with [NW, NE, SE, SW] locations.
209
+ */
210
+ toArray(): [Location, Location, Location, Location];
211
+
212
+ /**
213
+ * Tests if the given extent overlaps with this instance.
214
+ *
215
+ * @param extent The extent to test with.
216
+ * @returns true if the extents overlap, false otherwise.
217
+ */
218
+ overlaps(extent: Extent): boolean;
219
+ }
220
+
221
+
222
+ /**
223
+ * @hidden
224
+ */
225
+ interface MapOptions {
226
+ /**
227
+ * The map center. Coordinates are listed as `[Latitude, Longitude]`.
228
+ */
229
+ center?: Location | [number, number] | number[];
230
+
231
+ /**
232
+ * The configuration of built-in map controls.
233
+ */
234
+ controls?: MapControls;
235
+
236
+ /**
237
+ * The minimum zoom level. Typical web maps use zoom levels from 0 (whole world) to 19 (sub-meter features).
238
+ *
239
+ * @default 1
240
+ */
241
+ minZoom?: number;
242
+
243
+ /**
244
+ * The maximum zoom level. Typical web maps use zoom levels from 0 (whole world) to 19 (sub-meter features).
245
+ *
246
+ * @default 19
247
+ */
248
+ maxZoom?: number;
249
+
250
+ /**
251
+ * The size of the map in pixels at zoom level 0.
252
+ *
253
+ * @default 256
254
+ */
255
+ minSize?: number;
256
+
257
+ /**
258
+ * Controls whether the user can pan the map.
259
+ *
260
+ * @default true
261
+ */
262
+ pannable?: boolean;
263
+
264
+ /**
265
+ * Specifies whether the map should wrap around the east-west edges.
266
+ *
267
+ * @default true
268
+ */
269
+ wraparound?: boolean;
270
+
271
+ /**
272
+ * The initial zoom level.
273
+ *
274
+ * Typical web maps use zoom levels from 0 (whole world) to 19 (sub-meter features).
275
+ * The map size is derived from the zoom level and minScale options: size = (2 ^ zoom) * minSize
276
+ *
277
+ * > Map zoom rounds floating point numbers. This is done so as the majority of web maps use the whole [zoom levels](https://wiki.openstreetmap.org/wiki/Zoom_levels) 0 through to 19.
278
+ *
279
+ * @default 3
280
+ */
281
+ zoom?: number;
282
+
283
+ /**
284
+ * Controls whether the map zoom level can be changed by the user.
285
+ *
286
+ * @default true
287
+ */
288
+ zoomable?: boolean;
289
+ }
290
+
291
+ /**
292
+ * @hidden
293
+ */
294
+ export type MapLayerType = 'tile' | 'marker' | 'shape' | 'bubble';
295
+
296
+ /**
297
+ * Map layer configuration options.
298
+ * @hidden
299
+ */
300
+ export interface MapLayerOptions {
301
+ /**
302
+ * The attribution for the layer. Accepts HTML.
303
+ */
304
+ attribution: string;
305
+
306
+ /**
307
+ * Specifies the extent of the region covered by this layer.
308
+ * The layer will be hidden when the specified area is out of view. If not specified, the layer is always visible.
309
+ *
310
+ * Accepts an `Extent` or an array that specifies the extent covered by this layer:
311
+ * `[[NW lat, NW long], [SE lat, SE long]]`.
312
+ */
313
+ extent?: Extent | [[number, number], [number, number]];
314
+
315
+ /**
316
+ * The minimum zoom level at which to show this layer.
317
+ */
318
+ maxZoom?: number;
319
+
320
+ /**
321
+ * The minimum zoom level at which to show this layer.
322
+ */
323
+ minZoom?: number;
324
+
325
+ /**
326
+ * The the opacity for the layer.
327
+ *
328
+ * The value must be in the range from 0 (fully transparent) to 1 (fully opaque).
329
+ */
330
+ opacity?: number;
331
+
332
+ /**
333
+ * The zIndex for this layer.
334
+ *
335
+ * Layers are normally stacked in declaration order (last one is on top).
336
+ */
337
+ zIndex: number;
338
+ }
339
+
340
+ /**
341
+ * The arguments to the `symbol` function on bubble layers.
342
+ */
343
+ export interface BubbleLayerSymbolArgs {
344
+ /**
345
+ * The symbol center on the current layer.
346
+ */
347
+ center: geometry.Point;
348
+
349
+ /**
350
+ * The symbol size.
351
+ */
352
+ size: number;
353
+
354
+ /**
355
+ * The symbol style.
356
+ */
357
+ style: ShapeOptions;
358
+
359
+ /**
360
+ * The dataItem used to create the symbol.
361
+ */
362
+ dataItem: any;
363
+
364
+ /**
365
+ * The location of the data point.
366
+ */
367
+ location: Location;
368
+ }
369
+
370
+ /**
371
+ * Bubble layer symbol type.
372
+ */
373
+ export type BubbleLayerSymbol = 'circle' | 'square' | ((args: BubbleLayerSymbolArgs) => Element);
374
+
375
+ /**
376
+ * Configuration options for the map Bubble layer.
377
+ */
378
+ export interface BubbleLayerOptions extends MapLayerOptions {
379
+ /**
380
+ * The array of data items for this layer.
381
+ */
382
+ data?: any[];
383
+
384
+ /**
385
+ * The data item field which contains the symbol location.
386
+ *
387
+ * The field should be an array with two numbers - latitude and longitude in decimal degrees.
388
+ */
389
+ locationField?: string;
390
+
391
+ /**
392
+ * The value field for the symbols used to determine their relative size.
393
+ * The data item field should be a number.
394
+ */
395
+ valueField?: string;
396
+
397
+ /**
398
+ * The symbol to use for bubble layers.
399
+ */
400
+ symbol?: BubbleLayerSymbol;
401
+
402
+ /**
403
+ * The default style for symbols.
404
+ */
405
+ style?: ShapeOptions;
406
+
407
+ /**
408
+ * The maximum symbol size for bubble layer symbols.
409
+ *
410
+ * @default 100
411
+ */
412
+ maxSize?: number;
413
+
414
+ /**
415
+ * The minimum symbol size for bubble layer symbols.
416
+ *
417
+ * > Setting non-zero value will distort symbol area to value ratio.
418
+ *
419
+ * @default 0
420
+ */
421
+ minSize?: number;
422
+ }
423
+
424
+ /**
425
+ * Configuration options for the map Marker layer.
426
+ */
427
+ export interface MarkerLayerOptions extends MapLayerOptions {
428
+ /**
429
+ * The array of data items for this layer.
430
+ */
431
+ data?: any[];
432
+
433
+ /**
434
+ * The data item field which contains the marker location.
435
+ *
436
+ * The field should be an array with two numbers - latitude and longitude in decimal degrees.
437
+ */
438
+ locationField?: string;
439
+
440
+ /**
441
+ * The data item field which contains the marker title.
442
+ */
443
+ titleField?: string;
444
+
445
+ /**
446
+ * The default marker shape for data-bound markers.
447
+ *
448
+ * The following pre-defined marker shapes are available:
449
+ * * "pinTarget"
450
+ * * "pin"
451
+ *
452
+ * Marker shapes are implemented as CSS classes on the marker element (span.k-marker). For example "pinTarget" is rendered as "k-marker-pin-target".
453
+ */
454
+ shape?: string | 'pinTarget' | 'pin';
455
+ }
456
+
457
+ /**
458
+ * Configuration options for the map Shape layer.
459
+ */
460
+ export interface ShapeLayerOptions extends MapLayerOptions {
461
+ /**
462
+ * The array of data items for this layer.
463
+ */
464
+ data?: any[];
465
+
466
+ /**
467
+ * The default style for shapes.
468
+ */
469
+ style?: ShapeOptions;
470
+ }
471
+
472
+ /**
473
+ * The arguments to the `urlTemplate` function on tile layers.
474
+ */
475
+ export interface TileUrlTemplateArgs {
476
+ /**
477
+ * X coordinate of the tile.
478
+ */
479
+ x: number;
480
+
481
+ /**
482
+ * Y coordinate of the tile.
483
+ */
484
+ y: number;
485
+
486
+ /**
487
+ * The zoom level.
488
+ */
489
+ zoom: number;
490
+
491
+ /**
492
+ * Subdomain for this tile.
493
+ */
494
+ subdomain: string;
495
+ }
496
+
497
+ /**
498
+ * Configuration options for the map Tile layer.
499
+ */
500
+ export interface TileLayerOptions extends MapLayerOptions {
501
+ /**
502
+ * The size of the image tile in pixels.
503
+ *
504
+ * @default 256
505
+ */
506
+ tileSize?: number;
507
+
508
+ /**
509
+ * A list of subdomains to use for loading tiles.
510
+ *
511
+ * Alternating between different subdomains allows more requests to be executed in parallel.
512
+ */
513
+ subdomains: string[];
514
+
515
+ /**
516
+ * A function that returns an image URL for each tile position.
517
+ */
518
+ urlTemplate: (args: TileUrlTemplateArgs) => string;
519
+ }
520
+
521
+ /**
522
+ * Possible positions of map controls
523
+ */
524
+ export type MapControlsPosition = 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
525
+
526
+ /**
527
+ * The configuration of built-in map controls.
528
+ */
529
+ export interface MapControls {
530
+ /**
531
+ * Configures or disables the built-in attribution control.
532
+ *
533
+ * @default true
534
+ */
535
+ attribution?: boolean | { position?: MapControlsPosition };
536
+
537
+ /**
538
+ * Configures or disables the built-in navigator control (directional pad).
539
+ *
540
+ * @default true
541
+ */
542
+ navigator?: boolean | { position?: MapControlsPosition };
543
+
544
+ /**
545
+ * Configures or disables the built-in zoom control (+/- button).
546
+ *
547
+ * @default true
548
+ */
549
+ zoom?: boolean | { position?: MapControlsPosition };
550
+ }
551
+
552
+ /**
553
+ * An instance of a Map layer
554
+ */
555
+ export interface MapLayer {
556
+ /**
557
+ * The layer configuration settings.
558
+ */
559
+ options: MapLayerOptions;
560
+
561
+ /**
562
+ * Shows the layer, if not visible.
563
+ */
564
+ show(): void;
565
+
566
+ /**
567
+ * Hides the layer, if visible.
568
+ */
569
+ hide(): void;
570
+ }
571
+
572
+ /**
573
+ * Represents a Map marker with title and location.
574
+ */
575
+ export interface MapMarker {
576
+ /**
577
+ * The marker location on the map.
578
+ */
579
+ location: Location;
580
+
581
+ /**
582
+ * The marker shape.
583
+ */
584
+ shape: string;
585
+
586
+ /**
587
+ * The marker title. Displayed as browser tooltip.
588
+ */
589
+ title: string;
590
+ }
591
+
592
+ /**
593
+ * Fired immediately before the map is reset. This event is typically used for cleanup by layer implementers.
594
+ * @hidden
595
+ */
596
+ export interface MapBeforeResetEvent {
597
+ }
598
+
599
+ /**
600
+ * Fired when the user clicks on the map.
601
+ * @hidden
602
+ */
603
+ export interface MapClickEvent {
604
+ /**
605
+ * The location of the clicked point.
606
+ */
607
+ location: Location;
608
+
609
+ /**
610
+ * The source DOM event instance
611
+ */
612
+ originalEvent: any;
613
+ }
614
+
615
+ /**
616
+ * Fired when a marker has been displayed and has a DOM element assigned.
617
+ * @hidden
618
+ */
619
+ export interface MapMarkerActivateEvent {
620
+ /**
621
+ * The marker instance.
622
+ */
623
+ marker: MapMarker;
624
+
625
+ /**
626
+ * The marker layer instance.
627
+ */
628
+ layer: MapLayer;
629
+ }
630
+
631
+ /**
632
+ * Fired when a marker has been created and is about to be displayed.
633
+ *
634
+ * Cancelling the event will prevent the marker from being shown.
635
+ * @hidden
636
+ */
637
+ export interface MapMarkerCreatedEvent {
638
+ /**
639
+ * The marker instance.
640
+ */
641
+ marker: MapMarker;
642
+
643
+ /**
644
+ * The marker layer instance.
645
+ */
646
+ layer: MapLayer;
647
+
648
+ /**
649
+ * Prevents the default action for a specified event.
650
+ */
651
+ preventDefault(): void;
652
+ }
653
+
654
+ /**
655
+ * Fired when a marker has been clicked or tapped.
656
+ * @hidden
657
+ */
658
+ export interface MapMarkerClickEvent {
659
+ /**
660
+ * The marker instance.
661
+ */
662
+ marker: MapMarker;
663
+
664
+ /**
665
+ * The marker layer instance.
666
+ */
667
+ layer: MapLayer;
668
+ }
669
+
670
+ /**
671
+ * Fired while the map viewport is being moved.
672
+ * @hidden
673
+ */
674
+ export interface MapPanEvent {
675
+ /**
676
+ * The map origin (top left or NW corner).
677
+ */
678
+ origin: Location;
679
+
680
+ /**
681
+ * The current map center.
682
+ */
683
+ center: Location;
684
+
685
+ /**
686
+ * The source DOM event instance
687
+ */
688
+ originalEvent: any;
689
+ }
690
+
691
+ /**
692
+ * Fires after the map viewport has been moved.
693
+ * @hidden
694
+ */
695
+ export interface MapPanEndEvent {
696
+ /**
697
+ * The map origin (top left or NW corner).
698
+ */
699
+ origin: Location;
700
+
701
+ /**
702
+ * The current map center.
703
+ */
704
+ center: Location;
705
+
706
+ /**
707
+ * The source DOM event instance
708
+ */
709
+ originalEvent: any;
710
+ }
711
+
712
+ /**
713
+ * Fired when the map is reset.
714
+ *
715
+ * This typically occurs on initial load and after a zoom/center change.
716
+ * @hidden
717
+ */
718
+ export interface MapResetEvent {
719
+ }
720
+
721
+ /**
722
+ * Fired when a shape is clicked or tapped.
723
+ * @hidden
724
+ */
725
+ export interface MapShapeClickEvent {
726
+ /**
727
+ * The shape layer instance.
728
+ */
729
+ layer: MapLayer;
730
+
731
+ /**
732
+ * The shape instance.
733
+ */
734
+ shape: Element;
735
+
736
+ /**
737
+ * The source DOM event instance
738
+ */
739
+ originalEvent: any;
740
+ }
741
+
742
+ /**
743
+ * Fired when a shape is created, but is not rendered yet.
744
+ * @hidden
745
+ */
746
+ export interface MapShapeCreatedEvent {
747
+ /**
748
+ * The shape layer instance.
749
+ */
750
+ layer: MapLayer;
751
+
752
+ /**
753
+ * The shape instance.
754
+ */
755
+ shape: Element;
756
+
757
+ /**
758
+ * The original data item for this Shape.
759
+ */
760
+ dataItem: any;
761
+
762
+ /**
763
+ * The shape location
764
+ */
765
+ location: Location;
766
+ }
767
+
768
+ /**
769
+ * Fired when a [GeoJSON Feature](https://geojson.org/geojson-spec.html#feature-objects) is created on a shape layer.
770
+ * @hidden
771
+ */
772
+ export interface MapShapeFeatureCreatedEvent {
773
+ /**
774
+ * The original data item for this Feature. Members include `geometries` and `properties`.
775
+ */
776
+ dataItem: any;
777
+
778
+ /**
779
+ * The shape layer instance.
780
+ */
781
+ layer: MapLayer;
782
+
783
+ /**
784
+ * The group containing feature shape instances.
785
+ */
786
+ group: Group;
787
+
788
+ /**
789
+ * A reference to the `dataItem.properties` object.
790
+ */
791
+ properties: any;
792
+ }
793
+
794
+ /**
795
+ * Fired when the mouse enters a shape.
796
+ *
797
+ * > This event will fire reliably only for shapes that have set fill color.
798
+ * > The opacity can still be set to 0 so the shapes appear to have no fill.
799
+ * @hidden
800
+ */
801
+ export interface MapShapeMouseEnterEvent {
802
+ /**
803
+ * The shape layer instance.
804
+ */
805
+ layer: MapLayer;
806
+
807
+ /**
808
+ * The shape instance.
809
+ */
810
+ shape: Element;
811
+
812
+ /**
813
+ * The source DOM event instance
814
+ */
815
+ originalEvent: any;
816
+ }
817
+
818
+ /**
819
+ * Fired when the mouse leaves a shape.
820
+ *
821
+ * > This event will fire reliably only for shapes that have set fill color.
822
+ * > The opacity can still be set to 0 so the shapes appear to have no fill.
823
+ * @hidden
824
+ */
825
+ export interface MapShapeMouseLeaveEvent {
826
+ /**
827
+ * The shape layer instance.
828
+ */
829
+ layer: MapLayer;
830
+
831
+ /**
832
+ * The shape instance.
833
+ */
834
+ shape: Element;
835
+
836
+ /**
837
+ * The source DOM event instance
838
+ */
839
+ originalEvent: any;
840
+ }
841
+
842
+ /**
843
+ * Fired when the map zoom level is about to change.
844
+ *
845
+ * Cancelling the event will prevent the user action.
846
+ * @hidden
847
+ */
848
+ export interface MapZoomStartEvent {
849
+ /**
850
+ * The source DOM event instance
851
+ */
852
+ originalEvent: any;
853
+
854
+ /**
855
+ * Prevents the default action for a specified event.
856
+ */
857
+ preventDefault(): void;
858
+ }
859
+
860
+ /**
861
+ * Fired when the map zoom level has changed.
862
+ * @hidden
863
+ */
864
+ export interface MapZoomEndEvent {
865
+ /**
866
+ * The source DOM event instance
867
+ */
868
+ originalEvent: any;
4
869
  }