WordPress.org

Ready to get started?Download WordPress

Forums

Pronamic Google Maps
[resolved] Disable zoom on scroll using mashup (3 posts)

  1. TiagoPires
    Member
    Posted 11 months ago #

    We have a wide Google map on our site and users trying to scroll down the page using a scroll wheel or scroll swiping on a tablet or phone end up zooming the map and cannot move down the page.

    1. is it possible to disable zooming on scroll?
    2. let them zoom using regular double click or zooming?

    This is the current code using the "'scrollwheel' => false" argument which we can't get to work. Thanks for the plugin!

    if ( function_exists( 'pronamic_google_maps_mashup' ) ) {
        pronamic_google_maps_mashup(
            array(
                'post_type' => 'city'
            ),
            array(
                'width'          => '100%',
                'height'         => 600,
                'map_type_id'    => 'terrain',
                'navigationControl' => false,
                'scrollwheel' => false,
    			'mapTypeControl' => false,
    			'scrollwheel' => false,
                'marker_options' => array(
                    'icon' => get_template_directory_uri(). '/images/marker.png'
                )
            )
        );
    }

    http://wordpress.org/plugins/pronamic-google-maps/

  2. Remco Tolsma
    Member
    Plugin Author

    Posted 11 months ago #

    You have to place the map option under the 'map_options' key.

    if ( function_exists( 'pronamic_google_maps_mashup' ) ) {
        pronamic_google_maps_mashup(
            array(
                'post_type' => 'city'
            ),
            array(
                'width'          => '100%',
                'height'         => 600,
                'map_type_id'    => 'terrain',
                'map_options' => array(
    			'navigationControl' => false,
    			'scrollwheel' => false,
    			'mapTypeControl' => false,
    			'scrollwheel' => false
                ),
                'marker_options' => array(
                    'icon' => get_template_directory_uri(). '/images/marker.png'
                )
            )
        );
    }

    See also the following example:
    https://github.com/pronamic/wp-pronamic-google-maps/blob/develop/examples/map-disable-map-controls.php

  3. TiagoPires
    Member
    Posted 11 months ago #

    And it was a simple as that... works great for desktops.

    Since swiping on mobile moves the map around in its frame instead of scrolling the page there is still a problem on phones and tablets as users find it hard to get to bellow-map content.

    if the site is visited on a mobile:
    http://novazelandiabrasil.com.br/cidades/

    Thanks again for the help! got us in much better place!

Reply

You must log in to post.

About this Plugin

About this Topic