Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gis 798 & GIS-845 - vectoriële base map #336

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## Unreleased

### Added

- `ngx-leaflet`: Added `addVectorLayer` method so that leaflet can accept vector layers.

## [6.0.10] - 2024-03-21

### Fixed

- `ngx-leaflet`: Reverted the `baseMapAntwerp` link to a newer version.
- `ngx-forms`: Added a forgotten ARIA label for the datepicker.
- `ngx-forms`: Made label and description of datepicker and timepicker conditional
- `ngx-forms`: Made label and description of datepicker and timepicker conditional.

## [6.0.9] - 2024-03-19

Expand Down
1 change: 1 addition & 0 deletions packages/ngx-leaflet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public ngOnInit(): void {
- `map`: The native leaflet map instance
- `addTileLayer(layer: LeafletLayer)`: adds a tile layer to the map. (see leaflet docs)
- `addFeatureLayer(config: any)`: adds a feature layer to the map. (see esri leaflet docs)
- `addVectorLayer(config: LeafletLayer)`: adds a feature layer to the map. (see [Leaflet.VectorGrid](https://github.com/Leaflet/Leaflet.VectorGrid) docs)
- `addGeoJSON(geoJson: any, config: any)`: add geoJSON to the map. (see leaflet docs)
- `fitFeatureLayers(featureLayers)`: Fit the map bounds to the given feature layers.
- `removeLayer(layer)`: removes a layer
Expand Down
3 changes: 2 additions & 1 deletion packages/ngx-leaflet/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@acpaas-ui",
"leaflet",
"esri-leaflet",
"leaflet-draw"
"leaflet-draw",
"leaflet.vectorgrid"
]
}
3 changes: 2 additions & 1 deletion packages/ngx-leaflet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"@acpaas-ui/ngx-icon": "^6.0.10",
"esri-leaflet": "^3.0.2",
"leaflet": "^1.3.1",
"leaflet-draw": "^1.0.2"
"leaflet-draw": "^1.0.2",
"leaflet.vectorgrid": "^1.3.0"
},
"peerDependencies": {
"@angular/common": ">=15.2.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/ngx-leaflet/src/lib/classes/leaflet-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ export class LeafletMap {
}
}

addVectorLayer(layer: LeafletLayer) {
if (this.mapService.isAvailable()) {
const tileLayer = this.mapService.L.vectorGrid.protobuf(layer.url, layer.options);
this.map.addLayer(tileLayer);
return tileLayer;
}
}

addFeatureLayer(config: any) {
if (this.mapService.isAvailable()) {
const featureLayer = new this.mapService.esri.featureLayer(config);
Expand Down
Loading