The link around a shared view
Last checked ·
A shared view needs a place in a URL, a name and a way to separate its numbers. This page compares how public map links do that, what frameworks call the thing being shared and how the geo: standard relates to it.
What the comparison shows
We sampled 39 view links from 30 products for the viewer gallery. This includes attempts such as ViaTopo, where the requested view did not reopen. Of those links, 18 put the view in the query alone, 18 in the fragment alone, two in the path and one in both the query and fragment.
Two things do repeat. The most common shape is one key that holds a list of numbers, which is the shape of a shared view. And the word that frameworks use for the thing being shared is most often view.
view as a keyAnatomy
Where the view sits
| Place | Links | Examples | What it means |
|---|---|---|---|
Query only, after ? | 18 | Google Maps, Apple Maps, Mapy.com, ArcGIS, Locus Map, PeakFinder | The server receives it. It can build a preview or redirect. It can also appear in server logs. |
Fragment only, after # | 18 | OpenStreetMap, map.geo.admin.ch, Outdooractive, thermal.kk7, OpenSkiMap, Strava | The browser reads it without sending it in the request. |
| Path | 2 | Komoot, Google Earth | The view is part of the address. The host has to route it. |
| Query and fragment | 1 | Japan GSI Maps, 3D | The query names the terrain patch and the fragment holds the camera. |
The URL standard says a fragment is “dereferenced solely by the user agent”. A local test confirmed it for a shared view: the server received ?view= and did not receive #view=. Raw and escaped colons and commas gave the same value in both places. The standard allows a colon and a comma unescaped in a query. RFC 3986 · Carrier check · Link count
The browser can update either part of the URL without reloading the page. The host decides which views belong in Back and Forward history. Browser history
How the view is written
| Shape | Links | Example | Trade-off |
|---|---|---|---|
| One key that holds a list | 21 | camera=8.5789,47.0822,1578.2,-14.4,160.4,0 at swisstopo, #map=13.47/47.0808/8.5794 at OpenStreetMap | One value to copy. The order of the numbers has to be known. |
| A bare list with no key | 10 | #12.47/47.08083/8.5794/160.4/52 at OpenSkiMap, @47.080826,8.579398,12.468z at Komoot | Shortest. It takes over the whole fragment or a path segment. |
| One key for each number | 8 | lat=47.0808&lng=8.5794&z=13 at Locus Map | Every number is named. There is no single value to copy. |
Inside a list, 22 links separate with commas and 9 with slashes. One link puts a type in front of its list: ArcGIS Scene Viewer writes viewpoint=cam:8.5789,47.0822,1578.2;160.4,75.6, with longitude first and a semicolon before the angles.
What frameworks call it
| Word | Where | What it says | Link |
|---|---|---|---|
| view | OpenLayers | “A View object represents a simple 2D view of the map.” Its states are center, resolution and rotation. | View |
| view | Leaflet | setView “sets the view of the map (geographical center and zoom)”. | setView |
| view | CesiumJS | camera.setView “sets the camera position, orientation and transform”. | Camera |
| view state | deck.gl | A controller “translates user input into changes in the view state”. Its classes are named MapView and FirstPersonView. | Views |
| view | OGC KML | An abstract view element that is either a Camera or a LookAt. | KML reference |
| viewpoint | ArcGIS | “Describes a point of view for a 2D or 3D view. In a 2D view, the viewpoint is determined using a center point and scale value. In a 3D view, it is determined using a Camera position. The Viewpoint can be bookmarked for later use.” | Viewpoint |
| camera | Google Maps, Mapbox, MapLibre, TerriaJS | Google's camera options hold center, heading, tilt and zoom, also for a flat map. TerriaJS stores an initialCamera. | Map · TerriaJS |
| position | MapLibre GL JS | The hash option syncs “the map's position (zoom, center latitude, center longitude, bearing, and pitch)” with the URL. A name turns it into #foo=…. | Map options |
View is the most widely shared word, in five of these sources. Two of them already split a view into the same two kinds as a shared view link. KML's abstract view is a camera or a look-at. The ArcGIS viewpoint is a center with a scale in 2D or a camera in 3D.
Camera is the second word. It leans toward 3D, and the shared format already uses it for one of the two types.
Keys in links
| Key | Links | What it holds |
|---|---|---|
z, zoom | 10 | The zoom as a separate value. |
map | 6 | Two meanings. The view at OpenStreetMap, OpenSnowMap and HERE WeGo. The map style at Apple Maps and Locus Map. |
center | 5 | The center pair at Google Maps, Apple Maps, Mapy.com and map.geo.admin.ch. |
zc, caml | 4 and 2 | Zoom with center, and the 3D camera, at Outdooractive and Alpenvereinaktiv. |
v | 2 | The view at BEYOND and the visible bounds at NASA Worldview. |
camera, viewpoint | 1 each | The 3D camera at map.geo.admin.ch and at ArcGIS Scene Viewer. |
ll, loc, c, extent, bbox | 1 each | A position or bounds at CalTopo, Gaia GPS, ViaTopo, ArcGIS Map Viewer and Camptocamp. |
view | 0 | No surveyed link uses it. |
The sample covers map viewers. It does not show how often ordinary web apps use view for something else, such as a list or grid switch. A host with that key has to rename one of them.
Letters after numbers
| Link | Example | Letters |
|---|---|---|
| Google Maps path form (additional Rigi example) | @47.047,8.474,14z | z for zoom. The sample uses the separate Wildspitz query link. |
| Komoot | @47.080826,8.579398,12.468z | z for zoom, counted one lower |
| Google Earth address | 47.0604345,8.5902719,917.4a,2654.9d,35y,160.389904h,75.780757t,0r | a altitude, d distance, y lens, h heading, t tilt, r roll |
| Shared view | 47.082215,8.578901,1578.2,160.4h,75.6t,68.4f | z zoom, h heading, t tilt, r roll, f lens |
The shared format uses the same letters as Google for zoom, heading, tilt and roll. It differs for the lens, where Google's y is a vertical angle and f is diagonal. External link survey
The geo: URI
geo: is a link scheme for a location, standardised in June 2010. It writes geo:latitude,longitude with an optional altitude, as in geo:48.2010,16.3695,183. The reference is WGS 84 and the altitude is relative to the WGS 84 geoid, which is sea level. RFC 5870
| Aspect | geo: URI | Shared view |
|---|---|---|
| Position | Latitude, longitude and optional altitude above sea level | An untagged camera uses the same order. An explicit CRS tag can give the horizontal pair in another system. |
| Zoom | None in the standard. Android accepts geo:47.6,-122.3?z=11 as its own addition. | z for a flat map |
| Direction and lens | None. Named parameters are allowed after a semicolon, and only crs and u have been registered. | h, t, r, f |
| What opens it | On Android a map app at that point | A web viewer at the same view |
A geo: link cannot carry a view. It can serve as a fallback for the position when the receiver has no viewer that reads a shared view. Registered parameters · Android map intents
What this means for shared view links
A shared view is one key that holds a typed list: view=map:… or view=cam:…. That is the most common shape among the surveyed links, and view is the word most frameworks use for what it holds. URL carrier · Carrier decision
The value goes in the query by default so a server can build a preview. A host that keeps its state in the fragment can put it there. The value is the same in both places.
When a view has a coordinate reference system tag, it goes inside this value, immediately before the horizontal coordinates. For example, map:epsg:2056:2678675.39,1211181.8 can be copied on its own. Spatial reference examples
Two names need care. ArcGIS Scene Viewer also writes cam:, under the key viewpoint, with longitude first. And a host may already use view for something else.
