Skip to content

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

@ghost

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
  1. Having the following config files:
Config files

/path/.env

Your .env content here

and

/path/settings.toml

[default]
  1. 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': "<b>Hello World</b>",
              },
              {
                  'icon': 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
                  'lat': 37.4300,
                  'lng': -122.1400,
                  'infobox': "<b>Hello World from other place</b>",
              },
          ],
      )
      return render_template('/templates/example.html', mymap=mymap, sndmap=sndmap)
  
  
  if __name__ == "__main__":
      app.run(debug=True)

  1. 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:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{{googlemap("sndmap", lat=0.23234234, lng=-0.234234234, markers=[(0.12, -0.45345)])}}
</body>
</html>

s

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions