mapembed

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Command mapembed replaces interactive map embeds with a static image and a link, so a page that shows a map does not load a map SDK to do it.

A map embed is an <iframe> pointing at Google Maps or OpenStreetMap. Each carries the location in its own way, and the work of this program is getting the location back out:

google.com/maps/embed/v1/place?q=Big+Ben&key=K   the q parameter
google.com/maps/embed?pb=!1m18!...!2d-0.12!3d51.5 the pb pseudo-path
maps.google.com/maps?q=51.5,-0.12&z=14            q as coordinates
openstreetmap.org/export/embed.html?bbox=a,b,c,d  the centre of the box
openstreetmap.org/#map=14/51.50/-0.12             the fragment

The static image is not invented. There is no keyless static-map endpoint, so the URL comes from a template given on the command line:

mapembed -static 'https://tiles.example/s?c={lat},{lon}&z={zoom}&size={w}x{h}' page.html

With no template the embed still becomes a link, which is the part that works everywhere. An embed whose location cannot be read is left alone and counted, because a map that does not point anywhere is worse than an iframe.

Jump to

Keyboard shortcuts

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