adb-shared 6.2.16 → 6.2.17
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/fesm2022/adb-shared.mjs +27 -15
- package/fesm2022/adb-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/types/adb-shared.d.ts +1 -0
package/fesm2022/adb-shared.mjs
CHANGED
|
@@ -2893,14 +2893,13 @@ class AdbMapUtils {
|
|
|
2893
2893
|
{
|
|
2894
2894
|
name: 'Sveriges gränser',
|
|
2895
2895
|
id: 7,
|
|
2896
|
-
url: 'https://sosgeo.artdata.slu.se/geoserver/
|
|
2896
|
+
url: 'https://sosgeo.artdata.slu.se/geoserver/GeoRegion/wms',
|
|
2897
2897
|
minZoom: 6,
|
|
2898
2898
|
maxZoom: 18,
|
|
2899
2899
|
params: {
|
|
2900
2900
|
maxNativeZoom: 14,
|
|
2901
2901
|
attribution: '© <a href="https://www.lantmateriet.se/">Sveriges gränser</a>',
|
|
2902
|
-
layers: '
|
|
2903
|
-
epsg: 5845
|
|
2902
|
+
layers: 'GeoRegion:County', styles: 'municipality_name_yellow'
|
|
2904
2903
|
},
|
|
2905
2904
|
wms: true
|
|
2906
2905
|
}
|
|
@@ -2935,13 +2934,18 @@ class AdbMapUtils {
|
|
|
2935
2934
|
static addProviders(map) {
|
|
2936
2935
|
const backgroundMaps = {};
|
|
2937
2936
|
for (const value of Object.values(AdbMapUtils.Providers)) {
|
|
2937
|
+
const baseOptions = {
|
|
2938
|
+
...value.params,
|
|
2939
|
+
updateWhenZooming: false,
|
|
2940
|
+
updateWhenIdle: true,
|
|
2941
|
+
keepBuffer: 2,
|
|
2942
|
+
crossOrigin: true
|
|
2943
|
+
};
|
|
2938
2944
|
backgroundMaps[value.name] = value.wms
|
|
2939
|
-
? Leaflet.tileLayer.wms(value.url,
|
|
2940
|
-
: Leaflet.tileLayer(value.url,
|
|
2941
|
-
}
|
|
2942
|
-
if (backgroundMaps['Open Streetmap']) {
|
|
2943
|
-
map.addLayer(backgroundMaps['Open Streetmap']);
|
|
2945
|
+
? Leaflet.tileLayer.wms(value.url, baseOptions)
|
|
2946
|
+
: Leaflet.tileLayer(value.url, baseOptions);
|
|
2944
2947
|
}
|
|
2948
|
+
map.addLayer(backgroundMaps['Open Streetmap']);
|
|
2945
2949
|
Leaflet.control.layers(backgroundMaps, AdbMapUtils.OverlayMaps).addTo(map);
|
|
2946
2950
|
}
|
|
2947
2951
|
}
|
|
@@ -2980,14 +2984,15 @@ class PolygonDrawerInput {
|
|
|
2980
2984
|
snapMiddle: false
|
|
2981
2985
|
});
|
|
2982
2986
|
this.map.on("pm:create", (e) => {
|
|
2983
|
-
if (e.shape !== "Polygon")
|
|
2987
|
+
if (e.shape !== "Polygon" && e.shape !== "Circle")
|
|
2984
2988
|
return;
|
|
2985
2989
|
this.polygonDraw = false;
|
|
2986
2990
|
this.map.pm.disableDraw();
|
|
2987
2991
|
this.clearShape();
|
|
2988
|
-
this.shapeLayer =
|
|
2989
|
-
|
|
2990
|
-
|
|
2992
|
+
this.shapeLayer = e.shape === 'Polygon' ?
|
|
2993
|
+
Leaflet__default.geoJson(e.layer.toGeoJSON(), { style: { fillOpacity: 0.5 } }) :
|
|
2994
|
+
new Leaflet__default.FeatureGroup([new Leaflet__default.Circle(e.layer.getLatLng(), { radius: e.layer.getRadius() })]);
|
|
2995
|
+
this.shapeLayer.interactive = false;
|
|
2991
2996
|
this.map.addLayer(this.shapeLayer);
|
|
2992
2997
|
this.map.fitBounds(this.shapeLayer.getBounds());
|
|
2993
2998
|
this.onChange(e.layer.toGeoJSON());
|
|
@@ -3019,6 +3024,13 @@ class PolygonDrawerInput {
|
|
|
3019
3024
|
snappable: false
|
|
3020
3025
|
});
|
|
3021
3026
|
}
|
|
3027
|
+
onDrawCircle() {
|
|
3028
|
+
this.polygonDraw = true;
|
|
3029
|
+
this.map.pm.enableDraw("Circle", {
|
|
3030
|
+
allowSelfIntersection: false,
|
|
3031
|
+
snappable: false
|
|
3032
|
+
});
|
|
3033
|
+
}
|
|
3022
3034
|
onUndoStep() {
|
|
3023
3035
|
const draw = this.map.pm.Draw?.Polygon;
|
|
3024
3036
|
draw?._removeLastVertex();
|
|
@@ -3047,7 +3059,7 @@ class PolygonDrawerInput {
|
|
|
3047
3059
|
useExisting: forwardRef((() => PolygonDrawerInput)),
|
|
3048
3060
|
multi: true
|
|
3049
3061
|
}
|
|
3050
|
-
], ngImport: i0, template: "<div class=\"mb-1 d-flex gap-1 flex-wrap align-items-start\">\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDrawPolygon()\" title=\"Polygon\">\r\n <span class=\"fas fa-draw-polygon\"></span> {{'OBSERVATION.DRAW'|translate}}\r\n </button>\r\n @if (polygonDraw) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDeleteShape()\" title=\"Ta bort\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onUndoStep()\" title=\"\u00C5ngra\">\r\n <span class=\"fas fa-undo\"></span>\r\n </button>\r\n }\r\n</div>\r\n<div [id]=\"mapId\" class=\"border\" style=\"height:20rem\"></div>", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
3062
|
+
], ngImport: i0, template: "<div class=\"mb-1 d-flex gap-1 flex-wrap align-items-start\">\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDrawPolygon()\" title=\"Polygon\">\r\n <span class=\"fas fa-draw-polygon\"></span> {{'OBSERVATION.DRAW'|translate}}\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDrawCircle()\" title=\"Circle\">\r\n <span class=\"fas fa-draw-circle\"></span> {{'OBSERVATION.DRAW_CIRCLE'|translate}}\r\n </button>\r\n @if (polygonDraw) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDeleteShape()\" title=\"Ta bort\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onUndoStep()\" title=\"\u00C5ngra\">\r\n <span class=\"fas fa-undo\"></span>\r\n </button>\r\n }\r\n</div>\r\n<div [id]=\"mapId\" class=\"border\" style=\"height:20rem\"></div>", dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] }); }
|
|
3051
3063
|
}
|
|
3052
3064
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: PolygonDrawerInput, decorators: [{
|
|
3053
3065
|
type: Component,
|
|
@@ -3057,7 +3069,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
3057
3069
|
useExisting: forwardRef((() => PolygonDrawerInput)),
|
|
3058
3070
|
multi: true
|
|
3059
3071
|
}
|
|
3060
|
-
], template: "<div class=\"mb-1 d-flex gap-1 flex-wrap align-items-start\">\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDrawPolygon()\" title=\"Polygon\">\r\n <span class=\"fas fa-draw-polygon\"></span> {{'OBSERVATION.DRAW'|translate}}\r\n </button>\r\n @if (polygonDraw) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDeleteShape()\" title=\"Ta bort\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onUndoStep()\" title=\"\u00C5ngra\">\r\n <span class=\"fas fa-undo\"></span>\r\n </button>\r\n }\r\n</div>\r\n<div [id]=\"mapId\" class=\"border\" style=\"height:20rem\"></div>" }]
|
|
3072
|
+
], template: "<div class=\"mb-1 d-flex gap-1 flex-wrap align-items-start\">\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDrawPolygon()\" title=\"Polygon\">\r\n <span class=\"fas fa-draw-polygon\"></span> {{'OBSERVATION.DRAW'|translate}}\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDrawCircle()\" title=\"Circle\">\r\n <span class=\"fas fa-draw-circle\"></span> {{'OBSERVATION.DRAW_CIRCLE'|translate}}\r\n </button>\r\n @if (polygonDraw) {\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onDeleteShape()\" title=\"Ta bort\">\r\n <span class=\"fas fa-times\"></span>\r\n </button>\r\n <button class=\"btn btn-secondary\" type=\"button\" (click)=\"onUndoStep()\" title=\"\u00C5ngra\">\r\n <span class=\"fas fa-undo\"></span>\r\n </button>\r\n }\r\n</div>\r\n<div [id]=\"mapId\" class=\"border\" style=\"height:20rem\"></div>" }]
|
|
3061
3073
|
}] });
|
|
3062
3074
|
|
|
3063
3075
|
var AdbMapFilterType;
|
|
@@ -3376,7 +3388,7 @@ class AdbMapFilters {
|
|
|
3376
3388
|
this.filters = config.filters;
|
|
3377
3389
|
}
|
|
3378
3390
|
ngOnInit() {
|
|
3379
|
-
const lists$ = this.http.get(this.config.taxaListsApi
|
|
3391
|
+
const lists$ = this.http.get(this.config.taxaListsApi);
|
|
3380
3392
|
const combined$ = combineLatest([this.activatedRoute.paramMap, this.activatedRoute.queryParamMap, lists$])
|
|
3381
3393
|
.pipe(map$1(results => ({ params: results[0], qParams: results[1], lists: results[2] })), debounceTime$1(0));
|
|
3382
3394
|
this.subscriptions.add(combined$.subscribe(result => {
|