Support » Plugin: Leaflet Maps Marker (Google Maps, OpenStreetMap, Bing Maps) » incomplete map when loading in a hidden layer

  • 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/

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

    (@harmr)

    the leaflet function invalidatesize() can be used for this

    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?!

    Plugin Author RobertHarm

    (@harmr)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘incomplete map when loading in a hidden layer’ is closed to new replies.