• Resolved skirridsystems

    (@skirridsystems)


    I’m trying to display an openstreetmap map inside a popup using Leaflet maps. The problem is that the map initialises while the popup is hidden, and when the popup opens, only a single map tile is displayed. I can fix that by calling map.invalidateSize() but I need something to hook into to call that function.

    I have tried a mutation observer but observing my own map div doesn’t work and I’m not sure what else to observe. Observing the whole document seems like a blunt instrument.

    Any suggestions?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Ketan Patel

    (@patelketan)

    Hi @skirridsystems ,

    Thank you for reaching us…

    We have provided some custom hook/events to re-initialize the map when the popup opens in your custom script.

    You can use the below events to manage this,
    1) paoc_popup_open ( Trigger fires right before begins to open )
    2) paoc_popup_complete ( Trigger fires right after loaded content is displayed )
    3) paoc_popup_close ( Trigger fires once is closed )

    For example how to use this events,

    $(document).on('paoc_popup_open', function( e, target, options ) {
     // Your snippet code is here
    });

    Please check and let me know if anything.

    Thank You!!

    Thread Starter skirridsystems

    (@skirridsystems)

    Thanks, that did the trick.
    I had to use jQuery(document).on instead of $(document).on

    Plugin Contributor Ketan Patel

    (@patelketan)

    Hello,

    If you like our plugin please give you an important Rate and Review it Here…??
    https://www.ads-software.com/support/plugin/popup-anything-on-click/reviews/

    Thanks,

    Thread Starter skirridsystems

    (@skirridsystems)

    One other query. If I have multiple popups on the same page, how can I tell which one is firing the paoc_popup_open event? What are the arguments in the callback function?

    Plugin Contributor Ketan Patel

    (@patelketan)

    Hi @skirridsystems

    Thanks for your response.

    ‘paoc_popup_open’ event have two parameters. target and options. You can check them by console.log

    target will have current popup Dom element and options will have the popup configuration containing popup ID.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Event on popup display’ is closed to new replies.