Skip Navigation

[Resolved] Mobile Gestures on toolset map

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to set mobile gestures on Toolset map and set gestureHandling option to greedy.

Solution:
You can use Toolset Map's JS callback event js_event_wpv_addon_maps_init_map_completed in order to set or customize map options for your map.

For example:

jQuery( document ).on('js_event_wpv_addon_maps_init_map_completed', function( event, event_settings ) {
    // Get the map using our .get_map() method...
    var map = WPViews.view_addon_maps.get_map('map-2');    // adjust your map ID accordingly
 
    // And then use Maps API .setOptions() method to programmatically change any option on the map.
    if ( map ) {
        map.setOptions({gestureHandling: 'greedy'});
    }
} );

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/mobile-gestures-on-toolset-map/#post-624268

Relevant Documentation:

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by vitoV 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#623271

Hi everyone , i'm trying to move my map on mobile devices only using one finger, for example drag the map.
In my case i need to use two fingers gesture to drag the map.

You can see the issue on hidden link

I've tried to insert some code in according to Google Maps API and the code is

var map = WPViews.view_addon_maps.get_map( 'map-2' ), {
           gestureHandling: 'greedy'
        });

But i had an error in the code at the line where says 'greedy' as "Unexpected string"

So, what's the solution to make my map works with one finger gesture like drag map or double tap to zoom?

Thanks

#623300

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - when you try to insert the map - map already offers the "Map interaction" section where you can chose such options for dragging map, scroll and double click:
=> hidden link

If you set above option with map - its not working with mobile?

#623327

Thanks for your response,

referring to that options they works perfectly in mobile, but only using two finger gesturing.

I need a workaround to use just one finger to drag map on mobile, this because some phone, for example use two finger to regulate volume.

Can you help me?

#623582

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

No - there is no such feature available to hook in the new argument to view's map but we like this idea and I will take this request as a new feature request and report it to our concern department for assessment.

If feature request is approved - you will see it implemented in near future version. You should keep your eyes on our blog:
=> https://toolset.com/blog/

#624268

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please try following solution and feedback us if it help you to resolve your issue.

jQuery( document ).on('js_event_wpv_addon_maps_init_map_completed', function( event, event_settings ) {
	// Get the map using our .get_map() method...
	var map = WPViews.view_addon_maps.get_map('map-2');    // adjust your map ID accordingly

	// And then use Maps API .setOptions() method to programmatically change any option on the map.
	if ( map ) {
		map.setOptions({gestureHandling: 'greedy'});
	}
} );

Could you please confirm it works for you.

#624281

Ooohhhhhhhh Yes man!!! It works!! Thanks so much!

I'm sorry for not answering in these days but i've been very busy developing my site!!

Thanks again 😉

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.