Skip to content

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.

18 · 18 · 2 · 1 query only, fragment only, path, and query plus fragment
21 of 39 links write one key that holds a list
0 of 39 links use view as a key

Anatomy

A shared view link split into host, carrier, view key, camera type, position and suffix fields. The diagram shows 18 query-only links, 18 fragment-only links, two path links, and one link that uses both query and fragment. Comparison examples include Google Maps, OpenStreetMap, swisstopo 3D, ArcGIS Scene Viewer and Locus Map.
The numbers in the comparison rows are shortened. Excalidraw source

Where the view sits

Part of the URL that carries the view, in 39 links
PlaceLinksExamplesWhat it means
Query only, after ?18Google Maps, Apple Maps, Mapy.com, ArcGIS, Locus Map, PeakFinderThe server receives it. It can build a preview or redirect. It can also appear in server logs.
Fragment only, after #18OpenStreetMap, map.geo.admin.ch, Outdooractive, thermal.kk7, OpenSkiMap, StravaThe browser reads it without sending it in the request.
Path2Komoot, Google EarthThe view is part of the address. The host has to route it.
Query and fragment1Japan GSI Maps, 3DThe 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 of the view in 39 links
ShapeLinksExampleTrade-off
One key that holds a list21camera=8.5789,47.0822,1578.2,-14.4,160.4,0 at swisstopo, #map=13.47/47.0808/8.5794 at OpenStreetMapOne value to copy. The order of the numbers has to be known.
A bare list with no key10#12.47/47.08083/8.5794/160.4/52 at OpenSkiMap, @47.080826,8.579398,12.468z at KomootShortest. It takes over the whole fragment or a path segment.
One key for each number8lat=47.0808&lng=8.5794&z=13 at Locus MapEvery 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

The word for the state a link would share
WordWhereWhat it saysLink
viewOpenLayers“A View object represents a simple 2D view of the map.” Its states are center, resolution and rotation.View
viewLeafletsetView “sets the view of the map (geographical center and zoom)”.setView
viewCesiumJScamera.setView “sets the camera position, orientation and transform”.Camera
view statedeck.glA controller “translates user input into changes in the view state”. Its classes are named MapView and FirstPersonView.Views
viewOGC KMLAn abstract view element that is either a Camera or a LookAt.KML reference
viewpointArcGIS“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
cameraGoogle Maps, Mapbox, MapLibre, TerriaJSGoogle's camera options hold center, heading, tilt and zoom, also for a flat map. TerriaJS stores an initialCamera.Map · TerriaJS
positionMapLibre GL JSThe 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 names in the 39 links
KeyLinksWhat it holds
z, zoom10The zoom as a separate value.
map6Two meanings. The view at OpenStreetMap, OpenSnowMap and HERE WeGo. The map style at Apple Maps and Locus Map.
center5The center pair at Google Maps, Apple Maps, Mapy.com and map.geo.admin.ch.
zc, caml4 and 2Zoom with center, and the 3D camera, at Outdooractive and Alpenvereinaktiv.
v2The view at BEYOND and the visible bounds at NASA Worldview.
camera, viewpoint1 eachThe 3D camera at map.geo.admin.ch and at ArcGIS Scene Viewer.
ll, loc, c, extent, bbox1 eachA position or bounds at CalTopo, Gaia GPS, ViaTopo, ArcGIS Map Viewer and Camptocamp.
view0No 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

Links that mark a number with a trailing letter
LinkExampleLetters
Google Maps path form (additional Rigi example)@47.047,8.474,14zz for zoom. The sample uses the separate Wildspitz query link.
Komoot@47.080826,8.579398,12.468zz for zoom, counted one lower
Google Earth address47.0604345,8.5902719,917.4a,2654.9d,35y,160.389904h,75.780757t,0ra altitude, d distance, y lens, h heading, t tilt, r roll
Shared view47.082215,8.578901,1578.2,160.4h,75.6t,68.4fz 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

What geo: has and lacks for a shared view
Aspectgeo: URIShared view
PositionLatitude, longitude and optional altitude above sea levelAn untagged camera uses the same order. An explicit CRS tag can give the horizontal pair in another system.
ZoomNone in the standard. Android accepts geo:47.6,-122.3?z=11 as its own addition.z for a flat map
Direction and lensNone. Named parameters are allowed after a semicolon, and only crs and u have been registered.h, t, r, f
What opens itOn Android a map app at that pointA 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.