Skip to content

Commit

Permalink
Improve map popup content display
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Aug 22, 2024
1 parent 5630b4f commit eba229e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions frontend/src/stores/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ export const useMapStore = defineStore('map', () => {
function onEachFeature(feature, layer) {
let content = `<h3>Perceptual model of <strong>${feature.properties.location.long_name}</strong></h3>`
content += `<p>${feature.properties.citation.citation}</p>`
content += '<hr>'
content += `<p><strong>${feature.properties.model_type.name}</strong></p>`
content += '<hr><br>'
content += `<h4>${feature.properties.model_type.name}</h4>`
if (feature.properties.model_type.name === 'Text model') {
content += `<p>${feature.properties.textmodel_snipped}</p>`
} else {
content += `<img src="${feature.properties.figure_url}" style="width: 100%">`
}
content += '<hr>'

content += '<hr><br>'
content += '<h4>Processes:</h4>'
content += '<ul>'
feature.properties.process_taxonomies.forEach((process_taxonomy) => {
Expand All @@ -33,7 +32,7 @@ export const useMapStore = defineStore('map', () => {
feature.properties.spatial_zone_type?.spatial_property &&
feature.properties.spatial_zone_type.spatial_property != 'N'
) {
content += '<hr>'
content += '<hr><br>'
content += '<h4>Spatial zone:</h4>'
content += `${feature.properties.spatial_zone_type.spatial_property}`
}
Expand All @@ -42,7 +41,7 @@ export const useMapStore = defineStore('map', () => {
feature.properties.temporal_zone_type?.temporal_property &&
feature.properties.temporal_zone_type.temporal_property != 'N'
) {
content += '<hr>'
content += '<hr><br>'
content += '<h4>Temporal zone:</h4>'
content += `${feature.properties.temporal_zone_type.temporal_property}`
}
Expand Down

0 comments on commit eba229e

Please sign in to comment.