osm
- Description
- OpenStreetMap viewer
- Latest
- osm-1.4.0.20241105.213251.tar (.sig), 2024-Nov-06, 110 KiB
- Maintainer
- Daniel Mendler <mail@daniel-mendler.de>
- Website
- https://github.com/minad/osm
- Browse ELPA's repository
- CGit or Gitweb
- Badge
- Manual
- osm
To install this package from Emacs, use package-install
or list-packages
.
Full description
The map data is © OpenStreetMap contributors, licensed under the ODbL The map rendering is © OpenTopoMap, licensed under the CC-BY-SA.
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
- Responsive, zoomable and movable map display
- Display of tracks and POIs from GPX file
- Parallel fetching of tiles with curl
- Moving in large and small steps
- Mouse support (dragging, clicking, menu)
- Map scale indicator
- Distance measurement
- Go to coordinate
- Search for location by name
- Org link, Geo url and Elisp link support
- Bookmarked positions with pins
- Multiple preconfigured tile servers
2. Configuration
The package is available on GNU ELPA and can be installed with package-install
.
Note that Osm.el requires Emacs 28 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 tile server configurations, e.g.,
Google Maps.
(use-package osm :bind ("C-c m" . osm-prefix-map) ;; Alternatives: `osm-home' or `osm' :custom ;; 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 :config ;; 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") )
3. Bookmarks, Org links, Geo urls and Elisp links
There exist multiple methods to store a location, such that you can return there afterwards.
b
: Create a bookmark of the current location. The bookmark is stored as an Emacs bookmark inbookmark-alist
. You can jump to the bookmark via the completion commandsosm-bookmark-jump
orbookmark-jump
.l
: Store an Org link to the current location. The link can be inserted subsequently into an Org buffer withC-c C-l
.u
: Save the geo url of the current location in the kill ring. The url can be inserted in another buffer viaC-y
. A geo url has the formgeo:27.96,86.89;z=13
.C-u u
: Save an Elisp link to the current location in the kill ring. An Elisp link has the form(osm 51.49 -0.14 11)
.
Bookmarks and Org links can be created at point by clicking with the mouse. See
the docstrings of the commands osm-bookmark-set
and org-link-store
.
- Org link examples
Click on a link or press
RET
to jump to the location. These links work in Org buffers in Emacs. Furthermore you can open Org links in arbitrary buffers withorg-open-at-point-global
. I recommend binding the command to a convenient key, e.g.,C-c o
. The format of the links complies with the geo URI scheme defined by RFC 5870.[[geo:41.869560826994544,12.45849609375;z=6;s=opentopomap][Italia, 41.87° 12.46° OpenTopoMap]] [[geo:51.48950698022105,-0.144195556640625;z=11][London, England, 51.49° -0.14°]] [[geo:55.686875255964424,12.569732666015625;z=12;s=cyclosm][København, Danmark, 55.69° 12.57° CyclOSM]] [[geo:27.961656050984658,86.89224243164062;z=13;s=opentopomap][Mount Everest, 27.96° 86.89° OpenTopoMap]] <geo:Tour Eiffel, Av. Gustave Eiffel, Paris> (Address link)
- Elisp link examples
Place the point behind the closing parenthesis and press
C-x C-e
to jump to the location. The Elisp links can be used in arbitrary text files. Since they are Elisp s-expressions they can be easily manipulated programatically.(osm 41.869561 12.458496 6 'opentopomap "Lazio, Italia") (osm 51.489507 -0.144196 11 "London, Greater London, England, SW1A 2DX, United Kingdom") (osm 55.686875 12.569733 12 'cyclosm "København, Københavns Kommune, Region Hovedstaden, 1357, Danmark") (osm 27.961656 86.892242 13 'opentopomap "Khumjung, Khumbupasanglahmu, सोलुखुम्बु, Province #1, Nepal") (osm "Tour Eiffel, Av. Gustave Eiffel, Paris") ;; Address link
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.
h
:osm-home
- Open new map at home coordinatess
:osm-search
- Search and jump to locationt
:osm-goto
- Go to coordinatesv
:osm-server
- Select serverj
:osm-jump
- Jump to pin (bookmark or POI)x
:osm-gpx-show
- Show GPX file in map viewer
Some additional key bindings are available in Osm buffers:
<arrow>
: Small step scrollingC-<arrow>
,M-<arrow>
,S-<arrow>
: Large step scrolling+
,SPC
:osm-zoom-in
- Zoom in-
,S-SPC
:osm-zoom-out
- Zoom out<mouse-1>
:osm-mouse-pin
- Place pin at point<mouse-2>
:org-link-store
- Store point as Org link<mouse-3>
:osm-bookmark-set
- Store point as bookmarkS-<mouse-1>
:osm-mouse-track
- Create track pin to measure distance<down-mouse-*>
:osm-mouse-drag
- Drag the map with the moused
,DEL
:osm-delete
- Delete selected pin (bookmark or way point)n
:osm-rename
- Rename selected pinc
:osm-center
- Center to currently selected pinX
:osm-gpx-hide
- Hide overlays from GPX filel
:org-store-link
- Store Org linku
:osm-save-url
- Save geo url in the kill ringb
:osm-bookmark-set
- Set bookmarkq
:quit-window
- Close buffer and windowo
:clone-buffer
- Clone buffer
6. Related projects
There have been other attempts at map viewers in Emacs before.
7. Contributions
Since this package is part of GNU ELPA contributions require a copyright assignment to the FSF.
Old versions
osm-1.4.0.20241105.201930.tar.lz | 2024-Nov-05 | 23.6 KiB |
osm-1.4.0.20241006.1334.tar.lz | 2024-Oct-06 | 23.5 KiB |
osm-1.4.0.20241005.140106.tar.lz | 2024-Oct-05 | 23.5 KiB |
osm-1.4.0.20240929.64257.tar.lz | 2024-Sep-29 | 23.4 KiB |
osm-1.4.0.20240723.220720.tar.lz | 2024-Jul-24 | 23.6 KiB |
osm-1.3.0.20240718.101336.tar.lz | 2024-Jul-18 | 23.6 KiB |
osm-1.2.0.20240102.33209.tar.lz | 2024-Jan-02 | 23.5 KiB |
osm-0.14.0.20231125.73526.tar.lz | 2023-Nov-25 | 21.8 KiB |
osm-0.9.0.20230206.130916.tar.lz | 2023-Feb-06 | 20.3 KiB |
osm-0.2.0.20220308.95022.tar.lz | 2022-Mar-08 | 11.6 KiB |
News
1. Development
- Require Emacs 28.1.
osm-server-list
: Add:ext
server property.
2. Version 1.4 (2024-07-24)
- Bump Compat dependency to Compat 30.
3. Version 1.3 (2024-01-22)
- Add
osm-jump
command to jump to pins (bookmarks, way points, POIs) by name.
4. Version 1.2 (2023-12-27)
- Store names for track way points.
- Add
osm-rename
command to rename both bookmarks and track way points. - Remove
osm-max-cache
customization variable.
5. Version 1.1 (2023-12-23)
osm--purge-tile-cache
: Delete empty tile cache directories.osm-search
: Add message when contacting the server.osm-delete
: New command to delete track or bookmark pins.osm-mouse-select
: New command to select pin.osm-bookmark-delete
: Add confirmation.osm-org-link-click
: Remove, useorg-store-link
instead.- Rename
osm-transient-click
toosm-mouse-pin
. - Unify
osm-bookmark-set
andosm-bookmark-set-click
. - Add distance measurement for manual track. Press
S-<mouse-1>
(osm-mouse-track
) to place the pins of the track. - Add
osm-max-cache
to keep image cache size in check.
6. Version 1.0 (2023-12-01)
osm-search-server
: New customization option.- Automatically register Org geo links.
osm-ol.el
has been removed and should not be required anymore from theinit.el
.
7. Version 0.14 (2023-10-14)
- Compatibility with
pixel-scroll-precision-mode
. - Update list of servers.
- Add
osm-add-server
utility function with error checking. osm-search
: Improve UI if default completions buffer is used.
8. Version 0.13 (2023-07-02)
- Provide
osm-prefix-map
. osm-server-list
: Add support for an api-key placeholder%k
in the server:url
.
9. Version 0.12 (2023-05-01)
- Autoload bugfix for Emacs 27
- Use
easy-menu-define
to make sure that the menu bar and the mode line both get the OSM mouse menu.
10. Version 0.11 (2023-04-17)
- Ensure that mouse pointer is an arrow over the map.
- Use
natnum
defcustom type. - Ignore mouse drags to avoid region marking.
11. Version 0.10 (2023-02-15)
- Start of changelog.