diff --git a/examples/dark_mode.json b/examples/dark_mode.json new file mode 100644 index 0000000..049e213 --- /dev/null +++ b/examples/dark_mode.json @@ -0,0 +1,161 @@ +[ + { + "elementType": "geometry", + "stylers": [ + { + "color": "#242f3e" + } + ] + }, + { + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#746855" + } + ] + }, + { + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#242f3e" + } + ] + }, + { + "featureType": "administrative.locality", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#d59563" + } + ] + }, + { + "featureType": "poi", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#d59563" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "geometry", + "stylers": [ + { + "color": "#263c3f" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#6b9a76" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry", + "stylers": [ + { + "color": "#38414e" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#212a37" + } + ] + }, + { + "featureType": "road", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#9ca5b3" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry", + "stylers": [ + { + "color": "#746855" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#1f2835" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#f3d19c" + } + ] + }, + { + "featureType": "transit", + "elementType": "geometry", + "stylers": [ + { + "color": "#2f3948" + } + ] + }, + { + "featureType": "transit.station", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#d59563" + } + ] + }, + { + "featureType": "water", + "elementType": "geometry", + "stylers": [ + { + "color": "#17263c" + } + ] + }, + { + "featureType": "water", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#515c6d" + } + ] + }, + { + "featureType": "water", + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#17263c" + } + ] + } +] \ No newline at end of file diff --git a/examples/example_2.py b/examples/example_2.py new file mode 100644 index 0000000..d75efa0 --- /dev/null +++ b/examples/example_2.py @@ -0,0 +1,68 @@ +from flask import Flask, render_template +from flask_googlemaps import GoogleMaps, Map, icons +from dynaconf import FlaskDynaconf +#enter the api key below +api = '' +app = Flask(__name__) +GoogleMaps(app, key = api) +FlaskDynaconf(app) + +import json + + +@app.route("/") +def map_created_in_view(): + + with open('dark_mode.json') as d: + dark_data = json.load(d) + + wmap = Map( + identifier="wmap", + varname="wmap", + lat=41.881832, + lng=-87.623177, + markers={ + icons.dots.green: [(37.4419, -122.1419), (37.4500, -122.1350)], + icons.dots.blue: [(37.4300, -122.1400, "Hello World")], + }, + style="height:400px;width:600px;margin:0;color:#242f3e;", + bicycle_layer = True, + ) + + + gmap = Map( + identifier="gmap", + varname="gmap", + lat=1.351616, + lng=103.808053, + markers={ + icons.alpha.A: [(1.351616, 103.808053), (37.4500, -122.1350)], + icons.dots.blue: [(37.4300, -122.1400, "Hello World")], + }, + style="height:400px;width:600px;margin:0;color:#242f3e;", + layer = "https://geo.data.gov.sg/dengue-cluster/2020/09/02/kml/dengue-cluster.kml" + ) + + dmap = Map( + identifier="dmap", + varname="dmap", + lat=1.351616, + lng=103.808053, + markers={ + icons.dots.green: [(37.4419, -122.1419), (37.4500, -122.1350)], + icons.dots.blue: [(37.4300, -122.1400, "Hello World")], + }, + style="height:400px;width:600px;margin:0;color:#242f3e;", + styles=dark_data, + + ) + + # print(get_address(api, 22.4761596, 88.4149326)) + return render_template("example_2.html", dmap=dmap ,gmap = gmap, wmap = wmap,key = api) + + + + + +if __name__ == "__main__": + app.run(port=5050, debug=True) diff --git a/examples/templates/example_2.html b/examples/templates/example_2.html new file mode 100644 index 0000000..2cdb137 --- /dev/null +++ b/examples/templates/example_2.html @@ -0,0 +1,24 @@ + + +
+ + +