# Map The Map view (View ▸ Map, ⌘⌥3 / Ctrl+Alt+3) shows the photos that have a GPS position on a slippy map. This page describes the view, geotagging, where the map's tiles come from, what is sent over the network, and the commands behind it. ## Map view The map shows the photos of the current list (the same source, filter and sort as the grid) that have a valid GPS position as pins. A position that is out of range or not a number counts as no position. - **Pins and clusters.** Pins closer than about 60 points merge into a cluster with their count. The groups are cells anchored to the world, not the screen, and each zoom's cells nest in the one above, so panning never regroups the pins and zooming in only splits clusters. Positions are projected once per change of the photo list; clustering then costs one hash lookup per photo in view (see Performance). - **Selection.** Selected photos' pins are yellow. A cluster holding selected photos is yellow and carries a small blue bubble with how many of its photos are selected. A click on a pin selects its photo; a click on a cluster selects all its photos, the first one active. The filmstrip shows them selected and scrolls to the active one. ⌘-click (Ctrl-click) adds them to the selection instead. - **Opening.** A double-click on a pin opens its photo in Detail; on a cluster it zooms in two levels. Hovering a pin shows its (first) photo's thumbnail, with the cluster's count. - **Moving around.** Drag the map to pan, scroll to zoom around the pointer, double-click the empty map to zoom in. The bottom toolbar has the Map Style list, Fit to Photos, − / the zoom slider / +, and Lock Markers. The first time the map is shown in a session it fits the photos with a position; after that it stays where you left it. - **Photos without a position.** "N photos without GPS" at the bottom left counts the photos of the list that have none. Drag them onto the map from the filmstrip (below), type a position in the Info panel, or use Photo ▸ Auto-Tag from Tracklog…. The filmstrip runs under the map, as in Detail: View ▸ Filmstrip, `/` (F6), or the Filmstrip button at the right of the bottom bar, which in the Map view takes the place of the grid's thumbnail size. **Performance.** Clustering 50,000 photos in view (spread over Europe, zoom 5, 240 clusters) took 1.7 ms in a release build on the machine this was measured on (the `many_photos_cluster_quickly` test prints it). ## Geotagging As in Lightroom Classic's Map module: - **Drop photos on the map.** Drag photos from the filmstrip onto the map and let go where they were taken. The drag carries the selection, or only the photo dragged when it isn't selected. While they are over the map a pin with their count follows the pointer; the drop gives every one of them that point's position, overwriting a position they had. That is one undo step, "Set GPS Coordinates" (`photo.setGps`). A release over the map's toolbar or location filter bar, or outside the map, changes nothing. - **Move a pin.** Drag a single photo's pin to its new place: one undo step. A cluster isn't moved: dragging it pans the map, as a drag on the empty map does, so zoom in until the photo has its own pin. A pin let go outside the map (over the filmstrip, say) stays where it was. - **Lock Markers** (the bottom toolbar, ⌘K / Ctrl+K in the Map view, `map.lockMarkers {on?}`) stops pins from being moved; dragging one then pans the map. It is saved with the window state (`ui.json`). - **Remove GPS Coordinates.** Photo ▸ Remove GPS Coordinates clears the position of the selected photos; a right-click on a pin offers the same for that pin's photos. One undo step, "Remove GPS Coordinates" (`photo.removeGps`; `photo.clearGps` is its older name). - **The poles.** The map can't show them (Web Mercator stops at ±85.05° latitude), so a drop or a pin move reaches 85.05° north or south at most. The longitude of a drop on the world's repeat at low zoom is wrapped into −180…180. Type a position closer to a pole in the Info panel's GPS field. - **Sidecars.** Positions are written to XMP sidecars as EXIF GPS (`exif:GPSLatitude`, `exif:GPSLongitude`) when sidecars are written (Photo ▸ Save Metadata to File, or at once with automatic XMP writing on). For a photo whose position you set or cleared in LightCraft this session (a drop, a pin move, Remove GPS Coordinates, the Info panel's GPS field), the sidecar takes LightCraft's position as it is: clearing it, or undoing a geotag, removes the GPS from the sidecar. A photo whose position you never touched here keeps whatever GPS another app put in its sidecar, since LightCraft doesn't read GPS from sidecars. `map.state` reports the view (`lat`, `lon`, `zoom`, `maxZoom`, `source`, `offline`, `attribution`), the map canvas, whether the filmstrip is drawn, every pin or cluster drawn in the last frame (`pins`: `ids`, `count`, `selected`, screen `x` / `y`, `lat` / `lon`; at most 500 listed, `clusterCount` counts them all), `clusterMs`, `withGps` / `withoutGps`, `lockMarkers`, `movingPin` (`{id, x, y}` while a pin is dragged), `hovered` (the hovered pin's photos) and `drop` (`{count, x, y, lat, lon}` while photos are carried over the map). Widgets: `map:canvas`, `map:pin:`, `map:fit`, `map:lockMarkers`, `map:withoutGps`, `map:hoverThumb`, `map:pinMenu:removeGps`, `map:attribution`. ## Info panel map Under the location fields, the Info panel shows a small map of the active photo's place (with several photos selected, the active one's): the fields' width, 160 points tall, zoom 14 (or the tile source's deepest zoom), the photo's pin and the tile credit. Near a pole, where the map stops at ±85.05°, the pin stays on the map's edge. A photo without a valid position has no map. The map doesn't pan; a click opens the Map view centred there at zoom 14. **Open in Browser** (formerly Show on Map) still opens the place on openstreetmap.org. It draws from the same tile service and texture cache as the Map view, so tiles it loaded are not fetched again when you open the Map view. It asks only for the tiles it shows (no ring around them), and only while it is on screen: with the Info panel closed or the map scrolled out of view, nothing is fetched for it. Offline it stays grey with the pin and "Map tiles are off". `map.state` reports it as `miniMap`: `{photo, lat, lon, zoom, rect, pin, tiles: {drawn, fromParent, missing, offline}}` (null when it wasn't drawn in the last frame). Widgets: `info:miniMap`, `info:miniMapAttribution`. ## Location filter The bar over the map (show or hide it with `\` in the Map view, or Window ▸ Map ▸ Location Filter Bar) narrows the photos in view, as Lightroom Classic's Location Filter does. Each choice shows its count: - **Visible on Map**: the photos whose position is inside the part of the world the map shows. The count follows the view at once; the filmstrip follows once the view has rested for a quarter of a second, so panning doesn't refilter it every frame. A view set by a command (`map.setView`, `map.fit`, zoom) applies at once. When the map is wider than the world, every longitude counts; a view across ±180° wraps. - **Tagged**: the photos with a valid position. **Untagged**: those without; the map then shows no pins and says the photos can be dragged onto it from the filmstrip. - **None**: no narrowing. It sits on top of the library's own filter (source, Filter Bar, search), which it never changes: the filmstrip, the selection and the keys follow it while the Map view is shown, and leaving the Map view brings back exactly the grid's list. The choice is kept for the session. Pins always come from the photos before the location filter, so a pin's photos are the ones it would narrow to. It is made of two smart-rule fields that `library.filter`, smart albums and the rule editor also take (Location group): - **Has GPS** (`hasGps`, yes / no) counts only a valid position: finite, latitude −90…90, longitude −180…180. - **GPS Area** (`gpsArea`, is inside / is outside) takes `{south, west, north, east}` in degrees. East < west means the box crosses the antimeridian and wraps. Edges count as inside, and a photo without a position is neither inside nor outside. Missing edges, text, out-of-range values or south north of north are refused by `library.filter`, `album.createSmart` and `album.setRules`; the rule editor shows four numbers. `album.ruleFields` reports its kind as `area`. `map.locationFilter {mode?: visible | tagged | untagged | none}` sets it (without `mode`, reports) and returns `{mode, visible, tagged, untagged, all, area, countMs, shown}` (`area`: the box Visible on Map narrows to; `shown`: the photos in the filmstrip now). `map.state` reports the same as `locationFilter`. Widgets: `map:filterBar`, `map:filter:`, `map:untaggedNote`. **Performance.** Narrowing 50,000 photos to an area took 9 ms, and counting 20,000 positions in one 0.1 ms, in a release build (`narrowing_and_counting_many_photos`). ## Saved locations Saved locations are named circles on the map: a centre and a radius (1 m to 1000 km), measured along the Earth's surface, so a circle across ±180° or around a pole holds what it should. - **The list** is in the navigator panel at the left of the map (Window ▸ Map ▸ Map Navigator). Each location shows how many photos in view are inside it. A click goes to it (the map centres and zooms to show it) and makes it the active one. Its checkbox selects its photos in view, or takes them out of the selection. Its right-click menu has Go To, Select Photos, Rename…, Private, and Delete…, which asks first. - **`+`** makes a new location around the selected photos that have a position (a radius that holds them, 10 % to spare, at least 100 m), or at the map's centre with a 1 km radius when none has. Its name is offered for editing at once. - **On the map** every location in view is drawn as a circle with its name; private ones are red. The active one has a centre handle and a radius handle: drag them to move it or change its size (saved when let go over the map). Lock Markers keeps them in place; a drag then pans the map. - **Private locations.** A photo inside one is exported without its location, as if "Remove location info" were on for it: no GPS and no place fields (sublocation, city, state, country) in rendered exports. An Original or DNG export of such a photo is refused when the file itself carries GPS or place names, as with Remove location info. The photo keeps its position in the library. The Info panel shows no map for it (so no tiles of the place are fetched) until you click Show Map. - **Where they are kept.** In `locations.json` in the library folder, written atomically on every change, outside the catalog's journal: they are not undo steps. The file is hostile input: one that doesn't parse is kept aside as `locations.json.corrupt-