maphttp

package
v1.143.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package maphttp serves the basemap archives the maps settings keep (#2068) and the list of them, with no session.

The archives hold public OpenStreetMap data, and they are read by a map running in a sandboxed asset frame, whose origin is opaque, and from public share links, neither of which carries a session. corshttp answers these paths for any origin. PMTiles is read only by byte range, so the archive route is the tile server: each map view reads the header, a directory or two, and the tiles it draws.

Index

Constants

View Source
const PathPrefix = "/portal/maps/"

PathPrefix is where the routes live. It is under /portal/ so the tile worker answers it in-process, and is registered ahead of the portal UI's catch-all.

Variables

This section is empty.

Functions

func Mount

func Mount(mux *http.ServeMux, svc Service)

Mount registers the routes. A nil service mounts nothing, and the portal UI's catch-all answers the paths as it does any other.

Types

type Service

type Service interface {
	State(ctx context.Context) (maps.State, error)
	ServedArchive(ctx context.Context, id string) (maps.Archive, maps.Objects, error)
}

Service is what the routes read. *maps.Service satisfies it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL