flask-extensions / flask-extensions/Flask-GoogleMaps

[bug]Maps not loading to page

Open
#146 11 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
655
Forks
193
PR merge metrics
No merged PRs in 30d

Description

I can't get the example maps to load to the page 'example.html'. When I go to my API metrics page on the Google Cloud Platform the number of calls to my API is not changing.

I have tested my API key with a standard JS request and it is increasing and therefore the key is working.

I have the following code on my app.py and my 'example.html' is exactly as is given in the repo front page.

Any ideas? Feedback is greatly appreciated.

```
from flask import Flask, render_template
from flask_googlemaps import GoogleMaps
from flask_googlemaps import Map

app = Flask(__name__)
app.config['GOOGLEMAPS_KEY'] = "my_API_key"
GoogleMaps(app, key="my_API_key")

@app.route("/")
def mapview():
# creating a map in the view
mymap = Map(
identifier="view-side",
lat=37.4419,
lng=-122.1419,
markers=[(37.4419, -122.1419)]
)
sndmap = Map(
identifier="sndmap",
lat=37.4419,
lng=-122.1419,
markers=[
{
'icon': 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
'lat': 37.4419,
'lng': -122.1419,
'infobox': "Hello World"
},
{
'icon': 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
'lat': 37.4300,
'lng': -122.1400,
'infobox': "Hello World from other place"
}
]
)
return render_template('example.html', mymap=mymap, sndmap=sndmap)

if __name__ == "__main__":
app.run(debug=True)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.