bozdoz / wp-plugin-leaflet-map

Add leaflet maps to Wordpress with shortcodes
https://wordpress.org/plugins/leaflet-map/
GNU General Public License v2.0
140 stars 71 forks source link

Adds new shortcode suport for imageOverlay LeafLet feature #148

Closed sardylan closed 1 year ago

sardylan commented 2 years ago

I added support to imageOverlay feaure available in LeafLet library creating a new shortcode. Since "image" was already used, i created the [leaflet-overlay] shortcode.

This is an example of the new feature working on a WordPress installation (not yet published). It a simple map with one marker and one overlay image.

map

And this is the code used on Pod Template:

[leaflet-map zoomcontrol scrollwheel detect-retina
    lat="{@latitude}" lng="{@longitude}" zoom=8]
[leaflet-overlay url="{@coverage_image}"
    north="{@coverage_boundary_north}"
    south="{@coverage_boundary_south}"
    east="{@coverage_boundary_east}"
    west="{@coverage_boundary_west}"]
[leaflet-marker lat="{@latitude}" lng="{@longitude}"
    iconUrl="/markers/marker-{@modulation,value}-small.png"
    iconAnchor="12,48"]
bozdoz commented 2 years ago

This sounds great! Thanks!

bozdoz commented 2 years ago

Do you have an example I could test with?

sardylan commented 2 years ago

Hi bozdoz, unfortunately, the WP installation used for screenshots is still offline. We are still running the old portal. Do you have the possibility to test it in a local installation?

bozdoz commented 2 years ago

absolutely. Ran into some issues testing. I wanted to add a videoOverlay too, but finding that oddly difficult. Trying to troubleshoot now.

sardylan commented 2 years ago

Just rebased imageOverlay feature on new version.

I'm trying to add videoOverlay in the same way I have done with imageOverlay. In case of success, I'll open a new PR.

sardylan commented 2 years ago

Adding video tag, seems that every HTML component is rendered correctly. Don't know why, <video> tag has always a 0 width, but CSS is changed correctly. I also tried with z-index, but no video is rendered.

bozdoz commented 1 year ago

Thanks! Sorry this took awhile to look through!