map_with_geojson()
map
leaflet-scroll-intent.js
and
Leaflet.fullscreen
on by default.
And a L.contro.scale
as a bonus.
Adding two baselayers or 1 or more overlays will add a layers control.
leaflet-providers
for a list of free tile layers.
leaflet-search can be anabled by adding a property.
leaflet-search can be anabled by adding a property.
Pass the geojson object as the third argument.
Make sure to properly escape the geojson when using Django templates:
{{ geojson | safe }}
.
If a feature contains name
property, a popup will be opened
containing that name when a user clicks on the map.
If a Point
feature contains a marker-color
property,
a colored icon from leaflet-color-markers is selected
(shown here are black
and red
, default is blue
)
Adding default leaflet markers is quite expensive and clutters the display.
Use circle-marker
property to display
L.CircleMarker instead.
Example also shows how to load geojson asynchonously using jquery and how to add geojson to an already existing map.