flask-extensions / flask-extensions/Flask-GoogleMaps

[bug] All the described ways of showing a map in this repo don't work

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

Description

**Describe the bug**
A clear and concise description of what the bug is.

All the described ways of showing a map in this repo don't work.

**To Reproduce**
Steps to reproduce the behavior:

1. Having the following folder structure

# /path/
# ...../folder/...
├── README.md
├── __pycache__
│   └── app.cpython-310.pyc
├── app.py
├── static
└── templates
└── example.html

2. Having the following config files:

Config files

**/path/.env**
```bash
Your .env content here
```

and

**/path/settings.toml**
```toml
[default]
```

3. Having the following app code:

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

app = Flask(__name__, template_folder=".")
GoogleMaps(app)


@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('/templates/example.html', mymap=mymap, sndmap=sndmap)


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

```

4. Executing under the following environment

flask run, pycharm run, ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Debug output**

* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with watchdog (fsevents)
* Debugger is active!
* Debugger PIN: 119-826-731
127.0.0.1 - - [02/May/2022 23:59:41] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [02/May/2022 23:59:43] "GET / HTTP/1.1" 200

**Environment (please complete the following information):**
- OS: macOS Monterey 12.3.1

**Additional context**

example.html:





Title


{{googlemap("sndmap", lat=0.23234234, lng=-0.234234234, markers=[(0.12, -0.45345)])}}

s

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.