https://github.com/bfontaine/jinja2_maps
Jinja2 filters for embedded maps and location URLs
https://github.com/bfontaine/jinja2_maps
jinja2 library maps python
Last synced: over 1 year ago
JSON representation
Jinja2 filters for embedded maps and location URLs
- Host: GitHub
- URL: https://github.com/bfontaine/jinja2_maps
- Owner: bfontaine
- License: mit
- Created: 2016-03-21T10:19:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T06:44:29.000Z (over 5 years ago)
- Last Synced: 2025-03-23T23:43:40.922Z (over 1 year ago)
- Topics: jinja2, library, maps, python
- Language: Python
- Homepage: https://jinja2-maps.readthedocs.io/en/latest/index.html
- Size: 29.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
===========
jinja2_maps
===========
``jinja2_maps`` is a set of filters to display locations in Jinja2 templates.
.. image:: https://travis-ci.org/bfontaine/jinja2_maps.svg?branch=master
:target: https://travis-ci.org/bfontaine/jinja2_maps
.. image:: https://readthedocs.org/projects/jinja2-maps/badge/?version=latest
:target: http://jinja2-maps.readthedocs.org/en/latest/?badge=latest
:alt: Documentation Status
Install
-------
.. code-block::
pip install jinja2_maps
Support
-------
============= === ===
Service URL Map
============= === ===
OpenStreetMap Yes Yes
Google Maps Yes
Apple Maps Yes
Bing Maps Yes
Mappy Yes
Wikimapia Yes
Yandex Maps Yes
HERE Maps Yes
ArcGIS Yes
============= === ===
Both Python 2.x and 3.x are supported.
Usage
-----
All filters take a location as a dict with ``latitude`` and ``longitude`` keys.
You can also pass an object with these attributes.
Before using any template you need to add the filters to your Jinja2
environment:
.. code-block:: python
from jinja2_maps import activate_filters
activate_filters(your_env)
If using Flask you can do the following:
.. code-block:: python
from jinja2_maps import activate_filters
activate_filters(app.jinja_env)
URLs
~~~~
.. code-block:: html+jinja
Check on OpenStreetMap
Check on Google Maps
Check in Maps
Check on Bing Maps
Check on Mappy
Check on ArcGIS
Check on HERE Maps
Check on Wikimapia
Check on Yandex Maps
URLs also support giving the zoom level (default is ``16``):
.. code-block:: html+jinja
Maps
~~~~
.. code-block:: html+jinja
{{ your_location | osm_map(width=500, height=400) }}