wp-plugin-leaflet-map
wp-plugin-leaflet-map copied to clipboard
Gesture Handling
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!
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/
Related to #64
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()
Hi Bozdoz, I think, you can close this issue, Extensions for Leaflet Map handles this.