@geogirafe/lib-geoportal 1.1.0-dev.2468094514 → 1.1.0-dev.2468633458
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.1.0-dev.
|
|
1
|
+
{"version":"1.1.0-dev.2468633458", "build":"2468633458", "date":"21/04/2026"}
|
package/tools/utils/olutils.js
CHANGED
|
@@ -161,18 +161,26 @@ export const getRadiusDataForCircle = (circle, defaultStyle, stroke) => {
|
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
export const getLengthAsMetricText = (length) => {
|
|
164
|
-
if (length) {
|
|
165
|
-
|
|
166
|
-
return formatedLength;
|
|
164
|
+
if (length === undefined) {
|
|
165
|
+
return '';
|
|
167
166
|
}
|
|
168
|
-
|
|
167
|
+
if (length <= 500) {
|
|
168
|
+
return `${length.toFixed(2)} m`;
|
|
169
|
+
}
|
|
170
|
+
const lengthInKilometers = length / 1000;
|
|
171
|
+
if (length <= 2000) {
|
|
172
|
+
return `${lengthInKilometers.toFixed(3)} km`;
|
|
173
|
+
}
|
|
174
|
+
return `${lengthInKilometers.toFixed(2)} km`;
|
|
169
175
|
};
|
|
170
176
|
export const getAreaAsMetricText = (area) => {
|
|
171
|
-
if (area) {
|
|
172
|
-
|
|
173
|
-
return formatedArea;
|
|
177
|
+
if (area === undefined) {
|
|
178
|
+
return '';
|
|
174
179
|
}
|
|
175
|
-
|
|
180
|
+
if (area <= 10000) {
|
|
181
|
+
return `${area.toFixed(2)} m²`;
|
|
182
|
+
}
|
|
183
|
+
return `${(area / 1000000).toFixed(2)} km²`;
|
|
176
184
|
};
|
|
177
185
|
export const getAzimuthAsText = (azimuth) => {
|
|
178
186
|
if (azimuth) {
|