diff --git a/src/components/Legend.jsx b/src/components/Legend.jsx index 6198e83..a304fe2 100644 --- a/src/components/Legend.jsx +++ b/src/components/Legend.jsx @@ -234,7 +234,7 @@ const LegendGroup = ({ title, children }) => { ) return children && children.length > 0 && ( - + {title ? titleElement : null} {group?.subheading && ( pointToIcon(l, { + icon: f.properties.icons.length > 0 ? + {f.properties?.name : null + }, 32, 0 + ), + onEachFeature: (f,l) => { + const imageURL = f.properties.pictures[0] + ? `https://greenmap.org/api-v1/pictures/${f.properties.pictures[0]}/picture/sm` + : null; + + l.bindPopup(mapPopupContent( + f.properties.name, + f.properties?.description?.blocks.filter((b) => b.type === "paragraph")[0]?.data.text ?? '', + `https://greenmap.org/browse/sites/${f.properties._id}`, + 'Show More at GreenMap.org', + imageURL + ), {offset: [0,-6]}); + } + }, + liveOverride: { + btn1: { + label: 'Plot Foods Here', + url: 'https://greenmap.org/explore/survey/68ae4104cdfbed010007727a', + }, + btn2: { + //label: 'View Map', + url: 'https://greenmap.org/explore/maps/68afbbf5b4508a0100cb776c', + }, + ogmNoAccountWarning: true, + }, +} + +export default layer; \ No newline at end of file diff --git a/src/data/layers/CultureCompassOGM.jsx b/src/data/layers/CultureCompassOGM.jsx new file mode 100644 index 0000000..31646e8 --- /dev/null +++ b/src/data/layers/CultureCompassOGM.jsx @@ -0,0 +1,50 @@ +import { mapPopupContent, pointToIcon, ogmFeaturesLink } from '../LeafletStyleHelpers'; + +const layer = { + title: 'Culture Compass', + description: [ + {type: 'p', content: "This is for plotting local cultural art and performance spaces."}, + ], + data: ogmFeaturesLink('68afc26db4508a0100cb7785'), + ogmMapId: '68afc26db4508a0100cb7785', + shape: 'point', + symbology: 'classified', + options: { + pointToLayer: (f,l) => pointToIcon(l, { + icon: f.properties.icons.length > 0 ? + {f.properties?.name : null + }, 32, 0 + ), + onEachFeature: (f,l) => { + const imageURL = f.properties.pictures[0] + ? `https://greenmap.org/api-v1/pictures/${f.properties.pictures[0]}/picture/sm` + : null; + + l.bindPopup(mapPopupContent( + f.properties.name, + f.properties?.description?.blocks.filter((b) => b.type === "paragraph")[0]?.data.text ?? '', + `https://greenmap.org/browse/sites/${f.properties._id}`, + 'Show More at GreenMap.org', + imageURL + ), {offset: [0,-6]}); + } + }, + liveOverride: { + btn1: { + label: 'Plot Culture Here', + url: 'https://greenmap.org/explore/survey/68afb531fbd3bc01001bfc91', + }, + btn2: { + //label: 'View Map', + url: 'https://greenmap.org/explore/maps/68afc26db4508a0100cb7785', + }, + ogmNoAccountWarning: true, + }, +} + +export default layer; \ No newline at end of file diff --git a/src/data/questions/BeHappy.jsx b/src/data/questions/BeHappy.jsx index d32e552..e1e8d8e 100644 --- a/src/data/questions/BeHappy.jsx +++ b/src/data/questions/BeHappy.jsx @@ -23,6 +23,7 @@ const Question = { { key: 'NativeLandDigitalTerritories', active: false, group: 'Indigenous' }, { key: 'NativeLandDigitalTreaties', active: false, group: 'Indigenous' }, { key: 'NatureInspiredPlaygrounds', active: true, ...LegendGroups.OGM }, + { key: "CultureCompassOGM", active: true, ...LegendGroups.OGM }, ], sections: { one: [ diff --git a/src/data/questions/CreateCommunity.jsx b/src/data/questions/CreateCommunity.jsx index e3a36d1..07658b9 100644 --- a/src/data/questions/CreateCommunity.jsx +++ b/src/data/questions/CreateCommunity.jsx @@ -30,7 +30,7 @@ const Question = { { key: 'CoastalFloodInundationScenarios', active: false, group: 'Water' }, { key: 'CRD_Parks', active: false, group: 'Greenspace' }, { key: 'CRDBikeMap', active: false, group: 'Civic' }, - { key: 'CulturalFoods', active: false, ...LegendGroups.OGM }, + { key: 'CulturalFoods', active: false, group: 'Food' }, { key: 'DrinkingFountains', active: false, group: 'Civic' }, { key: 'ENBS', active: false, group: 'Greenspace' }, { key: 'EVChargingStations', active: false, group: 'Energy' }, @@ -81,6 +81,9 @@ const Question = { { key: 'VictoriaShelters', active: false, group: 'Community' }, { key: 'WatershedRunoffAbsorption', active: false, group: 'Water' }, { key: 'Watersheds', active: false, group: 'Water' }, + + { key: "CulturalFoodsOGM", active: false, ...LegendGroups.OGM }, + { key: "CultureCompassOGM", active: false, ...LegendGroups.OGM }, ], sections: { one: [ diff --git a/src/data/questions/EatLocal.jsx b/src/data/questions/EatLocal.jsx index f64143d..99663c5 100644 --- a/src/data/questions/EatLocal.jsx +++ b/src/data/questions/EatLocal.jsx @@ -20,7 +20,8 @@ const Question = { { key: "ShellfishPO", active: false, ...LegendGroups.StartOff }, { key: "FarmToFork", active: false, ...LegendGroups.OGM }, { key: "Pollinators", active: false, ...LegendGroups.OGM }, - { key: "CulturalFoods", active: true, ...LegendGroups.OGM }, + { key: "CulturalFoods", active: false, ...LegendGroups.StartOff }, + { key: "CulturalFoodsOGM", active: true, ...LegendGroups.OGM }, ], sections: { one: [