@yarrow-uz/yarrow-map-web-sdk 1.0.40 → 1.0.41
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/README.md +43 -3
- package/dist/main.js +1 -1
- package/dist/maps/yarrow.d.ts +12 -3
- package/dist/module.js +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -355,10 +355,45 @@ yarrowMap.addLayer(
|
|
|
355
355
|
featureCollection, // GeoJSON FeatureCollection
|
|
356
356
|
paint, // Paint properties object
|
|
357
357
|
layout, // Layout properties object
|
|
358
|
-
iconSettings
|
|
358
|
+
iconSettings, // Icon configuration (width, height)
|
|
359
|
+
options // Optional: { sourceId?: string, filter?: LayerFilter }
|
|
359
360
|
);
|
|
360
361
|
```
|
|
361
362
|
|
|
363
|
+
### Managing Sources Explicitly
|
|
364
|
+
|
|
365
|
+
```javascript
|
|
366
|
+
yarrowMap.addSource('vehicles-source', vehicleFeatureCollection);
|
|
367
|
+
yarrowMap.updateSourceData('vehicles-source', nextVehicleFeatureCollection);
|
|
368
|
+
|
|
369
|
+
yarrowMap.addLayer(
|
|
370
|
+
'active-vehicles',
|
|
371
|
+
'circle',
|
|
372
|
+
nextVehicleFeatureCollection,
|
|
373
|
+
{
|
|
374
|
+
'circle-radius': ['interpolate', ['linear'], ['zoom'], 10, 4, 16, 10],
|
|
375
|
+
'circle-color': ['case', ['==', ['get', 'status'], 'active'], '#16a34a', '#9ca3af']
|
|
376
|
+
},
|
|
377
|
+
{},
|
|
378
|
+
{},
|
|
379
|
+
{
|
|
380
|
+
sourceId: 'vehicles-source',
|
|
381
|
+
filter: ['==', ['get', 'status'], 'active']
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Feature State and Rendered Queries
|
|
387
|
+
|
|
388
|
+
```javascript
|
|
389
|
+
yarrowMap.setFeatureState(
|
|
390
|
+
{ source: 'vehicles-source', id: 101 },
|
|
391
|
+
{ selected: true }
|
|
392
|
+
);
|
|
393
|
+
|
|
394
|
+
const features = yarrowMap.queryRenderedFeatures({ layers: ['active-vehicles'] });
|
|
395
|
+
```
|
|
396
|
+
|
|
362
397
|
**Symbol layer with custom icons:**
|
|
363
398
|
|
|
364
399
|
```javascript
|
|
@@ -916,7 +951,11 @@ constructor(
|
|
|
916
951
|
| `onIconClick(layerGroup, callback)` | `layerGroup: 'pois' \| 'buildings', callback: Function` | `void` | Listen for icon clicks |
|
|
917
952
|
| `onLayerClick(layerGroup, callback)` | `layerGroup: 'pois' \| 'buildings', callback: Function` | `void` | Alias for onIconClick (same method) |
|
|
918
953
|
| `changeBackgroundColor(color)` | `color: string` | `void` | Change map background color |
|
|
919
|
-
| `
|
|
954
|
+
| `addSource()` | `sourceId, data` | `void` | Add/replace a GeoJSON source |
|
|
955
|
+
| `updateSourceData()` | `sourceId, data` | `void` | Update data for an existing GeoJSON source (or create it) |
|
|
956
|
+
| `addLayer()` | `layerName, layerType, featureCollection, paint?, layout?, iconSettings?, options?` | `void` | Add a layer to the map (supports `sourceId` and `filter`) |
|
|
957
|
+
| `setFeatureState()` | `featureIdentifier, state` | `void` | Set state for a specific feature |
|
|
958
|
+
| `queryRenderedFeatures()` | `geometryOrOptions?, options?` | `MapGeoJSONFeature[]` | Query currently rendered features (supports `{ layers }`) |
|
|
920
959
|
| `removeLayer(layerName)` | `layerName: string` | `void` | Remove a layer from the map |
|
|
921
960
|
| `addMarker(coordinates, options?)` | `coordinates: [lat, lng], options?: MarkerOptions` | `Marker \| null` | Add a marker to the map |
|
|
922
961
|
| `removeMarker(marker)` | `marker: Marker` | `void` | Remove a marker from the map |
|
|
@@ -967,9 +1006,10 @@ interface SearchOptions {
|
|
|
967
1006
|
|
|
968
1007
|
## Version Information
|
|
969
1008
|
|
|
970
|
-
- **Current Version**: 1.0.
|
|
1009
|
+
- **Current Version**: 1.0.41
|
|
971
1010
|
- **Dependencies**: maplibre-gl ^5.5.0, axios ^1.7.9
|
|
972
1011
|
- **Repository**: https://git.yarrow.uz/yarrow-sdk/frontend/yarrow-map-web-sdk
|
|
1012
|
+
- **Changelog**: `CHANGELOG.md`
|
|
973
1013
|
|
|
974
1014
|
## Support
|
|
975
1015
|
|