All Projects → nnseva → django-leaflet-admin-list

nnseva / django-leaflet-admin-list

Licence: LGPL-3.0 License
The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to django-leaflet-admin-list

Leaflet Ng2
Angular.io integration of Leaflet
Stars: ✭ 66 (+135.71%)
Mutual labels:  map, leaflet, geo
vaguely-rude-places
The map of Vaguely Rude Place Names
Stars: ✭ 19 (-32.14%)
Mutual labels:  map, leaflet
georaster-layer-for-leaflet
Display GeoTIFFs and soon other types of raster on your Leaflet Map
Stars: ✭ 168 (+500%)
Mutual labels:  leaflet, geo
mapr
Map species occurrence data
Stars: ✭ 34 (+21.43%)
Mutual labels:  map, leaflet
leaflet.minichart
Leaflet.minichart is a leaflet plugin for adding to a leaflet map small animated charts
Stars: ✭ 27 (-3.57%)
Mutual labels:  map, leaflet
openfairdb
Open Fair DB is the CreativCommons Backend of Kartevonmorgen.org
Stars: ✭ 53 (+89.29%)
Mutual labels:  map, geo
MinedMap
Minecraft map renderer and viewer
Stars: ✭ 35 (+25%)
Mutual labels:  map, leaflet
d3-geomap
A library for creating geographical maps based on D3.js
Stars: ✭ 124 (+342.86%)
Mutual labels:  map, geo
mars2d
【Mars2D平台 】主仓库,包含所有开源仓库清单导航
Stars: ✭ 182 (+550%)
Mutual labels:  map, leaflet
PHPCoord
PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points
Stars: ✭ 78 (+178.57%)
Mutual labels:  map, geo
o.map
Open Street Map app - KaiOS
Stars: ✭ 51 (+82.14%)
Mutual labels:  map, leaflet
kirby-locator
A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.
Stars: ✭ 83 (+196.43%)
Mutual labels:  map, leaflet
leaflet-tag-filter-button
Adds tag filter control for layers (marker, geojson features etc.) to LeafLet.
Stars: ✭ 48 (+71.43%)
Mutual labels:  map, leaflet
leaflet-layer-tree-plugin
No description or website provided.
Stars: ✭ 31 (+10.71%)
Mutual labels:  map, leaflet
font-gis
Icon font and SVG for use with GIS and spatial analysis tools
Stars: ✭ 121 (+332.14%)
Mutual labels:  map, geo
papyruscs
PapyrusCS renders maps of Minecraft: Bedrock Edition worlds using C#, LevelDB and leaflet.
Stars: ✭ 221 (+689.29%)
Mutual labels:  map, leaflet
ClimateChangeProjections
An embeddable map that shows climate change projections. How hot will it be by 2070 if we don't do something about it? Accessible at https://climatechange.codeforafrica.org
Stars: ✭ 29 (+3.57%)
Mutual labels:  map, geo
Go Staticmaps
A go (golang) library and command line tool to render static map images using OpenStreetMap tiles.
Stars: ✭ 246 (+778.57%)
Mutual labels:  map, geo
coronavirus-map-dashboard
🦠 Coronavirus (COVID-19) Map Dashboard using coronavirus-tracker-api
Stars: ✭ 41 (+46.43%)
Mutual labels:  map, leaflet
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+9496.43%)
Mutual labels:  map, leaflet

Build Status

Django Leaflet Admin List

Screen Example

The Django Leaflet Admin List package provides an admin list view featured by the map and bounding box filter for the geo-based data of the GeoDjango. It requires a django-leaflet package.

Installation

Stable version from the PyPi package repository

pip install django-leaflet-admin-list

Last development version from the GitHub source version control system

pip install git+git://github.com/nnseva/django-leaflet-admin-list.git

Configuration

Include the leaflet_admin_list application into the INSTALLED_APPS list, like:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    ...
    'leaflet',
    'leaflet_admin_list',
    ...
]

Using

In your admin.py:

...
from leaflet.admin import LeafletGeoAdminMixin
from leaflet_admin_list.admin import LeafletAdminListMixin
...

class WaypointAdmin(LeafletAdminListMixin, LeafletGeoAdminMixin, ModelAdmin):
    ...

Visual View

Open the admin list view and see the map above the list of objects. Every object in the list is represented on the map.

Also, the bounding box filter is added to the list of filters.

Use a bounding box filter to filter objects by the geometry. Just press the 'Current map bounding box' link to filter out objects outside of the current map bounding box. The current filtering box will be represented on the map as a rectangle. The color of the rectangle is shown to the right of the 'Current map bounding box' link. Manual input of the bounding_box parameter in the address box also works.

As usual, pressing the filter or paging link will reload a page with new parameters. The map keeps its position for standard static Django filters and pager using permalink.

Customizing view

The geodata shown on the map is represented as GeoJSON feature collection. Every GeoJSON feature corresponds to one geo field of one Django model instance. All standard Django geometry-based fields are shown on the map by default. Every such feature has the following list of mandatory properties to be used:

  • field identifies the geometry field shown
  • app_label and model_name identify the model of the instance shown
  • pk is an instance primary key which identifies the model instance shown

The following optional GeoJSON feature properties are used to customize the look and feel of the feature on the map:

  • popup if present, is used to create a popup. A value started with '<' is used to create an HTML popup, else the text popup is used, see also bindPopup method
  • tooltip if present, is used to create a tooltip. A value started with '<' is used to create an HTML tooltip, else the text tooltip is used, see also bindTooltip method
  • line_style if present, is used to apply as an options parameter when creating lines and polygons, see also Leaflet Path options
  • point_style if present, is used as an options parameter to create a Leaflet marker, see also Marker options
  • an icon member of the point_style if present, is used as an options parameter to create a Leaflet icon, see also Icon options

The Admin class may override every part of this data, or even the whole data output overriding admin methods producing this data:

  • get_geojson_feature_list(request, queryset) returns the whole GeoJSON FeatureList instance representing a queryset
  • get_geojson_features(request, o, queryset) returns the features member of the FeatureList instance for the model instance o
  • get_geojson_geometry_fields(request, o, queryset) returns a list of geometry field names that need to be included in the feature list
  • get_geojson_feature(request, name, o, queryset) returns a GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_geometry(request, name, o, queryset) returns a geometry member of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_properties(request, name, o, queryset) returns a properties member of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_popup(request, name, o, queryset) returns a popup property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_tooltip(request, name, o, queryset) returns a tooltip property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_verbose_name(request, name, o, queryset) returns a verbose name of the instance o geometry field name which is used to create popup and tooltip
  • get_geojson_feature_line_style(request, name, o, queryset) returns a line_style property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_point_style(request, name, o, queryset) returns a point_style property of the GeoJSON Feature instance representing the instance o geometry field name
  • get_geojson_feature_icon_style(request, name, o, queryset) returns an icon member of the point_style property of the GeoJSON Feature instance representing the instance o geometry field name
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].