Viewing 1 replies (of 1 total)
  • Plugin Author WPGMaps

    (@wpgmaps)

    Hi Omar
    We need to add a small piece of code to make the map work in tabs.

    In wpgooglemaps.php look for this section:

    jQuery('body').on('tabsactivate', function(event, ui) {
        MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
        UniqueCode=Math.round(Math.random()*10000);
        MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>,null,null,null);
    });

    Just below that, add this and modify it to suit your tab classes

    jQuery('body').on('click', '.CLASS_NAME OF TAB', function(event, ui) {
        MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
        UniqueCode=Math.round(Math.random()*10000);
        MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>,null,null,null);
    });
Viewing 1 replies (of 1 total)

The topic ‘Maps not working with tabs’ is closed to new replies.