-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
1217 lines (1026 loc) · 45.6 KB
/
index.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 arcgis-to-geojson-utils 10.5
// Project: http://resources.arcgis.com/en/help/arcgis-rest-api/
// Definitions by: Jeff Jacobson <https://github.com/JeffJacobson>
// Definitions: https://github.com/WSDOT-GIS/arcgis-rest-api-typescript
export type HtmlPopupType = "esriServerHTMLPopupTypeNone" |
"esriServerHTMLPopupTypeAsURL" | "esriServerHTMLPopupTypeAsHTMLText";
export type esriFieldType =
"esriFieldTypeBlob" | "esriFieldTypeDate" | "esriFieldTypeDouble" | "esriFieldTypeGeometry" |
"esriFieldTypeGlobalID" | "esriFieldTypeGUID" | "esriFieldTypeInteger" | "esriFieldTypeOID" |
"esriFieldTypeRaster" | "esriFieldTypeSingle" | "esriFieldTypeSmallInteger" |
"esriFieldTypeString" | "esriFieldTypeXML";
export interface IFeature {
geometry: IGeometry;
attributes: {
[key: string]: string | number | boolean | null
};
}
export interface IField {
name: string;
type: esriFieldType;
alias?: string;
length?: number;
domain?: IDomain;
}
export interface IFeatureSet extends IHasZM {
objectIdFieldName?: string; // optional
globalIdFieldName?: string; // optional
displayFieldName?: string; // optional
geometryType?: esriGeometryType; // for feature layers only
spatialReference?: SpatialReference; // for feature layers only.
fields?: IField[];
features: IFeature[];
}
export interface IClassBreaks {
type: "classBreaksDef";
classificationField: string; // "<field name>",
classificationMethod: "esriClassifyNaturalBreaks" | "esriClassifyEqualInterval" | "esriClassifyQuantile" |
"esriClassifyStandardDeviation" | "esriClassifyGeometricalInterval";
breakCount: number;
standardDeviationInterval: 1 | 0.5 | 0.33 | 0.25; // use when classificationMethod is esriClassifyStandardDeviation.
// optional. use to normalize class breaks
normalizationType: "<esriNormalizeByField | esriNormalizeByLog | esriNormalizeByPercentOfTotal>";
normalizationField: "<field name>"; // use when normalizationType is esriNormalizeByField
// optional. use to define symbol for classes
baseSymbol: ISymbol;
colorRamp: ColorRamp;
}
export interface IUniqueValue {
type: "uniqueValueDef";
uniqueValueFields: [string, string, string] | [string, string] | [string];
fieldDelimiter: "field_delimiter_character";
// optional. use to define symbol for unique values
baseSymbol?: ISymbol;
colorRamp?: ColorRamp;
}
export type Color = [number, number, number, number];
export type ColorRamp = IAlgorithmicColorRamp | IMultipartColorRamp;
export interface IAlgorithmicColorRamp {
"type": "algorithmic";
"fromColor": Color;
"toColor": Color;
"algorithm": "esriHSVAlgorithm" | "esriCIELabAlgorithm" | "esriLabLChAlgorithm";
}
export interface IMultipartColorRamp {
"type": "multipart";
"colorRamps": IAlgorithmicColorRamp[];
}
export interface IDataSource {
type: string;
}
export interface IDataSourceWithWorkspaceID extends IDataSource {
workspaceId: string; // "<registered workspace id>",
}
export interface IDataSourceWithDataSourceName extends IDataSource {
dataSourceName: string; // "<table name>",
}
export interface ITableDataSource extends IDataSourceWithWorkspaceID, IDataSourceWithDataSourceName {
type: "table";
gdbVersion: string; // "<version name>"
}
export interface IQueryTableDataSource extends IDataSourceWithWorkspaceID {
type: "queryTable";
query: string; // "<SQL query>",
oidFields: string; // "<field1>,<field2>,<field3>",
geometryType: esriGeometryType;
spatialReference: SpatialReference;
}
export interface IRasterDataSource extends IDataSourceWithWorkspaceID , IDataSourceWithDataSourceName {
type: "raster";
}
export interface IJoinTableDataSource extends IDataSource {
type: "joinTable";
leftTableSource: IDataSource;
rightTableSource: IDataSource;
leftTableKey: string; // "<field name from left table>",
rightTableKey: string; // "<field name from right table>",
joinType: "esriLeftOuterJoin" | "esriLeftInnerJoin";
}
export interface IDomain {
type: "codedValue" | "inherited" | "range";
}
export interface IRangeDomain extends IDomain {
type: "range";
name: string;
range: [number, number];
}
export interface ICodedValueDomain extends IDomain {
type: "codedValue";
name: string;
codedValues: Array<{
name: string,
code: number | string
}>;
}
export interface IInheritedDomain {
type: "inherited";
}
export interface IGeodataTransformation {
geodataTransform: "Polynomial" | "Projective" | "Identity";
geodataTransformArguments: ITransformationArguments | {
spatialReference: SpatialReference
};
}
export interface ITransformPoint {
x: number;
y: number;
}
export interface ITransformationArguments {
sourcePoints: ITransformPoint[];
targetPoints: ITransformPoint[];
coeffx: number[]; // array of doubles
coeffy: number[]; // array of doubles
inverseCoeffx: number[]; // array of doubles
inverseCoeffy: number[]; // array of doubles
spatialReference: SpatialReference;
/**
* integer: 1, 2, or 3. First order requires at least 3 pairs of control points; second order requires at
* least 6 pairs of control points; third order requires at least 10 pairs of control points;
* use more control points to get better fit (smaller RMS)
*/
polynomialOrder: 1 | 2 | 3;
}
export interface IPolynomialTransformation extends IGeodataTransformation {
geodataTransform: "Polynomial";
geodataTransformArguments: ITransformationArguments;
}
export interface IProjectiveTransformation extends IGeodataTransformation {
geodataTransform: "Projective";
geodataTransformArguments: ITransformationArguments;
}
export interface IIdentityTransformation extends IGeodataTransformation {
geodataTransform: "Identity";
geodataTransformArguments: {
spatialReference: SpatialReference
};
}
export type Position2D = [number, number];
export type Position = Position2D | [number, number, number] | [number, number, number, number];
export interface ICircularArc {
"c": [Position, Position2D];
}
export interface IArc {
"a": [
/** End point: x, y, <z>, <m> */
Position,
/** Center point: center_x, center_y */
Position2D,
/** minor */
number,
/** clockwise */
number, // clockwise
/** rotation */
number,
/** axis */
number,
/** ratio */
number
];
}
export type ElipticArc = IArc;
export interface IOldCircularArc {
"a": [
Position, // End point: x, y, <z>, <m>
Position2D, // Center point: center_x, center_y
number, // minor
number // clockwise
];
}
export interface IBezierCurve {
"b": [
Position,
Position2D,
Position2D
];
}
export type JsonCurve = ICircularArc | IArc | IOldCircularArc | IBezierCurve;
export type SpatialReference = ISpatialReferenceWkid | ISpatialReferenceWkt;
export interface ISpatialReferenceWkid {
wkid?: number;
latestWkid?: number;
vcsWkid?: number;
latestVcsWkid?: number;
}
export interface ISpatialReferenceWkt {
wkt?: string;
latestWkt?: string;
}
export interface IGeometry {
spatialReference?: SpatialReference;
}
export interface IHasZM {
hasZ?: boolean;
hasM?: boolean;
}
export interface IPoint extends IGeometry {
x: number;
y: number;
z?: number;
m?: number;
}
export interface IPolyline extends IHasZM, IGeometry {
paths: Position[][];
}
export interface IPolylineWithCurves extends IHasZM, IGeometry {
curvePaths: Array<Array<Position | JsonCurve>>;
}
export interface IPolygon extends IHasZM, IGeometry {
rings: Position[][];
}
export interface IPolygonWithCurves extends IHasZM, IGeometry {
curveRings: Array<Array<Position | JsonCurve>>;
}
export interface IMultipoint extends IHasZM, IGeometry {
points: Position[];
}
export interface IEnvelope extends IGeometry {
xmin: number;
xmax: number;
ymin: number;
ymax: number;
zmin?: number;
zmax?: number;
mmin?: number;
mmax?: number;
}
export type esriGeometryType = "esriGeometryPoint" | "esriGeometryMultipoint" | "esriGeometryPolyline" |
"esriGeometryPolygon" | "esriGeometryEnvelope";
export interface IHistogram {
/**
* int, number of bins
*/
"size": number;
/** minimum value */
"min": number;
/** maximum value */
"max": number;
/**
* integer(64bit), counts of pixels in each bin. The width of each bin is (max-min)/size.
*/
"counts": number[];
}
export type ImageCoordinateSystem = IIcsBasedImageCoordinateSystem | IIcsBasedImageCoordinateSystem;
export interface IIcsImageCoordinateSystem {
icsid: number;
}
export interface IIcsBasedImageCoordinateSystem {
/**
* the full ics json, which include transformations and map spatial reference information and specific to each
* image.
* @see http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Image_coordinate_systems/02r30000029w000000/
*/
ics: object;
}
export type PointLabelPlacement = "esriServerPointLabelPlacementAboveCenter" | "esriServerPointLabelPlacementAboveLeft" |
"esriServerPointLabelPlacementAboveRight" | "esriServerPointLabelPlacementBelowCenter" |
"esriServerPointLabelPlacementBelowLeft" | "esriServerPointLabelPlacementBelowRight" |
"esriServerPointLabelPlacementCenterCenter" | "esriServerPointLabelPlacementCenterLeft" |
"esriServerPointLabelPlacementCenterRight";
export type LineLabelPlacement = "esriServerLinePlacementAboveAfter" |
"esriServerLinePlacementAboveAlong" |
"esriServerLinePlacementAboveBefore" |
"esriServerLinePlacementAboveStart" |
"esriServerLinePlacementAboveEnd" |
"esriServerLinePlacementBelowAfter" |
"esriServerLinePlacementBelowAlong" |
"esriServerLinePlacementBelowBefore" |
"esriServerLinePlacementBelowStart" |
"esriServerLinePlacementBelowEnd" |
"esriServerLinePlacementCenterAfter" |
"esriServerLinePlacementCenterAlong" |
"esriServerLinePlacementCenterBefore" |
"esriServerLinePlacementCenterEnd";
export type PolygonLabelPlacement = "esriServerPolygonPlacementAlwaysHorizontal";
export type LabelPlacement = PointLabelPlacement | LineLabelPlacement | PolygonLabelPlacement;
export interface ILabelClass {
"labelPlacement": LabelPlacement;
/**
* Use labelExpression to adjust the formatting of labels. A label expression is limited to a single line of code.
* Apart from specifying a string value and/or an attribute field value, the following keywords are supported
*
* CONCAT
* Concatenate two values.
* @example
* "\"State: \" CONCAT [State_Name]"
*
* NEWLINE
* Insert a new line.
* @example
* "\"State: \" CONCAT NEWLINE CONCAT [State_Name]"
*
* UCASE([Field])
* Convert string value to uppercase string.
* @example
* "\"State: \" CONCAT UCASE([State_Name])"
* LCASE([Field])
* Convert string value to lowercase string.
* @example
* "\"State: \" CONCAT LCASE([State_Name])"
*
* ROUND([Field], n)
* Round a decimal number to set number of decimals as specified by (n).
* @example
* "\"Area: \" CONCAT ROUND([Area], 3)"
*
* FORMATDATETIME([Field], "FormatString")
* Format a date/time value with the specified format (FormatString*). The following keywords are recognized:
* d—Day of the month
* ddd—Abbreviated day of the week
* dddd—Full day of the week
* M—Month in number
* MMM—Abbreviated month name
* MMMM—Full month name
* y—Two digit year
* yyyy—Four digit year
* h—Hour in 12-hour format
* H—Hour in 24-hour format
* m—Two digit minute
* s—Two digit second
* FormatString also supports full range of Python date/time formats.
* @example
* "\"Date Modified: \" CONCAT FORMATDATETIME([modified],\"dddd, MMM d, yyyy\")"
*/
"labelExpression": string;
"useCodedValues": boolean;
"symbol": ITextSymbol;
"minScale": number;
"maxScale": number;
/**
* Use where to determine the features that are labeled with the label class that contains it.
*/
"where": string;
}
export interface ILabelingInfo extends Array<ILabelClass> { }
export interface ILayerSource {
type: "mapLayer" | "dataLayer";
}
export interface IDynamicMapLayer extends ILayerSource {
type: "mapLayer"; // required
mapLayerId: number; // required
gdbVersion?: "<version name>";
}
export interface IDynamicDataLayer extends ILayerSource {
type: "dataLayer"; // required
dataSource: IDataSource; // required
fields: IField[] | null;
}
export interface ILayerReference {
id: number;
name: string;
}
export type TimeOffsetUnits = "esriTimeUnitsCenturies" | "esriTimeUnitsDays" | "esriTimeUnitsDecades" |
"esriTimeUnitsHours" | "esriTimeUnitsMilliseconds" | "esriTimeUnitsMinutes" |
"esriTimeUnitsMonths" | "esriTimeUnitsSeconds" | "esriTimeUnitsWeeks" | "esriTimeUnitsYears" |
"esriTimeUnitsUnknown";
export interface ITimeInfo {
startTimeField: string; // "<startTimeFieldName>",
endTimeField: string; // "<endTimeFieldName>",
trackIdField: string; // "<trackIdFieldName>",
timeExtent: [number, number];
timeReference: {
timeZone: string,
respectsDaylightSaving: boolean
};
timeInterval: number;
timeIntervalUnits: string;
// the default time-related export options for this layer
exportOptions: {
// If true, use the time extent specified by the time parameter
useTime: boolean,
// If true, draw all the features from the beginning of time for that data
timeDataCumulative: boolean,
// Time offset for this layer so that it can be overlaid on the top of a previous or future time period
timeOffset: number,
timeOffsetUnits: TimeOffsetUnits
};
hasLiveData: boolean;
}
export interface ILayer {
currentVersion: number; // Added at 10.0 SP1
id: number;
name: string;
type: "Layer" | "Table"; // string, // "<layerOrTableType>", // for tables, the type will be "Table"
description: string;
definitionExpression: string;
// properties specific to layers only
geometryType: esriGeometryType;
hasZ: boolean; // added in 10.1
hasM: boolean; // added in 10.1
copyrightText: string; // "<copyrightText>",
parentLayer: ILayerReference;
subLayers: ILayerReference[];
minScale: number;
maxScale: number;
effectiveMinScale: number;
effectiveMaxScale: number;
defaultVisibility: boolean;
extent: IEnvelope;
// from 10 onward - if the layer / table supports querying and exporting maps based on time
timeInfo: ITimeInfo;
// from 10.0 onward - for feature layers only
drawingInfo: {
renderer: IRenderer,
transparency: number,
labelingInfo: any | null // <labelingInfo> // TODO: figure out info for this type.
};
// from 10 onward - indicates whether the layer / table has attachments or not
hasAttachments: boolean;
// from 10 onward - indicates whether the layer / table has htmlPopups
htmlPopupType: HtmlPopupType;
// layer / table field information
displayField: string;
// the typeIdField is new at 10.0
typeIdField: string;
// from 10.0 fields of type (String, Date, GlobalID, GUID and XML) have an additional length property
// from 10.0 onward the field domains are also included
fields: IField[];
// new at 10.0 - if the layer has sub-types, they'll be included
types: Array<
{
id: number,
name: number,
domains: {
[domainField: string]: IDomain
}
}
>;
// new at 10 - if the layer / table participates in relationships with other layers / tables
relationships: Array<{
id: number,
name: string,
relatedTableId: number,
role: "esriRelRoleOrigin" | "esriRelRoleDestination", // Added at 10.1
// Added at 10.1
cardinality: "esriRelCardinalityOneToOne" | "esriRelCardinalityOneToMany" | "esriRelCardinalityManyToMany",
keyField: string, // "<keyFieldName2>",//Added at 10.1
composite: boolean, // Added at 10.1
// Added in 10.1. Returned only for attributed relationships
relationshipTableId: number, // <attributedRelationshipClassTableId>,
// Added in 10.1. Returned only for attributed relationships
keyFieldInRelationshipTable: string // "<key field in AttributedRelationshipClass table that matches keyField>"
}>;
// Added at 10.1
maxRecordCount: number;
// Added at 10.1 - if the layer / table supports modifying its renderer, data source, or join information.
canModifyLayer: boolean;
// Added at 10.1 - if the layer / table supports statistical functions in query operation.
supportsStatistics: boolean;
// Added at 10.1 - if the layer / table supports orderBy parameter in query operation.
supportsAdvancedQueries: boolean;
// Added at 10.1 - if the layer has labels defined on it.
hasLabels: boolean;
// Added at 10.1 - if the layer renders its symbols based on scale.
canScaleSymbols: boolean;
// comma separated list of supported capabilities - e.g. "Map,Query,Data"
capabilities: string; // "<capabilities>",
// comma separated list of supported query output formats - e.g. "JSON, AMF"
supportedQueryFormats: string; // "<supported query output formats>",
// true if the layer is versioned.
isDataVersioned: boolean;
// Added at 10.1 SP1.
// Added at 10.1 SP1.
ownershipBasedAccessControlForFeatures: { allowOthersToQuery: boolean };
// Added at 10.3 - container for below properties.
advancedQueryCapabilities: {
// Added at 10.2.
useStandardizedQueries: boolean,
// Added at 10.3.1.
supportsStatistics: boolean,
// Added at 10.3.
supportsOrderBy: true,
// Added at 10.3.
supportsDistinct: true,
// Added at 10.3.
supportsPagination: false,
// Added at 10.3.
supportsTrueCurve: true
};
}
// TODO: Add types from http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Mosaic_rule_objects/02r3000000s4000000/
export type MosaicMethod =
/** None */
"esriMosaicNone" |
/** Center */
"esriMosaicCenter" |
/** NorthWest */
"esriMosaicNorthwest" |
/** Nadir */
"esriMosaicNadir" |
/** Viewpoint */
"esriMosaicViewpoint" |
/** ByAttribute */
"esriMosaicAttribute" |
/** LockRaster */
"esriMosaicLockRaster" |
/** Seamline */
"esriMosaicSeamline";
export interface IMosaicRule {
mosaicMethod: MosaicMethod;
where: string; // "<where>", //Use where clause to define a subset of rasters used in the mosaic, be aware that the rasters may not be visible at all scales
sortField: string; // "<sortFieldName>", //The field name used together with esriMosaicAttribute method
sortValue: number; // The base sort value used together with esriMosaicAttribute method and sortField parameter
ascending: boolean; // Indicate whether to use ascending or descending order.
lockRasterIds: number[]; // Lock a few rasters in the image service. Used together with esriMosaicLockRaster. These rasters are forced to be visible at all scales.Be aware of the maxMosaicImageCount limit of the service.
viewpoint: IPoint; // Use a view point along with esriMosaicViewpoint.
fids: number[]; // use the raster id list to define a subset of rasters used in the mosaic, be aware that the rasters may not be visible at all scales.
mosaicOperation: "MT_FIRST" | "MT_LAST" | "MT_MIN" | "MT_MAX" | "MT_MEAN" | "MT_BLEND" | "MT_SUM"; // Use the mosaic operation to resolve overlap pixel values: from first or last raster, use the min, max or mean of the pixel values, or blend them.
itemRenderingRule?: any; // <renderingRule> optional. new at 10.2. the rendering rule applies on items before mosaicking.
multidimensionalDefinition?: IDimensionalDefinition[]; // optional. new at 10.3. filtering by variable/dimensions
}
export interface IDimensionalDefinition {
variableName: string;
dimensionName: string;
/**
* each element can be a single value, or an array of two values (lower and upper bound)
*/
values: Array<number | number[]>;
isSlice?: boolean;
}
export type RotationType = "arithmetic" | "geographic";
export interface IRenderer {
type: "simple" | "uniqueValue" | "classBreaks";
rotationType: RotationType;
rotationExpression: string;
}
export interface ISimpleRenderer extends IRenderer {
type: "simple";
symbol: ISymbol;
label: string;
description: string;
}
export interface IUniqueValueRenderer extends IRenderer {
type: "uniqueValue";
field1: string;
field2: string;
field3: string;
fieldDelimiter: string;
defaultSymbol: ISymbol;
defaultLabel: string;
uniqueValueInfos: [
{
value: string,
label: string,
description: string,
symbol: ISymbol
}
];
}
export interface IClassBreaksRenderer extends IRenderer {
type: "classBreaks";
field: string;
classificationMethod: string;
normalizationType: "esriNormalizeByField" | "esriNormalizeByLog" | "esriNormalizeByPercentOfTotal";
normalizationField: string; // when normalizationType is esriNormalizeByField
normalizationTotal: number; // when normalizationType is esriNormalizeByPercentOfTotal
defaultSymbol: ISymbol;
defaultLabel: string;
backgroundFillSymbol: ISimpleFillSymbol; // supported only for polygon features
minValue: number;
classBreakInfos: [
{
classMinValue?: number, // optional
classMaxValue: number,
label: string,
description: string,
symbol: ISymbol
}
];
}
export type SimpleMarkerSymbolStyle = "esriSMSCircle" | "esriSMSCross" | "esriSMSDiamond" | "esriSMSSquare" |
"esriSMSX" | "esriSMSTriangle";
export type SimpleLineSymbolStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" |
"esriSLSNull" | "esriSLSSolid";
export type SimpleFillSymbolStyle = "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" |
"esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" |
"esriSFSSolid" | "esriSFSVertical";
export type SymbolType = "esriSLS" | "esriSMS" | "esriSFS" | "esriPMS" | "esriPFS" | "esriTS";
export interface ISymbol {
"type": SymbolType;
"style"?: string;
}
export interface ISimpleLineSymbol extends ISymbol {
"type": "esriSLS";
"style"?: SimpleLineSymbolStyle;
"color"?: Color;
"width"?: number;
}
export interface IMarkerSymbol extends ISymbol {
"angle"?: number;
"xoffset"?: number;
"yoffset"?: number;
}
export interface ISimpleMarkerSymbol extends IMarkerSymbol {
"type": "esriSMS";
"style"?: SimpleMarkerSymbolStyle;
"color"?: Color;
"size"?: number;
"outline"?: ISimpleLineSymbol;
}
export interface ISimpleFillSymbol extends ISymbol {
"type": "esriSFS";
"style"?: SimpleFillSymbolStyle;
"color"?: Color;
"outline"?: ISimpleLineSymbol; // if outline has been specified
}
export interface IPictureSourced {
/**
* Relative URL for static layers and full URL for dynamic layers.
* Access relative URL using http://<mapservice-url>/<layerId1>/images/<imageUrl11>
*/
"url"?: string;
"imageData"?: string; // "<base64EncodedImageData>",
"contentType"?: string;
"width"?: number;
"height"?: number;
"angle"?: number;
"xoffset"?: number;
"yoffset"?: number;
}
export interface IPictureMarkerSymbol extends IMarkerSymbol, IPictureSourced {
"type": "esriPMS";
}
export interface IPictureFillSymbol extends ISymbol, IPictureSourced {
"type": "esriPFS";
"outline"?: ISimpleLineSymbol; // if outline has been specified
"xscale"?: number;
"yscale"?: number;
}
export interface IFont {
"family"?: string; // "<fontFamily>",
"size"?: number; // <fontSize>,
"style"?: "italic" | "normal" | "oblique";
"weight"?: "bold" | "bolder" | "lighter" | "normal";
"decoration"?: "line-through" | "underline" | "none";
}
export interface ITextSymbol extends IMarkerSymbol {
"type": "esriTS";
"color"?: Color;
"backgroundColor"?: Color;
"borderLineSize"?: number; // <size>,
"borderLineColor"?: Color;
"haloSize"?: number; // <size>,
"haloColor"?: Color;
"verticalAlignment"?: "baseline" | "top" | "middle" | "bottom";
"horizontalAlignment"?: "left" | "right" | "center" | "justify";
"rightToLeft"?: boolean;
"kerning"?: boolean;
"font"?: IFont;
"text"?: string; // only applicable when specified as a client-side graphic.
}
export interface IBasemap {
basemapLayers: IBaseMapLayer[];
title: string;
}
export interface IBaseMapLayer {
/**
* A unique identifying string for the layer.
*/
id: string;
/**
* Boolean property determining whether the basemap layer appears on top of all operational layers (true) or beneath all operational layers (false). Typically, this value is set to true on reference layers such as road networks, labels, or boundaries. The default value is false.
*/
isReference?: boolean;
/**
* The degree of transparency applied to the layer, where 0 is full transparency and 1 is no transparency.
*/
opacity?: number;
/**
* A special string identifier used when the basemap is from Bing Maps or OpenStreetMap. When this property is included, the url property is not required. Acceptable values include: OpenStreetMap | BingMapsAerial | BingMapsRoad | BingMapsHybrid
*/
type?: "OpenStreetMap" | "BingMapsAerial" | "BingMapsRoad" | "BingMapsHybrid";
/**
* The URL to the layer.
*/
url?: string;
/**
* Boolean property determining whether the layer is initially visible in the web map.
*/
visibility?: boolean;
}
export interface IBookmark {
extent: IEnvelope;
name: string;
}
export interface IDrawingInfo {
/**
* A Boolean indicating whether symbols should stay the same size in screen units as you zoom in. A value of true means the symbols stay the same size in screen units regardless of the map scale.
*/
fixedSymbols: boolean;
/**
* A renderer object, defined using the syntax of the ArcGIS REST API. This provides the symbology for the layer.
*/
renderer: IRenderer;
}
export interface IFeatureCollection {
layers: ILayer[];
showLegend?: boolean;
}
export interface ILayerDefinitionField extends IField {
editable?: boolean;
nullable?: boolean;
}
export interface ILayerDefinition {
/**
* An optional SQL-based definition expression string that narrows the data to be displayed in the layer. Used with feature services and single layers from ArcGIS for Server map services.
* @example
* "STATE_NAME='Kansas' and POP2007>25000"
*/
definitionExpression?: string;
/** A string containing the name of the field that best summarizes the feature. Values from this field are used by default as the titles for pop-up windows. */
displayField: string;
/** A drawingInfo object containing drawing, labeling, and transparency information for the layer. */
drawingInfo: IDrawingInfo;
/** An array of field objects containing information about the attribute fields for the feature collection or layer. */
fields: ILayerDefinitionField;
/**
* A string defining the type of geometry used in the layer definition. Available values are: esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryEnvelope.
*
* This property is used with feature collections and CSV files. The only supported geometry for CSV files is esriGeometryPoint.
*/
geometryType: esriGeometryType;
/** A Boolean indicating whether attachments should be loaded for the layer. */
hasAttachments: boolean;
/** A number representing the maximum scale at which the layer definition will be applied. The number is the scale's denominator; thus, a value of 2400 represents a scale of 1/2,400. A value of 0 indicates that the layer definition will be applied regardless of how far you zoom in. */
maxScale: number;
/** A number representing the minimum scale at which the layer definition will be applied. The number is the scale's denominator; thus, a value of 2400 represents a scale of 1/2,400. */
minScale: number;
/** A string containing a unique name for the layer that can be displayed in a legend. */
name: string;
/** A string indicating the name of the object ID field in the dataset. */
objectIdField: string;
/**
* An array of template objects describing features that can be created in this layer. Templates are used with map notes, other feature collections, and editable web-based CSV layers. They are not used with ArcGIS feature services, which already have feature templates defined in the service.
*
* Templates are defined as a property of the layer definition when there are no types defined; otherwise, templates are defined as properties of the types.
*/
templates: ITemplate;
/** A string indicating whether the layerDefinition applies to a Feature Layer or a Table. */
type: string;
/** A string containing the name of the field holding the type ID for the features, if types exist for the dataset. Each available type has an ID, and each feature's typeIdField can be read to determine the type for each feature. */
typeIdField: string;
/**
* An array of type objects available for the dataset. This is used when the typeIdField is populated.
* Types contain information about the combinations of attributes that are allowed for features in the dataset. Each feature in the dataset can have a type, indicated in its typeIdField.
*/
types: IType;
}
export interface IFieldInfo {
/**
* A string containing the field name as defined by the service.
*/
fieldName: string;
/**
* A format object used with numerical or date fields to provide more detail about how the value should be displayed in a web map pop-up window.
*/
format?: IFormat;
/**
* A Boolean determining whether users can edit this field.
*/
isEditable: boolean;
/**
* A string containing the field alias. This can be overridden by the web map author.
*/
label: string;
/**
* A string determining what type of input box editors see when editing the field. Applies only to string fields. Acceptable values are as follows:
* textbox — A single-line input box
* textarea — A multiple-line input box
* richtext — A rich text editor allowing for bold text, highlighting, and so forth
*/
stringFieldOption: "textbox" | "textarea" | "richtext";
/**
* A string providing an editing hint for editors of the field. This string can provide a short description of the field and how editors should format or supply its value.
*/
tooltip: string;
/**
* A Boolean determining whether the field is visible in the pop-up window.
*/
visible: true;
}
export interface IFormat {
dateFormat?:
/** 12/30/1997 */
"shortDate" |
/** 30/12/1997 */
"shortDateLE" |
/** December 30, 1997 */
"longMonthDayYear" |
/** 30 Dec 1997 */
"dayShortMonthYear" |
/** Tuesday, December 30, 1997 */
"longDate" |
/** 12/30/1997 6:00 PM */
"shortDateShortTime" |
/** 30/12/1997 6:00 PM */
"shortDateLEShortTime" |
/** 12/30/1997 18:00 */
"shortDateShortTime24" |
/** 30/12/1997 18:00 */
"shortDateLEShortTime24" |
/** 12/30/1997 5:59:59 PM */
"shortDateLongTime" |
/** 30/12/1997 5:59:59 PM */
"shortDateLELongTime" |
/** 12/30/1997 17:59:59 */
"shortDateLongTime24" |
/** 30/12/1997 17:59:59 */
"shortDateLELongTime24" |
/** December 1997 */
"longMonthYear" |
/** Dec 1997 */
"shortMonthYear" |
/** 1997 */
"year";
/**
* A Boolean used with numerical fields.
* A value of true allows the number to have a digit (or thousands) separator when the value appears in pop-up windows.
* Depending on the locale, this separator is a decimal point or a comma. A value of false means that no separator will be used.
*/
digitSeparator?: string;
/**
* An integer used with numerical fields to specify the number of supported decimal places that should appear in pop-up windows. Any places beyond this value are rounded.
*/
places?: number;
}
export interface IWebMapLayer {
/** A featureSet object containing the geometry and attributes of the features in the layer. Used with feature collections only. */
featureSet: IFeatureSet;
/** A number indicating the index position of the layer in the WMS or map service. */
id: number;
/** An array of layerDefinition objects defining the attribute schema and drawing information for the layer. */
layerDefinition: ILayerDefinition;
/** A string URL to a service that should be used for all queries against the layer. Used with hosted tiled map services on ArcGIS Online when there is an associated feature service that allows for queries. */
layerUrl: string;
/** A string URL to a legend graphic for the layer. Used with WMS layers. The URL usually contains a GetLegendGraphic request. */
legendUrl: string;
/** A string containing a unique name for the layer. Used with WMS layers, where it can sometimes be derived from the layer's index position. */
name: string;
/** A user-friendly string title for the layer that can be used in a table of contents. Used with WMS layers. */
title: string;
/** A popupInfo object defining the pop-up window content for the layer. */
popupInfo: IPopupInfo;
}