Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Leaflet map in a Tab

SimonSoftware edited this page Dec 23, 2014 · 1 revision

If you want show the leaflet map in a tab you must set a map global var. Before init the map you must set
$leafLet = new LeafLet(['name' => 'geoMap',....... and then set $leafLet->setJs("window.leaf_map = geoMap;");

You must set the "id" property as ['label' => 'Map', 'options' => ['id' => 'maptab'],......... and after this, in the Tab configuration you must intercept the "shown" event

'clientEvents' => [ 'shown.bs.tab' => new JsExpression("function( event, ui ) { debugger; if (event.target.hash == '#maptab') leaf_map.invalidateSize(false); }") ]

Clone this wiki locally