· 3 years ago · Nov 09, 2021, 12:50 PM
1/* Olympic City Editing Adapter */
2
3/* Actions */
4const zoom = "olympicZoom";
5const removeFeatureHighLight = "olympicRemoveFeatureHighlight";
6const highlight = "olympicHighlight";
7/* Action params */
8
9const textOptions = {
10 text:"", // default "Sample Text"
11 font:"", // default: 10px sans-serif
12 fill:color, // default #333
13 stroke:[color, width],// default No Stroke applied
14 textAlign: "center",// default center values: ['left', 'right', 'center', 'end', 'start']
15 padding:[0,0,0,0] // default: [0, 0, 0, 0] [top, right, bottom, left].
16}
17
18const shapeOptions = {
19 // Polygon & Line & Point
20 fill: color,
21 stroke: [color, width],
22 // Point
23 radius: 23, // default: 5
24 displacement: [0,0] // default: [0,0] [x, y]
25}
26
27const styleOptions = {
28 geometryType: "", // default:'Point' ['Point', 'Polygon', 'Line']
29 textOptions,
30 shapeOptions,
31
32}
33
34const featureOptions = {
35 Icon: "URL",
36 styleOptions,
37 useIcon: true,// default true
38 useStyle: true,// default true
39 useText: true,// default true
40}
41
42const featureCollection = {
43 "type": "FeatureCollection",
44 "features": [
45 {
46 "type": "Feature",
47 "properties": {
48 "population": 200
49 },
50 featureOptions,
51 "geometry": {
52 "type": "Point",
53 "coordinates": [-112.0372, 46.608058]
54 }
55 }
56 ]
57},
58
59
60const layerOptions = {
61 key: "uuid", //default uuid
62 featureOptions,
63}
64
65const zoomHighlightDrawParams = {// Zoom zooms to fit the extent of all features in the passed data
66
67 data: {// Key "GEO":string if the the data is geojson array --------- Key "layerid":Number if the data is UUID Array.
68 "GEOJSON": {layerOptions, data: featureCollection},
69 34561: {layerOptions, layerData:[{uuid: 'uuid1', featureOptions}, {uuid: 'uuid2'}, {uuid: "InvalidUUID"}]},// Takes 1 query per each uuid key ------ Empty arrays will be ignored ---- wrong keys will be ignored
70 31741: {layerOptions, layerData:[{uuid: 'uuid1'}, {uuid: 'uuid2', featureOptions:"InvalidOptions" }]},// Icon will be ignored if you can the zoom api and will be used when using highlight api
71 "someinvalidkey": {},
72 },
73
74 options: { /* Optional */
75 zoomOnHighlight: true,// default true
76 }
77}
78
79
80
81/* Returns */
82
83const singleFeatureReturn = {
84 status: 200,
85 message: "SUCCESS",
86 value: feat1
87}
88
89const returns = {
90 data:{
91 GEOJSON: [singleFeatureReturn, singleFeatureReturn], // All of the feature refrences in the same order given
92 34561: [singleFeatureReturn, singleFeatureReturn], // All of the feature refrences in the same order given
93 31741: [singleFeatureReturn, singleFeatureReturn], // All of the feature refrences in the same order given
94 "someinvalidkey": [singleFeatureReturn/* will contain status code with invalid layer or key */],
95 }
96}
97
98