Use Leaflet in your django projects
Project description
django-leaflet allows you to use Leaflet (version 0.3) in your Django projects.
INSTALL
pip install django-leaflet
USAGE
Add leaflet to your INSTALLED_APPS
Add the HTML header :
{% load leaflet_tags %}
<head>
...
{% leaflet_js %}
{% leaflet_css %}
</head>
Add the map in your page :
...
<body>
...
{% leaflet_map "yourmap" %}
...
</body>
Use the Leaflet API as usual on the resulting yourmap object :
<script type="text/javascript">
...
// Add background layer from MapBox
yourmap.addLayer(new L.TileLayer('http://{s}.tiles.mapbox.com/v3/mapbox.mapbox-light/{z}/{x}/{y}.png'));
...
</script>
Give your maps a size (mandatory) :
<style>
.leaflet-container {
width: 600px;
height: 400px;
}
#specialbigmap {
height: 800px;
}
</style>
LICENSE
Lesser GNU Public License
Leaflet Copyright - 2010-2011 CloudMade, Vladimir Agafonkin
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-leaflet-0.0.2.tar.gz
(69.2 kB
view details)
File details
Details for the file django-leaflet-0.0.2.tar.gz.
File metadata
- Download URL: django-leaflet-0.0.2.tar.gz
- Upload date:
- Size: 69.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ae270d8426f8cb3dbb9aefdcc5ca8e0eefbd9dabb39f6a63b2dd03ea72ae32a
|
|
| MD5 |
459b8c0d34a771ba82eb0f9295251500
|
|
| BLAKE2b-256 |
e3a176d5a9d4ce67dcf1522466e9f728b9ab6eaaedf6debb6bc3642833cc6ace
|