1212<!-- eslint-enable -->
1313
1414<template >
15- <v-content >
15+ <v-main >
1616 <v-slide-x-reverse-transition >
1717 <v-btn fab absolute small
1818 style =" top :1.2em ; right :1.3em ;"
6868 <a href =" https://www.openstreetmap.org/copyright" target =" _blank" >{{ $t('map') }}: Mapbox, © OpenStreetMap</a >
6969 </p >
7070
71- </v-content >
71+ </v-main >
7272</template >
7373
7474<style >
@@ -209,6 +209,14 @@ export default {
209209 pointToLayer : (feature , latlng ) => {
210210 if (feature .properties .radius ) {
211211 // properties need to match https://leafletjs.com/reference-1.6.0.html#circle
212+ if (feature .properties .title || feature .properties .description ) {
213+ feature .properties .className = ' popup-title-description' ;
214+ const clickcircle = new L.Circle (latlng, feature .properties );
215+ clickcircle .on (' click' , this .showTitleDescPopup );
216+ return clickcircle;
217+ }
218+ // if clickcircle has not been returned, return normal circle
219+ feature .properties .interactive = false ;
212220 return new L.Circle (latlng, feature .properties );
213221 }
214222 return new L.Marker (latlng);
@@ -217,6 +225,17 @@ export default {
217225 return geoJsonExtended;
218226 },
219227
228+ showTitleDescPopup (e ) {
229+ let content = e .target .options .description ;
230+ if (e .target .options .title ) {
231+ content = ` <b>${ e .target .options .title } </b><br />${ content} ` ;
232+ }
233+ new L.Popup ()
234+ .setLatLng (e .target ._latlng ) // eslint-disable-line no-underscore-dangle
235+ .setContent (content)
236+ .openOn (this .map );
237+ },
238+
220239 setupEmpty () {
221240 this .geobounds = this .geoboundsIn ;
222241 },
0 commit comments