Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Search for “function initializeGmap()” inside the /js/wpsl-gmap.js folder and place this code inside the function.

    $( "#wpsl-gmap").hide();

    Then search for “$( “#wpsl-search-btn” ).on( “click”, function()”, and place this inside it.

    $( "#wpsl-gmap").show();
    Thread Starter jemsz

    (@jemsz)

    Hi Tijmen,
    Thanks for the response.. I’ve inserted the code you can see below. The map is correctly hidden when loading the page however when the map shows its very small and takes up 1/10 of its original size for some reason, any idea? Thanks Image here

    function initializeGmap()

    function initializeGmap() {$( "#wpsl-gmap").hide();
        var myOptions, zoomControlPosition, zoomControlStyle, latLng, zoomLevel, mapType,
    		streetViewVisible = ( wpslSettings.streetView == 1 ) ? true : false;
    
        /* If no zoom location is defined, we show the entire world */
        if ( wpslSettings.zoomLatlng !== "" ) {
    		latLng		= wpslSettings.zoomLatlng.split( ',' );
    		startLatLng = new google.maps.LatLng( latLng[0], latLng[1] );
    		zoomLevel	= parseInt( wpslSettings.zoomLevel );
        } else {
    		startLatLng = new google.maps.LatLng( 0,0 );
    		zoomLevel	= 1;
    
        }

    $( “#wpsl-search-btn” ).on( “click”, function()

    /* Handle clicks on the search button */
    $( "#wpsl-search-btn" ).on ( "click", function() {$( "#wpsl-gmap").show();
    	var keepStartMarker = false;
    	$( "#wpsl-search-input" ).removeClass();
    
    	if ( !$( "#wpsl-search-input" ).val() ) {
    		$( "#wpsl-search-input" ).addClass( "wpsl-error" ).focus();
    	} else {
    		$( "#wpsl-result-list ul" ).empty();
    		$( "#wpsl-stores" ).show();
    		$( ".wpsl-direction-before, .wpsl-direction-after" ).remove();
    		$( "#wpsl-direction-details" ).hide();
    		resetMap = false;
    		deleteOverlays( keepStartMarker );
    		deleteStartMarker();
    		codeAddress();
    
    	}
    });

    Plugin Author Tijmen Smit

    (@tijmensmit)

    That’s really weird, never seen that happen before. I don’t have time today, but I will look into it tomorrow and let you know.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Can you try to also add this line inside the ‘wpsl-search-btn’ handler. So you add these two lines inside the “$( “#wpsl-search-btn” ).on( “click”, function()”

    $( "#wpsl-gmap").show();
    google.maps.event.trigger(map, 'resize');
    Thread Starter jemsz

    (@jemsz)

    HI Tijmen,
    Thanks very much for your reply.
    1 Last QQ – See attached image, whilst loading the map is totally off Australia. Is it possible to hide the map completely during this process until the result is shown?
    Or make Australia show instead of New Zealand?
    Image Here

    Look forward to the pro version
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide map – until searching for Store’ is closed to new replies.