I inserted the following JS per your ticket #1155174jQuery(document).on('js_event_wpv_addon_maps_init_map_completed', function() {
// Get the map using our .get_map() method
var map = WPViews.view_addon_maps.get_map( event_settings.map_id );
// Use Maps API .setOptions() method to programmatically change any option on the map.
if ( map ) {
map.setOptions({
gestureHandling: 'none',
'maxZoom': 4,
});
}
});
It does not appear to be executing, is there something I must do to prepare for it?
My Map ID is map-8
Thankyou
Hello,
Since it is a custom JS codes problem, please provide a test site with the same problem, also point out the problem page URLs, I need to test and debug it in a live website, private message box enabled, thanks
Thanks for the details, I have done below modifications in your website, change this line of your custom JS codes from:
var map = WPViews.view_addon_maps.get_map( event_settings.map_id );
To:
var map = WPViews.view_addon_maps.get_map( 'map-8' );
The "map-8" is your map ID
Please test again, check if it is fixed, thanks
Thanks for your most excellent and timely support
The change is in:
var map = WPViews.view_addon_maps.get_map( 'map-8' );
I tried various values for the zoom, 'maxZoom': 4, -- but no effect
BTW, just so I know, under what circumstances would I have used the original code
var map = WPViews.view_addon_maps.get_map( event_settings.map_id );
Thanks again, I highly appreciate the work you do
Update: seems to work now since changing to the default theme and updating Toolset plugins to the very latest
I have tried again in your website:
1) Switch to theme "Astra" or "Newspaper"
2) Test it in front-end:
hidden link
Both tests work fine, is this problem resolved?
Please let me know if you still need assistance for it, thanks
For the new question:
under what circumstances would I have used the original code
The original custom JS code is outdated, you need to customize it according to your map IDs.