Forums › Bug Reports › Disable scroll zoom not working on results page
- This topic has 7 replies, 4 voices, and was last updated 3 years, 2 months ago by
wisebuilds.
-
AuthorPosts
-
December 10, 2015 at 1:31 am #49397
Keith
MemberHi
I have set up a custom results page and have split up the map and results. When I use the following shortcode, scroll wheel zoom is still enabled. Is there anything I can do to override it?
<?php echo do_shortcode('[gmw map="1" scrollwheel_map_zoom="0"]'); ?>
I’ve managed to disable it elsewhere on the site, but this one page is proving problematic.Thanks.
December 10, 2015 at 4:48 am #49406Eyal Fitoussi
MemberHI Keith,
There is no “scrollwheel_map_zoom” attribute available with GEO my WP.I’ve managed to disable it elsewhere on the site, but this one page is proving problematic.
How did you manage to do that for other map?
Which version of GEO my WP are you using?
Are you using any paid add-ons or the free version only?
I am only asking because there are not settings or shortcode attributes available in the free version that will disable the scroll zoom. It can only be done via filters.
December 10, 2015 at 6:50 am #49413Keith
MemberIt’s in your own documentation here. Point 12.
http://docs.tempform.wpengine.com/single-location-shortcode/
I have the global maps add-on.
December 11, 2015 at 6:30 am #49459Eyal Fitoussi
MemberAh, you’r right. I totally forgot about this shortcode. Sorry about that.
However, this attribute is not available with the search forms shortcodes. That’s for the main reason that the search forms shortcodes do not use any attributes and everything is setup using the form builder.
add the script below to the functions.php file of your theme and see if it works:
1234567function gmw_disable_scroll_zoom( $args ) {$args['mapOptions']['scrollwheel'] = false;return $args;}add_filter( 'gmw_map_element_1', 'gmw_disable_scroll_zoom', 50 );December 24, 2015 at 5:32 pm #49691Eyal Fitoussi
MemberThis topic marked “Resolved” due to inactivity. If you wish to reply to this topic please change its status to “Not resolved” before replying.
July 9, 2018 at 4:43 am #57744Lee Fuller
MemberHello Eyal,
I’ve tried the above script – and it is not working for me. And I see this is an older topic, so maybe there is another solution already in place?
March 24, 2019 at 6:49 am #58883wisebuilds
MemberHi Lee,
A little late, but since I found this topic, here is a working snippet for Geo my WP v 3.2.1:
1234567function wbs_gmw_disable_scroll_zoom( $map_element ) {$map_element[&039;map_options&039;][&039;scrollwheel&039;] = false;return $map_element;}add_filter( 'gmw_map_element_1', 'wbs_gmw_disable_scroll_zoom', 50 );March 24, 2019 at 6:56 am #58886wisebuilds
MemberThe code tag is not accepting single quotes so lets try it in a blockquote:
function wbs_gmw_disable_scroll_zoom( $map_element ) {
$map_element[‘map_options’][‘scrollwheel’] = false;
return $map_element;
}
add_filter( ‘gmw_map_element_1’, ‘wbs_gmw_disable_scroll_zoom’, 50 ); -
AuthorPosts
You must be logged in to reply to this topic.