maphttp

package
v1.143.1 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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