osm.el - OpenStreetMap viewer for Emacs

Next:   [Contents]

osm.el - OpenStreetMap viewer for Emacs

Osm.el is a tile-based map viewer, with a responsive movable and zoomable display. The map can be controlled with the keyboard or with the mouse. The viewer fetches the map tiles in parallel from tile servers via the ‘curl’ program. The package comes with a list of multiple preconfigured tile servers. You can bookmark your favorite locations using regular Emacs bookmarks or create links from Org files to locations. Furthermore the package provides commands to search for locations by name and to open and display GPX tracks.

Table of Contents

1 Features

2 Configuration

The package is available on GNU ELPA and can be installed with ‘package-install’. Note that Osm.el requires Emacs 27 and depends on the external ‘curl’ program. Emacs must be built with ‘libxml’, ‘libjansson’, ‘librsvg’, ‘libjpeg’ and ‘libpng’ support. The following is an example configuration which relies on ‘use-package’. Please take a look at the wiki for additional configuration.

(use-package osm
  :bind ("C-c m" . osm-prefix-map) ;; Alternatives: `osm-home' or `osm'

  ;; Take a look at the customization group `osm' for more options.
  (osm-server 'default) ;; Configure the tile server
  (osm-copyright t)     ;; Display the copyright information


  ;; Add custom servers, see also https://github.com/minad/osm/wiki
  ;; (osm-add-server 'myserver
  ;;   :name "My tile server"
  ;;   :group "Custom"
  ;;   :description "Tiles based on aerial images"
  ;;   :url "https://myserver/tiles/%z/%x/%y.png?apikey=%k")

4 Distance measurement

Osm provides a simple distance measurement utility. In order to measure a distance, place or select a pin by clicking with the left mouse button. Then create one or more additional way points by pressing shift and clicking the left mouse button. The length of the track will be shown in the echo area. You can select the way points of the track and delete them with d or DEL.

5 Commands and Key Bindings

Top-level commands in ‘osm-prefix-map’. These bindings are available globally if you bind ‘osm-prefix-map’ to a key like ‘C-c m’. For example, to search for a location press the key sequence ‘C-c m s’. Furthermore the key bindings are available in Osm buffers. There it is sufficient to press the key ‘s’ only to initiate a search.

Some additional key bindings are available in Osm buffers:

7 Contributions

Since this package is part of GNU ELPA contributions require a copyright assignment to the FSF.