The collapse directive automatically hides the map but it would be nice if a default could be set, i would for example like to have the map visible by default but show the button to hide it. I tried to add this line as a temporary hack in my template to show the map onload but that does not work:
EDIT: Adding document.getElementById('{{gmap.varname}}_collapse').click(); at the end of function init_{{gmap.identifier}}_button() in gmapjs.html does the trick, so an if on an extra parameter could do the trick.
The
collapse
directive automatically hides the map but it would be nice if a default could be set, i would for example like to have the map visible by default but show the button to hide it. I tried to add this line as a temporary hack in my template to show the maponload
but that does not work:<script>function showmap() { document.getElementById('sndmap_collapse').click(); } window.onload = showmap </script>
EDIT: Adding
document.getElementById('{{gmap.varname}}_collapse').click();
at the end offunction init_{{gmap.identifier}}_button()
ingmapjs.html
does the trick, so anif
on an extra parameter could do the trick.