WordPress.org

Ready to get started?Download WordPress

Forums

Comprehensive Google Map Plugin
[resolved] Double-click for zoom not working (10 posts)

  1. funkycrumble
    Member
    Posted 1 year ago #

    First of all, awesome plugin!

    The only problem I'm experiencing is when I try to zoom into the map by double clicking on it (both normal maps and mashup) - the first time I double click in order to zoom in it works as expected. But if I try to zoom in again, the first click makes the map zoom out! This means that after zooming in once, if you try to zoom in again by double-clicking, the first click will make it zoom out, and the second click won't have any effect.

    This is not a serious problem for normal maps which usually have few markers, but for a mashup map where you probably start viewing an entire city and want to zoom in to see the location of a specific marker, it can get quite furstrating (you are forced to use the ± buttons).

    Any suggestions?

    Thanks!

    http://wordpress.org/extend/plugins/comprehensive-google-map-plugin/

  2. christianhallgren
    Member
    Posted 11 months ago #

    Anyone have a solution for this?

  3. thaiauto
    Member
    Posted 9 months ago #

    I have the same problem.

  4. thaiauto
    Member
    Posted 9 months ago #

    I think it is about the event 'click' on google maps API.
    Something like setCenter, reset, bound, etc.

    I tried to disable some code in framework but it does not make any effect.

    If someone know about this, please share too.

  5. gremlinos
    Member
    Posted 8 months ago #

    Still no solution?

  6. funkycrumble
    Member
    Posted 8 months ago #

    Not as far as I know :(

  7. gremlinos
    Member
    Posted 8 months ago #

    I have a solution.
    In cgmp.framework.min.js delete:

    google.maps.event.addListener(marker, 'click', function () {
    
    							resetDirectionAddressFields(dirDivId);
    
    							$(dirDivId).fadeOut();
    							directionsRenderer.setMap(null);
    							targetDiv.html("");
    							targetDiv.hide();
    							$(dirDivId + ' button#print_sub').hide();
    
                         validateMarkerStreetViewExists(marker, localBubbleData, dirDivId);
                         attachEventstoDirectionControls(marker, localBubbleData, dirDivId, targetDiv);
    
    							infowindow.setContent(localBubbleData.bubbleContent);
    							infowindow.setOptions({disableAutoPan: bubbleAutoPan == "true" ? false : true });
    							infowindow.open(googleMap, this);
    						});
  8. jakus
    Member
    Posted 8 months ago #

    I can't find that function in the .min.js file?

    It's in the uncompressed .js file, but removing that did nothing for me :(

    Any other ideas?

  9. jeryj
    Member
    Posted 7 months ago #

    I have a fix that worked for me.

    I couldn't find where to change it in the minified file, so you have to tell the plugin to use the unminified file as well. Here's what I did:

    1. Go to comprehensive-google-maps-plugin/head.php and change line 64 from this:

    wp_register_script('cgmp-google-map-orchestrator-framework', CGMP_PLUGIN_JS. '/cgmp.framework'.$minified.'.js', array(), CGMP_VERSION, true);

    to this:

    wp_register_script('cgmp-google-map-orchestrator-framework', CGMP_PLUGIN_JS. '/cgmp.framework.js', array(), CGMP_VERSION, true);

    2. Go to comprehensive-google-maps-plugin/assets/js/cgmp.framework.js and delete or comment out these lines (231-233):

    google.maps.event.addListener(googleMap, 'click', function () {
    	resetMap();
    });

    To comment them out, it would look like this:

    // google.maps.event.addListener(googleMap, 'click', function () {
    //	resetMap();
    // });

    That code is telling each click on the google map to reset it to the original zoom, I guess. Removing it fixed it for me, and I don't think it's causing any other issues by not being there. The code posted by gremlinos seems to just affect the clicks on the actual markers, not clicks on the maps.

  10. alexanderzagniotov
    Member
    Plugin Author

    Posted 3 months ago #

    Yes, the zoom on click has been disabled in favor of clicking on the google map to reset it to the original zoom

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic