0

Is this possible at all? This is my code so far

var marker = L.geoJSON(geojsonFeatureCamera, {
              pointToLayer: function (feature, latlng) {
               return L.circleMarker(latlng, geojsonMarkerOptionsCamera);
              },
              onEachFeature: function(feature, layer) {
               layer.on('mouseover', function(e) {
                do_something();
               });
              }
             });

I am able to do_something. E.g. open een Popup or write something to console. But I would like to open an image (of which the name is in feature.image) with FancyBox 5. And I am totally stuck on how to do that. Can somebody help me with this?

Thanks in advance!

Could not find any results regarding Fancybox5 in Google.

5
  • Check out examples here - fancyapps.com/fancybox/plugins/images/#programmatic
    – Janis
    Commented May 9, 2023 at 11:01
  • Thanks. I saw this doc. Bu I still have no clue how to use this from a Javascript-function.
    – Derko
    Commented May 9, 2023 at 12:41
  • If feature.show is a link to image, then it would be as simple as Fancybox.show([{ src: feature.show} ]);. If you want to know how to add click event, then try googling "leaflet marker click event", you will find samples.
    – Janis
    Commented May 9, 2023 at 12:58
  • Wow! You made my day. And so simple. But, could I have learned this from fancyapps.com/fancybox? Thanks again!
    – Derko
    Commented May 9, 2023 at 13:09
  • <shame on> Yes I could have learned. From the link you provided in your first answer <shame off>
    – Derko
    Commented May 9, 2023 at 14:31

0

Browse other questions tagged or ask your own question.