@delta10/atlas-sdk 0.1.1 → 0.1.2

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.
Files changed (35) hide show
  1. package/README.md +215 -62
  2. package/dist/assets/basedecoder-B2c5_Eok.js +1 -0
  3. package/dist/assets/decoder-tqM1uIvc.js +1 -0
  4. package/dist/assets/deflate-B9JhHpvg.js +1 -0
  5. package/dist/assets/html2canvas.esm-C17pzFXx-Bnh1DqN7.js +5 -0
  6. package/dist/assets/index-BXwdpSD5.js +808 -0
  7. package/dist/{atlas-sdk.css → assets/index-DeUJ0ANO.css} +1 -1
  8. package/dist/assets/index.es-Di2I6Ukg-2Rw9sVeZ.js +5 -0
  9. package/dist/assets/jpeg-vtRboCKw.js +1 -0
  10. package/dist/assets/lerc-B0w6JUF4.js +1 -0
  11. package/dist/assets/lzw-_aCqfs4w.js +1 -0
  12. package/dist/assets/packbits-DDWKfGV_.js +1 -0
  13. package/dist/assets/pako.esm-Cram60i4.js +1 -0
  14. package/dist/assets/purify.es-DaUpxO-q-B6zaa5rw.js +2 -0
  15. package/dist/assets/raw-in9isEBO.js +1 -0
  16. package/dist/assets/webimage-DBgUwIbt.js +1 -0
  17. package/dist/index.html +14 -0
  18. package/package.json +1 -1
  19. package/dist/atlas-sdk.js +0 -5
  20. package/dist/atlas-sdk.umd.cjs +0 -816
  21. package/dist/basedecoder-PoXbLGBV.js +0 -88
  22. package/dist/decoder-CLokFc0V.js +0 -8
  23. package/dist/deflate-DbhbvOaP.js +0 -10
  24. package/dist/html2canvas.esm-C17pzFXx-LAKgTrxK.js +0 -4852
  25. package/dist/index-2UT9uiJR.js +0 -62591
  26. package/dist/index.d.ts +0 -459
  27. package/dist/index.es-Di2I6Ukg-CwNr2-NA.js +0 -6622
  28. package/dist/jpeg-CqPRbuRp.js +0 -533
  29. package/dist/lerc-DkZ76mbj.js +0 -1032
  30. package/dist/lzw-DQ6ibF74.js +0 -84
  31. package/dist/packbits-BuzK6gM3.js +0 -24
  32. package/dist/pako.esm-Bx5X36Wo.js +0 -1074
  33. package/dist/purify.es-DaUpxO-q-DMHqskJ-.js +0 -552
  34. package/dist/raw-CaSL8pVO.js +0 -9
  35. package/dist/webimage--SJddlky.js +0 -19
package/README.md CHANGED
@@ -17,29 +17,25 @@ npm install @delta10/atlas-sdk
17
17
  import { ref } from 'vue'
18
18
  import Map from '@delta10/atlas-sdk'
19
19
  import '@delta10/atlas-sdk/style.css'
20
- import type { LayerConfig } from '@delta10/atlas-sdk'
20
+ import type { LayerConfig, InteractionsConfig } from '@delta10/atlas-sdk'
21
21
 
22
22
  const layers: LayerConfig[] = [
23
23
  {
24
24
  type: 'vector',
25
25
  options: {
26
- identifier: 'panden',
27
- title: 'Panden',
26
+ identifier: 'meetbouten',
27
+ title: 'Meetbouten',
28
28
  features: [
29
29
  {
30
- type: 'Polygon',
31
- coordinates: [[
32
- [116044.07, 495387.61],
33
- [116036.43, 495385.83],
34
- [116041.45, 495365.34],
35
- [116048.78, 495366.99],
36
- [116044.07, 495387.61]
37
- ]]
30
+ type: 'Point',
31
+ coordinates: [120000, 487000]
38
32
  }
39
33
  ],
40
34
  style: {
41
- fill: { color: 'rgba(173, 216, 230, 0.6)' },
42
- stroke: { color: 'blue', width: 2 }
35
+ 'circle-radius': 8,
36
+ 'circle-fill-color': 'rgba(173, 216, 230, 0.6)',
37
+ 'circle-stroke-color': 'blue',
38
+ 'circle-stroke-width': 3,
43
39
  }
44
40
  }
45
41
  }
@@ -56,6 +52,19 @@ const baseLayers: LayerConfig[] = [
56
52
  }
57
53
  ]
58
54
 
55
+ const interactions: InteractionsConfig = {
56
+ selectable: {
57
+ enabled: true,
58
+ layers: ['meetbouten'],
59
+ style: {
60
+ 'circle-radius': 8,
61
+ 'circle-fill-color': 'red',
62
+ 'circle-stroke-color': 'darkred',
63
+ 'circle-stroke-width': 2,
64
+ }
65
+ }
66
+ }
67
+
59
68
  const mapRef = ref()
60
69
 
61
70
  const onFeatureSelected = (event: any) => {
@@ -77,6 +86,7 @@ const onFeatureModified = (event: any) => {
77
86
  ref="mapRef"
78
87
  :layers="layers"
79
88
  :baseLayers="baseLayers"
89
+ :interactions="interactions"
80
90
  @featureSelected="onFeatureSelected"
81
91
  @featureDrawn="onFeatureDrawn"
82
92
  @featureModified="onFeatureModified"
@@ -111,27 +121,123 @@ The `Map` component is the main component of the SDK, providing an interactive m
111
121
 
112
122
  ### Methods
113
123
 
114
- - **`fitToFeatures(features)`** - Fit the map view to specific features
115
- ```typescript
116
- mapRef.value.fitToFeatures([
117
- {
118
- type: 'Polygon',
119
- coordinates: [[...]]
124
+ - **`fitToFeatures(features)`** - Fit the map view to include all specified features with appropriate padding
125
+
126
+ Basic usage:
127
+ ```typescript
128
+ mapRef.value.fitToFeatures([
129
+ {
130
+ type: 'Polygon',
131
+ coordinates: [[[x1, y1], [x2, y2], ...]]
132
+ },
133
+ {
134
+ type: 'Point',
135
+ coordinates: [x, y]
136
+ }
137
+ ])
138
+ ```
139
+
140
+ Complete example in a Vue component:
141
+ ```vue
142
+ <script setup lang="ts">
143
+ import { ref, onMounted } from 'vue'
144
+ import Map from '@delta10/atlas-sdk'
145
+ import type { LayerConfig } from '@delta10/atlas-sdk'
146
+
147
+ const mapRef = ref()
148
+ const features = [/* your features */]
149
+
150
+ const layers: LayerConfig[] = [
151
+ {
152
+ type: 'vector',
153
+ options: {
154
+ identifier: 'panden',
155
+ title: 'Panden',
156
+ features: features,
157
+ style: {
158
+ 'fill-color': 'rgba(173, 216, 230, 0.6)',
159
+ 'stroke-color': 'blue',
160
+ 'stroke-width': 2
161
+ }
120
162
  }
121
- ])
122
- ```
163
+ }
164
+ ]
165
+
166
+ // Fit map to features on component mount
167
+ onMounted(() => {
168
+ if (mapRef.value) {
169
+ mapRef.value.fitToFeatures(features)
170
+ }
171
+ })
172
+ </script>
173
+
174
+ <template>
175
+ <Map ref="mapRef" :layers="layers" />
176
+ </template>
177
+ ```
123
178
 
124
179
  ## Layer Configuration
125
180
 
181
+ ### Vector Layer with Polygon
182
+ ```typescript
183
+ {
184
+ type: 'vector',
185
+ options: {
186
+ identifier: 'panden',
187
+ title: 'Panden',
188
+ features: [
189
+ {
190
+ type: 'Polygon',
191
+ coordinates: [[
192
+ [116044.07, 495387.61],
193
+ [116036.43, 495385.83],
194
+ [116041.45, 495365.34],
195
+ [116048.78, 495366.99],
196
+ [116044.07, 495387.61]
197
+ ]]
198
+ }
199
+ ],
200
+ style: {
201
+ 'fill-color': 'rgba(173, 216, 230, 0.6)',
202
+ 'stroke-color': 'blue',
203
+ 'stroke-width': 2
204
+ }
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### Vector Layer with Points
210
+ ```typescript
211
+ {
212
+ type: 'vector',
213
+ options: {
214
+ identifier: 'meetbouten',
215
+ title: 'Meetbouten',
216
+ features: [
217
+ {
218
+ type: 'Point',
219
+ coordinates: [120000, 487000]
220
+ }
221
+ ],
222
+ style: {
223
+ 'circle-radius': 8,
224
+ 'circle-fill-color': 'rgba(173, 216, 230, 0.6)',
225
+ 'circle-stroke-color': 'blue',
226
+ 'circle-stroke-width': 3
227
+ }
228
+ }
229
+ }
230
+ ```
231
+
126
232
  ### WMTS Layer
127
233
  ```typescript
128
234
  {
129
235
  type: 'wmts',
130
236
  options: {
131
- identifier: 'layer-id',
132
- title: 'Layer Title',
133
- url: 'https://...',
134
- format: 'image/png' // optional
237
+ identifier: 'referentiekaart',
238
+ title: 'Referentiekaart',
239
+ url: 'https://tiles.zaanstad.nl/mapproxy/service?REQUEST=GetCapabilities&service=wmts',
240
+ format: 'image/png' // optional, defaults to image/png
135
241
  }
136
242
  }
137
243
  ```
@@ -141,44 +247,61 @@ The `Map` component is the main component of the SDK, providing an interactive m
141
247
  {
142
248
  type: 'wms',
143
249
  options: {
144
- identifier: 'layer-id',
145
- title: 'Layer Title',
146
- url: 'https://...',
147
- layer: 'geoserver-layer-name'
250
+ identifier: 'bag-pand-bouwjaar',
251
+ title: 'BAG Pand Bouwjaar',
252
+ url: 'https://maps.zaanstad.nl/geoserver/wms',
253
+ layer: 'geo:bag_pand_bouwjaar'
148
254
  }
149
255
  }
150
256
  ```
151
257
 
152
- ### Vector Layer
258
+ ## Styling
259
+
260
+ ### Static Styles
261
+ Vector layers support flat style properties:
262
+ - `fill-color` - Fill color (e.g., 'rgba(255, 0, 0, 0.5)')
263
+ - `stroke-color` - Stroke color (e.g., 'blue')
264
+ - `stroke-width` - Stroke width in pixels
265
+ - `circle-radius` - Circle radius in pixels
266
+ - `circle-fill-color` - Circle fill color
267
+ - `circle-stroke-color` - Circle stroke color
268
+ - `circle-stroke-width` - Circle stroke width
269
+
270
+ ### Conditional Styles
271
+
272
+ You can create dynamic styles based on feature properties using flat style expressions with rules. Use OpenLayers expressions to conditionally set colors and other properties.
273
+
274
+ #### Using Flat Style Expressions (Recommended)
275
+
153
276
  ```typescript
154
277
  {
155
278
  type: 'vector',
156
279
  options: {
157
- identifier: 'layer-id',
158
- title: 'Layer Title',
159
- features: [
160
- {
161
- type: 'Point',
162
- coordinates: [x, y]
163
- },
164
- {
165
- type: 'Polygon',
166
- coordinates: [[[x1, y1], [x2, y2], ...]]
167
- }
168
- ],
280
+ identifier: 'meetbouten',
281
+ title: 'Meetbouten',
282
+ features: meetboutenFeatures,
169
283
  style: {
170
- fill: { color: 'rgba(255, 255, 255, 0.2)' },
171
- stroke: { color: '#3399CC', width: 1.25 },
172
- circle: {
173
- radius: 5,
174
- fill: { color: 'blue' },
175
- stroke: { color: '#3399CC', width: 1.25 }
176
- }
284
+ 'circle-radius': 8,
285
+ 'circle-fill-color': ['case', ['==', ['get', 'geplaatst'], true], 'blue', 'lightblue'],
286
+ 'circle-stroke-color': 'blue',
287
+ 'circle-stroke-width': 3,
177
288
  }
178
289
  }
179
290
  }
180
291
  ```
181
292
 
293
+ This example checks if the `geplaatst` property equals `true`:
294
+ - If true: circle fill color is `blue`
295
+ - If false: circle fill color is `lightblue`
296
+
297
+ You can use other comparison operators:
298
+ - `'=='` - Equal to
299
+ - `'!='` - Not equal to
300
+ - `'>'` - Greater than
301
+ - `'<'` - Less than
302
+ - `'>='` - Greater than or equal
303
+ - `'<='` - Less than or equal
304
+
182
305
  ## Interactions Configuration
183
306
 
184
307
  ### Select Interaction
@@ -187,13 +310,12 @@ Allow users to select features from specific layers:
187
310
  {
188
311
  selectable: {
189
312
  enabled: true,
190
- layers: ['layer-id-1', 'layer-id-2'],
313
+ layers: ['meetbouten'],
191
314
  style: {
192
- circle: {
193
- radius: 8,
194
- fill: { color: 'red' },
195
- stroke: { color: 'darkred', width: 2 }
196
- }
315
+ 'circle-radius': 8,
316
+ 'circle-fill-color': 'red',
317
+ 'circle-stroke-color': 'darkred',
318
+ 'circle-stroke-width': 2
197
319
  }
198
320
  }
199
321
  }
@@ -205,8 +327,8 @@ Allow users to draw new geometries:
205
327
  {
206
328
  draw: {
207
329
  enabled: true,
208
- layer: 'target-layer-id',
209
- type: 'Polygon' // 'Point' | 'LineString' | 'Polygon'
330
+ layer: 'meetbouten',
331
+ type: 'Point' // 'Point' | 'LineString' | 'Polygon'
210
332
  }
211
333
  }
212
334
  ```
@@ -217,10 +339,7 @@ Allow users to edit existing geometries:
217
339
  {
218
340
  modify: {
219
341
  enabled: true,
220
- layer: 'target-layer-id',
221
- style: {
222
- stroke: { color: 'orange', width: 2 }
223
- }
342
+ layer: 'meetbouten'
224
343
  }
225
344
  }
226
345
  ```
@@ -231,7 +350,41 @@ Snap drawn/modified features to existing features:
231
350
  {
232
351
  snap: {
233
352
  enabled: true,
234
- targetLayer: 'layer-to-snap-to'
353
+ targetLayer: 'panden',
354
+ pixelTolerance: 10 // Optional: distance in pixels where snap activates (default: 8)
355
+ }
356
+ }
357
+ ```
358
+
359
+ The `pixelTolerance` controls how close (in pixels) the cursor needs to be to snap to a feature. Adjust for your needs:
360
+ - **Lower values** (e.g., 5-8 pixels) - More precise snapping, requires cursor to be very close
361
+ - **Higher values** (e.g., 15-20 pixels) - Easier snapping, works from further away
362
+
363
+ ### Combined Interactions Example
364
+ ```typescript
365
+ const interactions: InteractionsConfig = {
366
+ selectable: {
367
+ enabled: true,
368
+ layers: ['meetbouten'],
369
+ style: {
370
+ 'circle-radius': 8,
371
+ 'circle-fill-color': 'red',
372
+ 'circle-stroke-color': 'darkred',
373
+ 'circle-stroke-width': 2
374
+ }
375
+ },
376
+ draw: {
377
+ enabled: true,
378
+ layer: 'meetbouten',
379
+ type: 'Point'
380
+ },
381
+ modify: {
382
+ enabled: true,
383
+ layer: 'meetbouten'
384
+ },
385
+ snap: {
386
+ enabled: true,
387
+ targetLayer: 'panden'
235
388
  }
236
389
  }
237
390
  ```
@@ -0,0 +1 @@
1
+ function l(o,n){let t=o.length-n,s=0;do{for(let a=n;a>0;a--)o[s+n]+=o[s],s++;t-=n}while(t>0)}function d(o,n,t){let s=0,a=o.length;const i=a/t;for(;a>n;){for(let e=n;e>0;--e)o[s+n]+=o[s],++s;a-=n}const r=o.slice();for(let e=0;e<i;++e)for(let c=0;c<t;++c)o[t*e+c]=r[(t-c-1)*i+e]}function f(o,n,t,s,a,i){if(n===1)return o;for(let c=0;c<a.length;++c){if(a[c]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(a[c]!==a[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const r=a[0]/8,e=i===2?1:a.length;for(let c=0;c<s&&!(c*e*t*r>=o.byteLength);++c){let h;if(n===2){switch(a[0]){case 8:h=new Uint8Array(o,c*e*t*r,e*t*r);break;case 16:h=new Uint16Array(o,c*e*t*r,e*t*r/2);break;case 32:h=new Uint32Array(o,c*e*t*r,e*t*r/4);break;default:throw new Error(`Predictor 2 not allowed with ${a[0]} bits per sample.`)}l(h,e)}else n===3&&(h=new Uint8Array(o,c*e*t*r,e*t*r),d(h,e,r))}return o}class g{async decode(n,t){const s=await this.decodeBlock(t),a=n.Predictor||1;if(a!==1){const i=!n.StripOffsets,r=i?n.TileWidth:n.ImageWidth,e=i?n.TileLength:n.RowsPerStrip||n.ImageLength;return f(s,a,r,e,n.BitsPerSample,n.PlanarConfiguration)}return s}}export{g as B};