• Resolved ira242

    (@ira242)


    Hey there!

    We are desperately finding the right Maps plugin for a looming project deadline, and this one by far looks the best! Have a quick usage question though.

    We hide the map div wrapping before the user clicks to see it. When the “show”function is run, we see the map holder, and markers, but do not see the map itself. We DO see it though when we either resize the browser, or have it shown by default.

    Is there a way to target the Easy Google Map maps via jQuery, in order to force a resize or initialize? Tried something like:

    jQuery('.store_sort a.store_sort_map').on('click', function () {
    google.maps.event.trigger(map, 'resize');
    }

    This should work, but don’t know how to define the “map” in the second line. Any ideas?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author supsystic

    (@supsysticcom)

    Hello!
    I’m sorry for late reply.

    You need to pass ID of map to your “show” function and inside it call function gmpGetMapById(mapId).refresh();. The Map’s ID could be added, for example, to your Show button. It might look like this –

    Your theme template file:
    <button data-map_id=”3″ onclick=”showFunction(this); return false;”>Show</button>

    Your theme js file:
    showFunction(btn) {
    var mapId = jQuery(btn).data(‘map_id’);

    // Some code you need

    if(mapId) {
    gmpGetMapById(mapId).refresh();
    }
    }

    Please try it. If you will need our help – just let us know.

    Thread Starter ira242

    (@ira242)

    Thanks very much, this works a treat!

    I was ok with the free version features, but have purchased the full version as thanks for the support!

    Cheers,

    Ira

    Plugin Author supsystic

    (@supsysticcom)

    Hello.
    No problems, it’s always a big pleasure to help our users.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Way to re-initialize the maps in jQuery function?’ is closed to new replies.