comparison client/src/store/map.js @ 1524:a0a16577261a

Translation: mark some strings for translation * mark the strings in map.js to be translated and update the corresponding .po files
author Fadi Abbud <fadi.abbud@intevation.de>
date Fri, 07 Dec 2018 10:08:31 +0100
parents 71eb96690f91
children faa045ebdf0c
comparison
equal deleted inserted replaced
1522:b34caa449c01 1524:a0a16577261a
26 import { HTTP } from "../lib/http"; 26 import { HTTP } from "../lib/http";
27 import { fromLonLat } from "ol/proj"; 27 import { fromLonLat } from "ol/proj";
28 import { getLength, getArea } from "ol/sphere.js"; 28 import { getLength, getArea } from "ol/sphere.js";
29 import { unByKey } from "ol/Observable"; 29 import { unByKey } from "ol/Observable";
30 import { getCenter } from "ol/extent"; 30 import { getCenter } from "ol/extent";
31 import app from "../main";
31 32
32 // initial state 33 // initial state
33 const init = () => { 34 const init = () => {
34 return { 35 return {
35 openLayersMap: null, 36 openLayersMap: null,
409 drawVectorSrc.clear(); 410 drawVectorSrc.clear();
410 commit("setCurrentMeasurement", null); 411 commit("setCurrentMeasurement", null);
411 }); 412 });
412 lineTool.on("drawend", event => { 413 lineTool.on("drawend", event => {
413 commit("setCurrentMeasurement", { 414 commit("setCurrentMeasurement", {
414 quantity: "Length", 415 quantity: app.$gettext("Length"),
415 unitSymbol: "m", 416 unitSymbol: "m",
416 value: Math.round(getLength(event.feature.getGeometry()) * 10) / 10 417 value: Math.round(getLength(event.feature.getGeometry()) * 10) / 10
417 }); 418 });
418 commit("application/showIdentify", true, { root: true }); 419 commit("application/showIdentify", true, { root: true });
419 }); 420 });
430 commit("setCurrentMeasurement", null); 431 commit("setCurrentMeasurement", null);
431 }); 432 });
432 polygonTool.on("drawend", event => { 433 polygonTool.on("drawend", event => {
433 const areaSize = getArea(event.feature.getGeometry()); 434 const areaSize = getArea(event.feature.getGeometry());
434 commit("setCurrentMeasurement", { 435 commit("setCurrentMeasurement", {
435 quantity: "Area", 436 quantity: app.$gettext("Area"),
436 unitSymbol: areaSize > 100000 ? "km²" : "m²", 437 unitSymbol: areaSize > 100000 ? "km²" : "m²",
437 value: 438 value:
438 areaSize > 100000 439 areaSize > 100000
439 ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m² 440 ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m²
440 : Math.round(areaSize) 441 : Math.round(areaSize)