Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Google Map Integration with Dash web framework

$
0
0

@string wrote:

In one of the requirement, I need to integrate Google Map with Dash framework and on map click - retrieve lat , long and address (on map click event).

I was able to retrieve the same using google API and flask framework using java script which gives Lat ,Long and Address based on map click event and renders Google Map

Here is the python code used in flask framework :

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import json
from flask import Flask, render_template, request

app = Flask(__name__)

@app.route('/map', methods=['GET', 'POST'])
def map():
location = {}
if request.method == "POST":
    location = request.get_json()
    # latitude = location['latitude']
    # longitude = location['longitude']
    print(location);
return render_template('map.html')

if __name__ == '__main__':
app.run(debug = True) # run app

Is there a way to achieve the same in Dash using similar method. Thank you.

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images