Skip to content

Commit f755bcd

Browse files
added feature 3 code, which helps to turn on and off the bicycle lane
1 parent 7020ae5 commit f755bcd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

flask_googlemaps/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def __init__(
4949
clickpos_uri="",
5050
styles="",
5151
layer="",
52+
bicycle_layer=False,
5253
**kwargs
5354
):
5455
"""Builds the Map properties"""
@@ -91,6 +92,7 @@ def __init__(
9192
self.fit_markers_to_bounds = fit_markers_to_bounds
9293
self.styles = styles
9394
self.layer = layer
95+
self.bicycle_layer = bicycle_layer
9496

9597

9698
def build_markers(self, markers):

flask_googlemaps/templates/googlemaps/gmapjs.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@
6363
map: {{gmap.varname}},
6464
});
6565

66+
// add bicycle layer
67+
{% if gmap.bicycle_layer %}
68+
const bicycleLayer = new google.maps.BicyclingLayer();
69+
bicycleLayer.setMap({{gmap.varname}});
70+
{% endif %}
71+
72+
6673
// add gmap markers
6774
var raw_markers = {{gmap.markers|tojson|safe}};
6875
for(i=0; i<{{gmap.markers|length}};i++) {

0 commit comments

Comments
 (0)