WordPress.org

Ready to get started?Download WordPress

Forums

Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps)
incomplete map when loading in a hidden layer (4 posts)

  1. chris_muc
    Member
    Posted 1 year ago #

    i want to show a map with markers when i click on a "show" button. therefore the map is loaded in a hidden div.

    but when changing the div's display to block, only the first tile of the map is loaded. when resizing the browser window the map is redrawn and all leaflet-tiles are loaded.

    is it possible to force loading all leaflet-tiles of the map via jquery?

    i am using wp 3.5. with mapsmarkers 3.4.3.

    http://wordpress.org/extend/plugins/leaflet-maps-marker/

  2. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    the leaflet function invalidatesize() can be used for this

  3. chris_muc
    Member
    Posted 1 year ago #

    thank you for the quick reply, robert.
    i just tried

    $('my-map-layer').invalidateSize();

    within the document.ready function, but all i get is

    Object [object Object] has no method 'invalidateSize'

    I also tried $(window). and $(document) but altough leaflet.js is loaded the function is not found. What am i doing wrong?!

  4. RobertHarm
    Member
    Plugin Author

    Posted 1 year ago #

    sorry - dont know - took a look again - I use invalidateSize() to reload the map when container size changes (responsive design)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.