wp-plugin-leaflet-map icon indicating copy to clipboard operation
wp-plugin-leaflet-map copied to clipboard

Gesture Handling

Open acadian-nomad opened this issue 5 years ago • 3 comments

Would it be possible to implement gesture handling functionality into Leaflet Map like this Gesture Handling Leaflet plugin?

Plugin: https://github.com/elmarquis/Leaflet.GestureHandling

Demo: https://elmarquis.github.io/Leaflet.GestureHandling/examples/

Thanks!

acadian-nomad avatar Sep 21 '18 08:09 acadian-nomad

I was planning to work on an event feature which would allow adding plugins, though this is a little different than I thought because it's only an option as opposed to a map method. I suppose I could add a wp filter on the map options, so you could add your own options in functions.php.

I could pass this PHP array to be filtered:

https://github.com/bozdoz/wp-plugin-leaflet-map/blob/master/shortcodes/class.map-shortcode.php#L112

Something like:

$more_options = apply_filters('leaflet-map-options-filter', $more_options);

Then you could append to them using add_filter:

function example_callback( $example ) {
    $example['gestureHandling'] = true;
    return $example;
}
add_filter( 'leaflet-map-options-filter', 'example_callback' );

using apply_filters: https://developer.wordpress.org/reference/functions/apply_filters/

bozdoz avatar Sep 21 '18 11:09 bozdoz

Related to #64

bozdoz avatar Apr 08 '19 20:04 bozdoz

Actually this can be resolved by using the current FAQ of how to add a plugin. With the gesture handling script, all you need is: map.gestureHandling.enable()

bozdoz avatar Dec 18 '20 04:12 bozdoz

Hi Bozdoz, I think, you can close this issue, Extensions for Leaflet Map handles this.

hupe13 avatar Aug 21 '22 08:08 hupe13