Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arches/app/media/js/bindings/maplibre-gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import _ from 'underscore';
import ko from 'knockout';
import arches from 'arches';
import * as maplibre from 'maplibre-gl';
import { registerPmtilesProtocol } from '@/arches_vue_components/components/MapComponent/utils/pmtiles-protocol.ts';

// Point maplibre-gl at its worker script as webpack-emitted static assets.
maplibre.setWorkerUrl(
Expand Down Expand Up @@ -33,6 +34,7 @@ const initialize = function(element, valueAccessor, maplibregl) {
];
}

registerPmtilesProtocol();
var map = new maplibregl.Map(
_.defaults(mapInitOptions, defaults)
);
Expand Down
55 changes: 55 additions & 0 deletions arches/app/models/migrations/local_basemaps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated by Django 6.1.1 on 2026-11-09 18:45

import arches.app.models.query_expressions
import django.db.models.deletion
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("models", "13064_reference_datatype_relational_views"),
]

operations = [
migrations.CreateModel(
name="LocalBasemap",
fields=[
(
"localbasemapid",
models.UUIDField(
db_default=arches.app.models.query_expressions.UUID4(),
default=uuid.uuid4,
primary_key=True,
serialize=False,
),
),
("name", models.SlugField(unique=True)),
(
"flavor",
models.TextField(choices=[("light", "light"), ("dark", "dark")]),
),
("archive_path", models.TextField()),
("overview_archive_path", models.TextField(blank=True, null=True)),
("bounds", models.JSONField()),
("min_zoom", models.IntegerField()),
("max_zoom", models.IntegerField()),
("overview_max_zoom", models.IntegerField(blank=True, null=True)),
("tile_schema_version", models.TextField(blank=True, null=True)),
("build", models.TextField(blank=True, null=True)),
(
"map_layer",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="local_basemap",
to="models.maplayer",
),
),
],
options={
"db_table": "local_basemaps",
"managed": True,
},
),
]
32 changes: 32 additions & 0 deletions arches/app/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,38 @@ class Meta:
)


class LocalBasemap(models.Model):
"""A basemap served from a PMTiles archive under LOCAL_BASEMAPS_ROOT. Its
map layer holds the layers the Knockout maps draw; the Vue maps load the
style that LocalBasemapStyleView builds from this record."""

FLAVORS = ["light", "dark"]

localbasemapid = models.UUIDField(
primary_key=True, default=uuid.uuid4, db_default=UUID4()
)
name = models.SlugField(unique=True)
flavor = models.TextField(choices=[(flavor, flavor) for flavor in FLAVORS])
archive_path = models.TextField()
overview_archive_path = models.TextField(blank=True, null=True)
bounds = JSONField()
min_zoom = models.IntegerField()
max_zoom = models.IntegerField()
overview_max_zoom = models.IntegerField(blank=True, null=True)
tile_schema_version = models.TextField(blank=True, null=True)
build = models.TextField(blank=True, null=True)
map_layer = models.OneToOneField(
MapLayer, on_delete=models.CASCADE, related_name="local_basemap"
)

def __str__(self):
return self.name

class Meta:
managed = True
db_table = "local_basemaps"


class GraphXMapping(SaveSupportsBlindOverwriteMixin, models.Model):
id = models.UUIDField(
primary_key=True, serialize=False, default=uuid.uuid4, db_default=UUID4()
Expand Down
Loading
Loading