adb-shared 6.2.16 → 6.2.18
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 +36 -19
- package/fesm2022/adb-shared.mjs.map +1 -1
- package/package.json +1 -1
- package/types/adb-shared.d.ts +2 -1
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
|
}
|
|
@@ -2951,7 +2955,6 @@ class PolygonDrawerInput {
|
|
|
2951
2955
|
this.subscriptions = new Subscription();
|
|
2952
2956
|
this.mapId = "" + Math.floor(Math.random() * Date.now());
|
|
2953
2957
|
this.polygonDraw = false;
|
|
2954
|
-
this.shapeLayer = null;
|
|
2955
2958
|
// ControlValueAccessor
|
|
2956
2959
|
this.onChange = () => { };
|
|
2957
2960
|
this.onTouched = () => { };
|
|
@@ -2980,18 +2983,25 @@ class PolygonDrawerInput {
|
|
|
2980
2983
|
snapMiddle: false
|
|
2981
2984
|
});
|
|
2982
2985
|
this.map.on("pm:create", (e) => {
|
|
2983
|
-
if (e.shape !==
|
|
2986
|
+
if (e.shape !== 'Polygon' && e.shape !== 'Circle')
|
|
2984
2987
|
return;
|
|
2985
2988
|
this.polygonDraw = false;
|
|
2986
2989
|
this.map.pm.disableDraw();
|
|
2987
2990
|
this.clearShape();
|
|
2988
|
-
this.shapeLayer =
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2991
|
+
this.shapeLayer = e.layer;
|
|
2992
|
+
if (this.shapeLayer instanceof Leaflet__default.Path) {
|
|
2993
|
+
this.shapeLayer.setStyle({ fillOpacity: 0.5 });
|
|
2994
|
+
}
|
|
2995
|
+
this.shapeLayer.interactive = false;
|
|
2992
2996
|
this.map.fitBounds(this.shapeLayer.getBounds());
|
|
2993
|
-
this.
|
|
2994
|
-
this.
|
|
2997
|
+
const geo = this.shapeLayer.toGeoJSON();
|
|
2998
|
+
if (this.shapeLayer instanceof Leaflet__default.Circle) {
|
|
2999
|
+
geo.properties = {
|
|
3000
|
+
...geo.properties,
|
|
3001
|
+
radius: this.shapeLayer.getRadius()
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
this.onChange(geo);
|
|
2995
3005
|
});
|
|
2996
3006
|
}
|
|
2997
3007
|
renderInitialShape() {
|
|
@@ -3019,6 +3029,13 @@ class PolygonDrawerInput {
|
|
|
3019
3029
|
snappable: false
|
|
3020
3030
|
});
|
|
3021
3031
|
}
|
|
3032
|
+
onDrawCircle() {
|
|
3033
|
+
this.polygonDraw = true;
|
|
3034
|
+
this.map.pm.enableDraw("Circle", {
|
|
3035
|
+
allowSelfIntersection: false,
|
|
3036
|
+
snappable: false
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3022
3039
|
onUndoStep() {
|
|
3023
3040
|
const draw = this.map.pm.Draw?.Polygon;
|
|
3024
3041
|
draw?._removeLastVertex();
|
|
@@ -3047,7 +3064,7 @@ class PolygonDrawerInput {
|
|
|
3047
3064
|
useExisting: forwardRef((() => PolygonDrawerInput)),
|
|
3048
3065
|
multi: true
|
|
3049
3066
|
}
|
|
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" }] }); }
|
|
3067
|
+
], 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
3068
|
}
|
|
3052
3069
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: PolygonDrawerInput, decorators: [{
|
|
3053
3070
|
type: Component,
|
|
@@ -3057,7 +3074,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
3057
3074
|
useExisting: forwardRef((() => PolygonDrawerInput)),
|
|
3058
3075
|
multi: true
|
|
3059
3076
|
}
|
|
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>" }]
|
|
3077
|
+
], 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
3078
|
}] });
|
|
3062
3079
|
|
|
3063
3080
|
var AdbMapFilterType;
|
|
@@ -3376,7 +3393,7 @@ class AdbMapFilters {
|
|
|
3376
3393
|
this.filters = config.filters;
|
|
3377
3394
|
}
|
|
3378
3395
|
ngOnInit() {
|
|
3379
|
-
const lists$ = this.http.get(this.config.taxaListsApi
|
|
3396
|
+
const lists$ = this.http.get(this.config.taxaListsApi);
|
|
3380
3397
|
const combined$ = combineLatest([this.activatedRoute.paramMap, this.activatedRoute.queryParamMap, lists$])
|
|
3381
3398
|
.pipe(map$1(results => ({ params: results[0], qParams: results[1], lists: results[2] })), debounceTime$1(0));
|
|
3382
3399
|
this.subscriptions.add(combined$.subscribe(result => {
|