• Resolved funkycrumble

    (@funkycrumble)


    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/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Anyone have a solution for this?

    I have the same problem.

    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.

    Still no solution?

    Thread Starter funkycrumble

    (@funkycrumble)

    Not as far as I know 🙁

    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);
    						});

    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?

    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.

    Plugin Contributor alexanderzagniotov

    (@alexanderzagniotov)

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Double-click for zoom not working’ is closed to new replies.