forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapsjs.d.ts
2720 lines (2356 loc) · 93.8 KB
/
mapsjs.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for Mapsjs 9.6.0
// Project: https://github.com/mapsjs
// Definitions by: Matthew James Davis <https://github.com/davismj/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* Mapsjs 9.6.0 Copyright (c) 2013 ISC. All Rights Reserved.
*/
declare module 'mapsjs' {
/**
* Clusters a set of points.
* @param {object} options An options object which specifies the clustering algorithm.
* @returns {object} An array of clustered points.
*/
export function clusterPoints(options: {
data: {}[];
pointKey: string;
valueFunction?: (row: any) => number;
radiusFunction: (row: any) => number;
aggregateFunction?: (srcRow: any, cmpRow: any, aggRow: any) => void;
mapUnitsPerPixel: number;
marginPixels?: number;
}): {}[];
/**
* An immutable envelope
* @class envelope
*/
export class envelope {
constructor(minX: number, minY: number, maxX: number, maxY: number);
/**
* Gets the minimum x coordinate of the envelope.
* @returns {number} The minimum x coordinate.
*/
getMinX(): number;
/**
* Gets the minimum y coordinate of the envelope
* @returns {number} The minimum y coordinate.
*/
getMinY(): number;
/**
* Gets the maximum x coordinate of the envelope
* @returns {number} The maximum x coordinate.
*/
getMaxX(): number;
/**
* Gets the maximum y coordinate of the envelope
* @returns {number} The maximum y coordinate.
*/
getMaxY(): number;
/**
* Creates a new envelope from this as deep copy.
* @returns {envelope} The new cloned envelope.
*/
clone(): envelope;
/**
* Creates a new envelope from this one plus x and y margins.
* @param {number} marginX The x margin.
* @param {number} marginY The y margin.
* @returns {envelope} A new envelope.
*/
createFromMargins(marginX: number, marginY: number): envelope;
/**
* Create a new envelope from this one plus a bleed ratio.
* @param {number} bleed The bleed ratio.
* @returns {envelope} A new envelope.
*/
createFromBleed(bleed: number): envelope;
/**
* Gets the center point of the envelope.
* @returns {point} Center as a point.
*/
getCenter(): point;
/**
* Gets the width of the envelope.
* @returns {number} Width of the envelope.
*/
getWidth(): number;
/**
* Gets height of the envelope.
* @returns {number} Height of the envelope.
*/
getHeight(): number;
/**
* Gets area of the envelope.
* @return {number} Area of the envelope.
*/
getArea(): number;
/**
* Returns the minimum and maximum coordinates of this envelope as an envObject.
* @returns {envObject} Representaton of this envelope as an envObject.
*/
toObject(): envObject;
/**
* Gets upper left coordinate of this envelope.
* @returns {point} A new point.
*/
getUL(): point;
/**
* Gets upper right of this envelope.
* @returns {point} A new point.
*/
getUR(): point;
/**
* Gets lower left of this envelope.
* @returns {point} A new point.
*/
getLL(): point;
/**
* Gets lower right of this envelope.
* @returns {point} A new point.
*/
getLR(): point;
/**
* Gets the aspect of the envelope.
* @returns {number} Width-to-height ratio.
*/
getAspect(): number;
/**
* Equality comparer between this and another envelope.
* @param {envelope} env Envelope to compare.
* @return {boolean} Result of equality comparison.
*/
equals(env: envelope): boolean;
/**
* Method for casting this envelope as a string.
* @returns {string} String of the form 'minX,minY,maxX,maxY'.
*/
toString(): string;
/**
* Create a closed geometry from this envelope.
* @returns {geometry} A new closed path geometry.
*/
toGeometry(): geometry;
/**
* Tests whether the given point is contained within this envelope.
* @param {point} pt Point to test.
* @returns {boolean} Result of containment test.
*/
contains(pt: point): boolean;
}
/**
* Exposes static functions that act on or return envelopes.
* @module envelope
*/
export module envelope {
/**
* Creates a new envelope from MapDotNet XML.
* @param {string} xml A MapDotNet XML string of the envelope.
* @returns {envelope} A new envelope
*/
export function createFromMdnXml(xml: string): envelope;
/**
* Creates new envelope from two corner points.
* @param {point} pt1 Corner point
* @param {point} pt2 Opposite corner point
* @returns {envelope} A new envelope
*/
export function createFromPoints(pt1: point, pt2: point): envelope;
/**
* Creates a new envelope from the x and y coordinates of the center
* point and x and y margins from the center point.
* @param {number} centerPtX The center x coordinate.
* @param {number} centerPtY The center y coordinate.
* @param {number} marginX The margin from center x coordinate.
* @param {number} marginY The margin from center y coordinate.
* @returns {envelope} A new envelope
*/
export function createFromCenterAndMargins(centerPtX: number, centerPtY: number, marginX: number, marginY: number): envelope;
/**
* Tests whether two given envelopes intersect.
* @param {envelope} env1 First envelope to test.
* @param {envelope} env2 Second envelope to test.
* @returns {boolean} Result of the intersection test.
*/
export function intersects(env1: envelope, env2: envelope): boolean;
/**
* Creates a new envelope from the union of two given envelopes.
* @param {envelope} env1 The first enevelope to unite.
* @param {envelope} env2 The second envelope to unite.
* @returns {envelope} A new envelope.
*/
export function union(env1: envelope, env2: envelope): envelope;
}
/**
* A general geometry which can represent a point, line, polygon,
* mulitpoint, multilinestring
* @class geometry
*/
export class geometry {
constructor(isPath?: boolean, isClosed?: boolean);
/**
* Creates a new polygon or polyline form the geometry according to
* whether the geometry is closed.
* @returns {any} A new polyline or polygon geometry.
*/
factoryPoly(): any;
/**
* Creates a deep copy of this geometry.
* @returns {geometry} The new cloned geometry.
*/
clone(): geometry;
/**
* Iterates every vertex in the geometry and passes to the supplied
* callback. Return true from in the callback will break the iteration.
* @param {function} action Callback with the signature action(setIdx, idx, x, y, set).
*/
foreachVertex(action: (setIdx: number, idx: number, x: number, y: number, s: number[]) => void): void;
/**
* Returns the geometry's bounding box as an envelope.
* @returns {envelope} The bounding box of the geometry as an envelope.
*/
getBounds(): envelope;
/**
* Checks whether or not this geometry is closed.
* @returns {boolean} Result of the path check.
*/
getIsPath(): boolean;
/**
* Checks whether or not this geometry is closed.
* @returns {boolean} Result of the closed check.
*/
getIsClosed(): boolean;
/**
* Gets the number of sets in this geometry.
* @returns {number} Number of sets.
*/
getSetCount(): number;
/**
* Gets a set from this geometry's set collection by index, or, if no
* index is provided, gets the last set. Note: for polygons, first set
* is primary ring and subsequent ones are holes.
* @param {number} [idx] Index of the set to return.
* @returns {number[]} A set as an array of points in the form [xn,yn].
*/
getSet(idx: number): number[];
/**
* Adds a new set to this geometry's collection of sets.
* @param {number[]} s Set to add as an array of points in the form [xn,yn].
*/
pushSet(s: number[]): void;
/**
* Gets the last set in the geometry's set collection and removes it
* from the collection.
* @returns {number} Set removed as an array of points in the form [xn,yn].
*/
popSet(): number[];
/**
* Creates SVG path data from this geometry if it is a path.
* @returns {string} String of the SVG path or null the geometry is not a path.
*/
toSvgPathData(): string;
/**
* Adds point to the last set in geometry's set collection. If the
* geometry is empty, a new set is added to the geometry first.
* @param {point} pt The point to add.
* @returns {object} Object of the form {setIdx, idx} where setIdx is
* the 0-based index of the set the point was added to and idx is the
* 0-based index of the point in its set.
*/
addPointToLastSet(pt: point): { setIdx: number; idx: number; };
/**
* Tests the validity of this geometry. An open path geometry is valid
* if it has at least one set with at least two points. A closed
* geometry is valid if it has at least one set with at least three
* points. A point (non-path) geometry is always valid.
* @returns {geometry} valid geometry is true, otherwise false.
*/
isValid(): boolean;
/**
* Creates a wkt string from this geometry.
* @returns {string} A string of well known text.
*/
toString(): string;
toWkt(): string;
/**
* Finds the point in this geometry nearest to the given point.
* @param {point} pt Reference point.
* @returns {object} An object of the form {setIdx, ptIdx, pt, distance}
* where setIdx is the index of the set the point is in, ptIdx is the
* index of the point in the set, pt is the point object, and distance
* is the distance of the point to the reference point in map units.
*/
findNearestVertex(pt: point): { setIdx: number; ptIdx: number; pt: point; distance: number; };
/**
* Finds point along boundary of geometry nearest to the given point
* @param {point} pt Reference point.
* @param {boolean} [close] Flag to indicate whether this geometry
* should be treated as a closed geometry.
* @returns {object} An object of the form {setIdx, ptIdx, pt, distance}
* where setIdx is the index of the set the point is in, ptIdx is the
* index of the point in the set, pt is the point object, and distance
* is the distance of the point to the reference point in map units.
*/
findNearestSegment(pt: point, close?: boolean): { setIdx: number; ptIdx: number; pt: point; distance: number; };
/**
* Finds coordinates in map units of the midpoint of this geometry. If
* this geometry is an open path, the midpoint is the midpoint of the
* path. If this geometry is a closed path, the midpoint is the centroid
* of the polygon. If a set index is not provided, finds the labeling
* point for the last set in this geometry's set collection.
* @param {number} [idx] Index of set for which to find the labeling point.
* @returns {point} Midpoint of this geometry.
*/
getLabelingPoint(idx?: number): point;
/**
* Tests whether this geometry contains a given point/
* @param {point} pt The reference point.
* @returns {boolean} Result of the containment test.
*/
contains(pt: point): boolean;
}
/**
* Exposes static functions that act on or return geometries, including
* constructors for specific geometries such as polygon and polyline.
* @module geometry
*/
export module geometry {
/**
* A polyline object which is an open path geometry with one or more paths.
* @class polyline
*/
class polyline extends geometry {
constructor(geom: geometry);
/**
* Gets the underlying geometry of the polyline.
* @returns {geometry} The polyline's underlying geometry object.
*/
getGeometry(): geometry;
/**
* Creates a new polyline object from a deep copy of the underlying geometry.
* @returns {polyline} Thew new cloned polyline.
*/
clone(): polyline;
/**
* Gets number of lines in this polyline.
* @returns {number} Number of lines.
*/
getLineCount(): number;
/**
* Gets a line from this polyline's liune collection by index, or,
* if no index is provided, gets the last line.
* @param {number} [idx] Index of the line to return.
* @returns {number[]} A line as an array of points in the form [xn,yn].
*/
getLine(idx: number): number[];
/**
* Adds a new line to this polyline's line collection.
* @param {number[]} s Line to add as an array of points in the form [xn,yn].
*/
pushLine(s: number[]): void;
/**
* Gets the last line in the polyline's set collection and removes it
* from the collection.
* @returns {number} Line removed as an array of points in the form [xn,yn].
*/
popLine(): number[];
/**
* Calculates distance of a line in a polyline by index according
* to projected map cooordinates. If no index is provided, uses
* the last line in the polyline's set collection.
* @param {number} [idx] Index of the line for which to compute the distance.
* @returns {number} Length in projected units of the distance of the line.
*/
getProjectedDistance(idx: number): number;
/**
* Calculates distance of a line in a polyline by index according
* to actual distance. If no index is provided, uses the last line
* in the polyline's set collection.
* @param {number} [idx] Index of the line for which to compute the distance.
* @returns {number} Distance in meters of the line.
*/
getActualDistance(idx?: number): number;
/**
* Determines whether this polyline intersects a given geometry.
* @param {geometry} geom Geometry to test against.
* @returns {boolean} Result of the intersection test.
*/
intersects(geom: geometry): boolean;
}
/**
* A polyline object which is a closed path geometry with one or more paths.
* @class polygon
*/
class polygon extends geometry {
constructor(geom: geometry);
/**
* Gets the underlying geometry of the polygon.
* @returns {geometry} The polygon's underlying geometry object.
*/
getGeometry(): geometry;
/**
* Creates a new polygon object from a deep copy of the underlying geometry.
* @returns {polygon} Thew new cloned polygon.
*/
clone(): polygon;
/**
* Gets number of rings in this polygon.
* @returns {number} Number of rings.
*/
getRingCount(): number;
/**
* Gets a ring from this polygon's set collection by index, or,
* if no index is provided, gets the last ring.
* @param {number} [idx] Index of the ring to return.
* @returns {number[]} A ring as an array of points in the form [xn,yn].
*/
getRing(idx: number): number[];
/**
* Adds a new ring to this polygon's ring collection.
* @param {number[]} s Ring to add as an array of points in the form [xn,yn].
*/
pushRing(s: number[]): void;
/**
* Gets the last ring in the polygon's ring collection and removes it
* from the collection.
* @returns {number} Ring removed as an array of points in the form [xn,yn].
*/
popRing(): number[];
/**
* Calculates area of a ring in a polygon by index according
* to projected map cooordinates. If no index is provided, uses
* the last ring in the polygon's ring collection.
* @param {number} [idx] Index of the ring for which to compute the area.
* @returns {number} Area in square projected units of the ring.
*/
getProjectedArea(idx: number): number;
/**
* Calculates perimeter of a ring in a polygon by index according
* to projected map cooordinates. If no index is provided, uses
* the last ring in the polygon's ring collection.
* @param {number} [idx] Index of the ring for which to compute the perimeter.
* @returns {number} Length in projected units of the distance of the ring.
*/
getProjectedPerimeter(idx: number): number;
/**
* Calculates area of a ring in a polygon by index according
* to the actual area. If no index is provided, uses the last ring
* in the polygon's ring collection.
* @param {number} [idx] Index of the ring for which to compute the area.
* @returns {number} Area in square meters of the ring.
*/
getActualArea(idx?: number): number;
/**
* Calculates perimeter of a ring in a polygon by index according
* to actual distance. If no index is provided, uses the last ring
* in the polygon's ring collection.
* @param {number} [idx] Index of the ring for which to compute the perimeter.
* @returns {number} Length in meters of the perimeter of the ring.
*/
getActualPerimeter(idx?: number): number;
/**
* Determines whether this polygon intersects a given geometry.
* @param {geometry} geom Geometry to test against.
* @returns {boolean} Result of the intersection test.
*/
intersects(geom: geometry): boolean;
/**
* Determines whether this polyline overlaps a given geometry.
* @param {geometry} geom Geometry to test against.
* @returns {boolean} Result of the intersection test.
*/
overlaps(poly: polygon): boolean;
/**
* Convert this polygon into an array of OGC compliant polygons where
* the first set is a ring and all subsequent contained sets are holes.
* @returns {polygon[]} An array of OGC polygons.
*/
toMultiPolygon(): polygon[];
}
}
/**
* A style specification for geometry objects.
* @class geometryStyle
*/
export class geometryStyle {
constructor(options?: styleObj);
/**
* Gets path outline thickness in pixels.
* @returns {number} Thickness of path outline.
*/
getOutlineThicknessPix(): number;
/**
* Sets path outline thickness in pixels.
* @param {number} t Desired thickness.
*/
setOutlineThicknessPix(t: number): void;
/**
* Gets path outline color as a CSS style string.
* @returns {string} Outline color as a CSS style string.
*/
getOutlineColor(): string;
/**
* Sets path outline color from a CSS style string.
* @param {string} c Outline color as a CSS style string.
*/
setOutlineColor(c: string): void;
/**
* Gets path outline opacity in decimal format.
* @returns {number} Outline opacity.
*/
getOutlineOpacity(): number;
/**
* Set path outline opacity to a decimal between 0 and 1.
* @param {number} o Outline opacity.
*/
setOutlineOpacity(o: number): void;
/**
* Gets fill color as a CSS style string.
* @returns {string} Fill color as a CSS style string.
*/
getFillColor(): string;
/**
* Sets fill color as a CSS style string.
* @param {string} c Fill color as a CSS style string.
*/
setFillColor(c: string): void;
/**
* Gets fill opacity in decimal format.
* @returns {number} Fill opacity.
*/
getFillOpacity(): number;
/**
* Sets fill opacity to a decimal between 0 and 1.
* @param {number} o Fill opacity.
*/
setFillOpacity(o: number): void;
/**
* Gets the dash array as a string.
* @returns {string} Dash array as astring.
*/
getDashArray(): string;
/**
* Sets dash array string from a CSS style string. Defaults to solid
* stroke if no dash array string is provided.
* @param {string} [da] Dash array as a CSS style string.
*/
setDashArray(da: string): void;
}
/**
* Gets the mapsjs license.
* @returns {string} The license.
*/
export var license: string;
/**
* A simple point class with x and y coordinates.
* @class point
*/
export class point {
constructor(x: number, y: number);
/**
* Returns the x coordinate.
* @returns {number} The x coordinate.
*/
getX(): number;
/**
* Returns the y coordinate.
* @returns {number} The y coordinate.
*/
getY(): number;
/**
* Returns the x and y coordinates of this point as a pointObject.
* @returns {pointObject} Representaton of this point as an pointObject.
*/
toProps(): pointObject;
/**
* Equality comparer between this point and a given reference point.
* @param {point} pt Reference point.
* @returns {boolean} Result of the equality test.
*/
equals(pt: point): boolean;
/**
* Creates a point from this point offset by a given x and y distance.
* @param {number} dx The x offset.
* @param {number} dy The y offset.
* @returns {point} The offset point.
*/
createOffsetBy(dx: number, dy: number): point;
/**
* Creates new n-sided polygon around this point.
* @param {number} sides Number of polygon sides.
* @param {number} radius Distance to polygon points.
* @returns {polygon} The generated polygon.
*/
convertToPoly(side: number, radius: number): geometry.polygon;
/**
* Gets the wkt representation of this point.
* @returns {string} The well known text for this point.
*/
toString(): string;
/**
* Creates a deep copy of this point.
* @returns {point} The new cloned point.
*/
clone(): point;
/**
* Returns this point's bounding box.
* @returns {envelope} The bounding box of the point as an envelope.
*/
getBounds(): envelope;
/**
* Computes distance between this point and a given point in projected
* map units.
* @param {point} pt Point to which to compute distance.
* @returns {number} Distance from this point to the given point in
* projected map units.
*/
distanceTo(pt: point): number;
}
/**
* Exposes static functions that act on points.
* @module point
*/
export module point {
/**
* Computes the distance between two points in coordinate units.
* @param {number} x1 The x coordinate for the first point.
* @param {number} y1 The y coordinate for the first point.
* @param {number} x2 The x coordinate for the second point.
* @param {number} y2 The y coordinate for the second point.
* @returns {number} Distance in coordinate units.
*/
export function distance(x1: number, y1: number, x2: number, y2: number): number;
/**
* Computes the midpoint of two points.
* @param {number} x1 The x coordinate for the first point.
* @param {number} y1 The y coordinate for the first point.
* @param {number} x2 The x coordinate for the second point.
* @param {number} y2 The y coordinate for the second point.
* @return {point} Midpoint point.
*/
export function midpoint(x1: number, y1: number, x2: number, y2: number): point;
}
/**
* Exposes static functions related to the Spherical Mercator projection.
* @module sphericalMercator
*/
export module sphericalMercator {
/**
* Gets the EPSG number for Spherical Mercator.
* @return {number} ESPG number.
*/
export function getEpsg(): number;
/**
* Gets the minimum zoom level for this projection.
* @returns {number} Minimum zoom level.
*/
export function getMinZoomLevel(): number;
/**
* Sets the minimum zoom level for this projection. Normally this is
* set to 1.0 and should not be altered.
* @param {number} minZ Desired minimum zoom level.
*/
export function setMinZoomLevel(minZ: number): void;
/**
* Gets the maxmimum zoom level for this projection.
* @returns {number} Maximum zoom level.
*/
export function getMaxZoomLevel(): number;
/**
* Sets the maximum zoom level for this projection. Normally this is
* set to 20.0 and should not be altered.
* @param {number} maxZ1 Desired maximum zoom level.
*/
export function setMaxZoomLevel(maxZ: number): void;
/**
* Gets the tile height and width in pixels.
* @returns {number} The height and width of the tiles in pixels.
*/
export function getTileSizePix(): number;
/**
* Gets the display DPI, which defaults to 96. Note: The dpi is
* recomputed on page load complete.
* @returns {number} Dots per inch on display.
*/
export function getDpi(): number;
/**
* Set the display DPI, which defaults to 96. Note: The DPI is
* recomputed on page load complete.
* @param {number} dpi Dots per inch on display.
*/
export function setDpi(dpi: number): void;
/**
* Return the equitorial radius in meters for this projection.
* @returns {number} Equitorial radius in meters.
*/
export function getRadius(): number;
/**
* Returns equitorial circumference in meters for this projection
* @returns {number} Equitorial circumference in meters.
*/
export function getCircumference(): number;
/**
* Returns half the equitorial circumference in meters for this projection
* @returns {number} Half of the equitorial circumference in meters.
*/
export function getHalfCircumference(): number;
/**
* Get the envelope in map units for a given quadtree node, i.e. tile,
* based on the given x, y, and z quadtree coordinates.
* @param {number} x The x coordinate.
* @param {number} y The y coordinate.
* @param {number} z The z coordinate.
* @returns {envelope} Envelope of the tile in map units.
*/
export function getQuadTreeNodeToMapEnvelope(x: number, y: number, z: number): envelope;
/**
* Gets the envelope in map units of tiles in the quadtree from an
* evelope in map units and a zoom level.
* @param {envelope} env Envelope for which to find intersecting tiles.
* @param {number} z Zoom level with which to test for intersection.
* @returns {envelope} The envelope in map units of the tiles.
*/
export function getQuadTreeNodeRangeFromEnvelope(env: envelope, z: number): envelope;
/**
* Gets projected map units per pixel for a given zoom level.
* @param {number} zoomLevel Reference zoom level.
* @returns {number} Projection units per pixel.
*/
export function getProjectionUnitsPerPixel(zoomLevel: number): number;
/**
* Gets the required scale transform to apply to shapes so distance
* and area computations yield actual Earth-geodesic units instead of
* projected map units.
* @param {number} mapPtY Reference latitude for the computation.
* @returns {number} Scale transform multiplier.
*/
export function getActualShapeScaleTransform(mapPtY: number): number;
/**
* Gets actual, on-the-ground meters per pixel for a given zoom level
* and map point in map units.
* @param {point} mapPt Reference location for the computation.
* @param {number} z Reference zoom level.
* @returns {number} Meters per pixel multiplier.
*/
export function getActualUnitsPerPixel(mapPt: point, zoomLevel: number): number;
/**
* Gets the optimal zoom level for a given envelope in map units
* based on the envelope of visible device area in pixels.
* @param {envelope} envelopeMap Envelope in map units to display.
* @param {envelope} envelopeDevice Envelope in pixels of visible area.
* @returns {number} Optimal zoom level for viewing envelopeMap.
*/
export function getBestFitZoomLevelByExtents(envelopeMap: envelope, envelopeDevice: envelope): number;
/**
* Gets a quad-key from x, y, and z coordinates.
* @param {number} x The x coordinate.
* @param {number} y The y coordinate.
* @param {number} z The z coordinate.
* @returns {string} Quad-key string.
*/
export function getQuadKeyFromXYZ(x: number, y: number, z: number): string;
/**
* Gets x, y, and z coordinates as an object from a given quad-key.
* @param {string} key Reference quad-key.
* @return {object} JavaScript object of the form {x,y,z}.
*/
export function getXYZFromQuadKey(key: string): { x: number; y: number; z: number; };
/**
* Project a point from latitude/longitude to Spherical Mercator.
* @param {point} lonLat Point object in latitude/longitude.
* @returns {point} The same point in Spherical Mercator.
*/
export function projectFromLatLon(lonLat: point): point;
/**
* Project a point from Spherical Mercator to latitude/longitude.
* @param {point} mapPt Point object in Spherical Mercator.
* @returns {point} The same point in latitude/longitude.
*/
export function deprojectToLatLon(mapPt: point): point;
}
/**
* A geometry object decorated with a geometry style object
* @class styledGeometry
*/
export class styledGeometry {
constructor(geom: geometry, gStyle?: geometryStyle);
/**
* Set this styledGeometry's geometry.
* @param {geometry} g A new Geometry.
*/
setGeometry(g: geometry): void;
/**
* Set this styledGeometry's geometryStyle.
* @param {geometryStyle} gs A new styledGeometry.
*/
setGeometryStyle(gs: geometryStyle): void;
/**
* Gets the styledGeometry's underlying geometry object.
* @returns {geometry} The underlying geometry.
*/
getGeometry(): geometry;
/**
* Gets the styledGeometry's underlying geometryStyle object.
* @returns {geometryStyle} The underlying geometry style.
*/
getGeometryStyle(): geometryStyle;
/**
* Gets path outline thickness in pixels.
* @returns {number} Thickness in pixels.
*/
getOutlineThicknessPix(): number;
/**
* Sets path outline thickness in pixels.
* @param {number} t Thickness in pixels.
*/
setOutlineThicknessPix(t: number): void;
/**
* Gets path outline color as a CSS style string.
* @returns {string} Outline color as a CSS style string.
*/
getOutlineColor(): string;
/**
* Gets path outline opacity in decimal format.
* @param {number} Outline opacity.
*/
setOutlineColor(c: string): void;
/**
* Gets path outline opacity in decimal format.
* @returns {number} Outline opacity.
*/
getOutlineOpacity(): number;
/**
* Set path outline opacity to a decimal between 0 and 1.
* @param {number} o Outline opacity.
*/
setOutlineOpacity(o: number): void;
/**
* Gets fill color as a CSS style string.
* @returns {string} Fill color as a CSS style string.
*/
getFillColor(): string;
/**
* Sets fill color as a CSS style string.
* @param {string} c Fill color as a CSS style string.
*/
setFillColor(c: string): void;
/**
* Gets fill opacity in decimal format.
* @returns {number} Fill opacity.
*/
getFillOpacity(): number;
/**
* Sets fill opacity to a decimal between 0 and 1.
* @param {number} o Fill opacity.
*/
setFillOpacity(o: number): void;
/**
* Gets the dash array as a string.
* @returns {string} Dash array as astring.
*/
getDashArray(): string;
/**
* Sets dash array string from a CSS style string. Defaults to solid
* stroke if no dash array string is provided.
* @param {string} [da] Dash array as a CSS style string.
*/
setDashArray(da: string): void;