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

Configurable collapse, i.e. show or hide map by default, fixes #73 #114

Closed Herugrim closed 4 years ago

Herugrim commented 4 years ago

Added a 'mapdisplay' attribute to configure default behaviour of map, in my usecase this is a user-preference so i take initiate a Map object with a 'mapdisplay' parameter:

             sndmap = Map(
                identifier = "sndmap",
                varname = "sndmap",
                lng=longitude,
                lat=latitude,
                markers=[(latitude, longitude)],
                style = "height:600px;",
                collapsible = True,
                fullscreen_control = True,
                streetview_control = False,
                mapdisplay = mapdisplay
               )

Added a simple if statement in gmapjs.html to click on the button in case mapdisplay = True. This could probably be coded in a more efficient way but it works.

Riverfount commented 4 years ago

Hi @Herugrim,

Please review this PR because it doesn't pass in all of our tests! After that, we can merge this PR.