Enhance your development with SmoothGlue™, Map component for providing backend related map APIs.
Project description
SmoothGlue Django Map
A Django app that provides admin-configurable REST APIs for map imagery and terrain providers. Site admins can manage which imagery base layers and terrain sources are available to frontend map clients — including support for Cesium Ion assets — without any code changes.
Designed for deployments across diverse networks, including air-gapped environments where public imagery and terrain services are unavailable. When no providers are configured, frontends fall back to Cesium's bundled NaturalEarth imagery and WGS84 Ellipsoid terrain.
Features
- Imagery Layers — Configure map base-layer providers (ArcGIS, Bing, OpenStreetMap, Cesium Ion, and more) via the Django admin.
- Terrain Layers — Configure terrain providers (Ellipsoid, Cesium Ion, Cesium Terrain, ArcGIS, Google, VR-TheWorld) via the Django admin.
- Cesium Ion Support — Both imagery and terrain layers support Ion asset IDs for loading layers through the Cesium Ion API.
- Default Layer — Mark one imagery layer and one terrain layer as the default. The app enforces a single default per layer type automatically.
- Filterable REST API — Read-only list endpoints with filtering by
is_active,is_default, andprovider_type. - Air-Gap Safe — Ellipsoid terrain (WGS84) requires no network access and is the default terrain provider type.
API Endpoints
| Endpoint | Description |
|---|---|
GET /image-layers/ |
List active imagery layers |
GET /terrain-layers/ |
List active terrain layers |
Both endpoints support query parameters for filtering:
GET /image-layers/?is_default=true
GET /terrain-layers/?provider_type=Cesium+Ion
Response Example
{
"id": "e6227ca5-9e8a-4793-9e63-d8ffa6e858b7",
"name": "World Imagery",
"url": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
"provider_type": "ArcGis Map Server",
"ion_asset_id": null,
"sort_order": 1,
"is_active": true,
"is_default": true
}
Installation
Install the Package
pip install smoothglue-django-map
Configure Django
Add the app to INSTALLED_APPS in your settings.py:
INSTALLED_APPS = [
"smoothglue.map",
...,
]
Include the URL routes in your urls.py:
urlpatterns = [
path("", include("smoothglue.map.urls")),
...,
]
Run migrations:
python manage.py migrate
Optionally load the bundled fixtures to seed default imagery and terrain layers:
python manage.py loaddata imagerylayer
python manage.py loaddata terrainlayer
Development
Set Up Virtual Environment
This project uses Poetry for dependency management.
- Install Poetry if you haven't already.
- Run
poetry installto create a virtual environment and install dependencies.
Management Commands
- makemigrations.py — Generate migrations for the
mapapp. - migrate.py — Apply pending migrations.
- loadtests.py — Run all tests (
python3.12 loadtests.py). - loaddata.py — Load fixture data (
python3.12 loaddata.py smoothglue/map/fixtures/imagerylayer.json). - djangoshell.py — Open a Django shell aware of the app.
- boot_django.py — Bootstraps a standalone Django environment via
settings.configure(). Used by the other scripts.
Building
poetry build
This creates source and wheel distributions in the dist/ directory.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smoothglue_django_map-1.0.0.tar.gz.
File metadata
- Download URL: smoothglue_django_map-1.0.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/4.18.0-553.97.1.el8_10.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b8515fdb8b01ca541bec688c63bf281ac00ed3d7ceeb8ba82e67dbc035ce7d5
|
|
| MD5 |
7b1d0ab0f9e9ade3e59106db89d844bd
|
|
| BLAKE2b-256 |
118148b2644466afbc44d90b9bb54b3d98749cc433dd6546e36f5a38557ca25f
|
File details
Details for the file smoothglue_django_map-1.0.0-py3-none-any.whl.
File metadata
- Download URL: smoothglue_django_map-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/4.18.0-553.97.1.el8_10.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef59a89c180df00800eb234cc3251bab85d27277603fedf9a4a3cd05277a72f8
|
|
| MD5 |
2acca5189fb76e7799ebb3362e6a8d00
|
|
| BLAKE2b-256 |
8c43eaa5027b78c81c644d58ef8de495afe9edb5bd6e7cb813d728da7c9ea6ef
|