Skip to content
Snippets Groups Projects
Commit 924e64c9 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat: Adjust button labels according to map type

parent 36738361
No related branches found
No related tags found
1 merge request!191Add map module and Open-Meteo support
...@@ -35,6 +35,7 @@ class MapModal { ...@@ -35,6 +35,7 @@ class MapModal {
static TRANSLATIONS = { static TRANSLATIONS = {
nb: { nb: {
selectLocation: 'Velg sted', selectLocation: 'Velg sted',
selectCoordinates: 'Velg punkt',
createNewLocation: 'Opprett nytt sted', createNewLocation: 'Opprett nytt sted',
name: 'Navn', name: 'Navn',
latitude: 'Breddegrad', latitude: 'Breddegrad',
...@@ -54,6 +55,7 @@ class MapModal { ...@@ -54,6 +55,7 @@ class MapModal {
}, },
en: { en: {
selectLocation: 'Select location', selectLocation: 'Select location',
selectCoordinates: 'Select point',
createNewLocation: 'Create New Location', createNewLocation: 'Create New Location',
name: 'Name', name: 'Name',
latitude: 'Latitude', latitude: 'Latitude',
...@@ -394,7 +396,7 @@ class MapModal { ...@@ -394,7 +396,7 @@ class MapModal {
const type = this.translations['poiType' + feature.properties.pointOfInterestTypeId]; const type = this.translations['poiType' + feature.properties.pointOfInterestTypeId];
const latitude = feature.geometry.coordinates[1].toFixed(this.coordinatePrecision); const latitude = feature.geometry.coordinates[1].toFixed(this.coordinatePrecision);
const longitude = feature.geometry.coordinates[0].toFixed(this.coordinatePrecision); const longitude = feature.geometry.coordinates[0].toFixed(this.coordinatePrecision);
const buttonLabel = this.translations.selectLocation; const buttonLabel = this.isPoiMap ? this.translations.selectLocation : this.translations.selectCoordinates;
if(this.isPoiMap) { if(this.isPoiMap) {
popupElement.innerHTML = `<h4>${name}</h4> popupElement.innerHTML = `<h4>${name}</h4>
...@@ -470,7 +472,7 @@ class MapModal { ...@@ -470,7 +472,7 @@ class MapModal {
</select> </select>
</div> </div>
<div class="form-group text-right"> <div class="form-group text-right">
<button id="map-poi-submit-button" class="btn btn-primary">${this.translations.selectLocation}</button> <button id="map-poi-submit-button" class="btn btn-primary">${this.isPoiMap ? this.translations.selectLocation : this.translations.selectCoordinates}</button>
</div> </div>
</div>`; </div>`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment