This code works, except for the line with the note:
// Listen to js_event_wpv_addon_maps_init_map_completed
$( 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( event_settings.map_id );
// Use Maps API .setOptions() method to programmatically change any option on the map.
if ( map ) {
map.setOptions({
gestureHandling: 'none',
});
map.setZoom(4); <------- NOT WORKING
}
} );
Am I doing something wrong? Every set in "setOption" is working correctly
Hello. Thank you for contacting the Toolset support.
Well - could you please try to use following code:
jQuery(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,
});
}
});