-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new leaflet map background configuration #4881
Changes from all commits
6891fa1
cfe9972
824b2d2
ecaa45f
d7eb7bd
7815e2f
9f90a8f
b58cddf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
# | ||
# Dump the current (local database) config MapTileLayer to a JSON fixture. | ||
# This overwrites the existing one. | ||
# | ||
# You can load this fixture with: | ||
# $ src/manage.py loaddata default_map_tile_layers | ||
# | ||
# Run this script from the root of the repository | ||
|
||
src/manage.py dumpdata --indent=4 --natural-foreign --natural-primary config.MapTileLayer > src/openforms/fixtures/default_map_tile_layers.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Generated by Django 4.2.17 on 2024-12-17 12:42 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("config", "0068_update_summary_tags"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="MapTileLayer", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"identifier", | ||
models.SlugField( | ||
help_text="A unique identifier for the tile layer.", | ||
unique=True, | ||
verbose_name="identifier", | ||
), | ||
), | ||
( | ||
"url", | ||
models.URLField( | ||
help_text="URL to the tile layer image, used to define the map component background. To ensure correct functionality of the map, EPSG 28992 projection should be used. Example value: https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:28992/{z}/{x}/{y}.png", | ||
max_length=255, | ||
verbose_name="tile layer url", | ||
), | ||
), | ||
( | ||
"label", | ||
models.CharField( | ||
help_text="An easily recognizable name for the tile layer, used to identify it.", | ||
max_length=100, | ||
verbose_name="label", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "map tile layer", | ||
"verbose_name_plural": "map tile layers", | ||
"ordering": ("label",), | ||
}, | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from .color import RichTextColor | ||
from .config import GlobalConfiguration | ||
from .csp import CSPSetting | ||
from .map import MapTileLayer | ||
from .theme import Theme | ||
|
||
__all__ = [ | ||
"CSPSetting", | ||
"GlobalConfiguration", | ||
"RichTextColor", | ||
"MapTileLayer", | ||
"Theme", | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from django.db import models | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class MapTileLayer(models.Model): | ||
identifier = models.SlugField( | ||
_("identifier"), | ||
unique=True, | ||
max_length=50, | ||
help_text=_("A unique identifier for the tile layer."), | ||
) | ||
url = models.URLField( | ||
_("tile layer url"), | ||
max_length=255, | ||
help_text=_( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need a disclaimer that the tiler layers must use EPSG:28992 (Rijksdriehoek coordinate system), using other systems will probably lead to weird results. |
||
"URL to the tile layer image, used to define the map component " | ||
"background. To ensure correct functionality of the map, " | ||
"EPSG 28992 projection should be used. " | ||
"Example value: https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:28992/{z}/{x}/{y}.png" | ||
), | ||
) | ||
label = models.CharField( | ||
_("label"), | ||
max_length=100, | ||
help_text=_( | ||
"An easily recognizable name for the tile layer, used to identify it." | ||
), | ||
) | ||
|
||
class Meta: | ||
verbose_name = _("map tile layer") | ||
verbose_name_plural = _("map tile layers") | ||
ordering = ("label",) | ||
|
||
def __str__(self): | ||
return self.label |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,10 @@ | |
"config", | ||
"globalconfiguration" | ||
], | ||
[ | ||
"config", | ||
"maptilelayer" | ||
], | ||
[ | ||
"config", | ||
"theme" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"model": "config.maptilelayer", | ||
"pk": 1, | ||
"fields": { | ||
"identifier": "brt", | ||
"url": "https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:28992/{z}/{x}/{y}.png", | ||
"label": "BRT" | ||
} | ||
}, | ||
{ | ||
"model": "config.maptilelayer", | ||
"pk": 2, | ||
"fields": { | ||
"identifier": "luchtfoto", | ||
"url": "https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png", | ||
"label": "Luchtfoto" | ||
} | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here (max length).