• blackspiral

    (@blackspiral)


    I’m loading a map within a collapsed div using bootstrap 4.6 panel. On load it only loads a tiny portion of the map tiles unless you expand the map or move it.

    I understand there is a method in leaflet.js to call invalidateSize() on the trigger link, but can you advise how to implement this with the plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Chandni Patel

    (@phpwebdev)

    Hello @blackspiral,

    It is possible for you to trigger resize on map element once the tab is open?

    Regards,
    Chandni

    Thread Starter blackspiral

    (@blackspiral)

    Sure, I can target the .show class on the collapse element, but can you help with the .js to do so?

    I’ve tried variations on:

    $('#swad_link').on('show.bs.collapse', function () {
    map.invalidateSize();
    })

    I get “map is not defined” in the console.

    Plugin Author Chandni Patel

    (@phpwebdev)

    @blackspiral Can you please share a link where I can check this?

    Thread Starter blackspiral

    (@blackspiral)

    Its a dev site so would need to send you a password… Can I email it to you?

    Plugin Author Chandni Patel

    (@phpwebdev)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Loading map in a hidden element’ is closed to new replies.