Skip to main content

Lektor template filter to convert geojson objects to Leaflet maps

Project description

lektor-leaflet-geojson

Run tests codecov PyPI Version License Python Compatibility Code style: black

Lektor template filter to convert geojson objects to Leaflet maps

Installation

pip install lektor-leaflet-geojson

Usage

Import the leaflet JS and CSS. You can skip this step if you are managing Leaflet yourself (e.g: with NPM)

{{ import_leaflet('1.7.1') }} {# using a specified version #}
{{ import_leaflet() }} {# default to "latest" #}

The |map() filter can be used to render a GeoJSON feature on a map. Pass some inline CSS to style the map div.

{{
  '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [125.6, 10.1]}}' | map("height: 300px; width: 300px;")
}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lektor-leaflet-geojson-0.2.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

lektor_leaflet_geojson-0.2.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page