flask-extensions / Flask-GoogleMaps

Easy way to add GoogleMaps to Flask applications. maintainer: @getcake
https://flask-googlemaps.com
MIT License
647 stars 196 forks source link

Feature Request: Configurable collapse, i.e. show or hide default #73

Open Herugrim opened 6 years ago

Herugrim commented 6 years ago

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:

<script>function showmap() { document.getElementById('sndmap_collapse').click(); } window.onload = showmap </script>

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.