Skip to main content

Maps

NetPanorama is able to draw geographical networks superimposed on a map.

caution

Network Panorama can currently render map tiles, but not GeoJSON features.

This requires several parts:

  • applying a geocoding transform to assign positions to latitudes and longitudes (if the raw dataset includes only placenames)
  • defining a map
  • deriving a layout from this map
  • adding a map mark

Defining maps

Maps are defined at the top-level of the specification.

AttributeTypeDescription
namestringName for this map.
center?[number, number]Latitude and longitude of the center of this map.
zoomLevel?numberZoom level of the map.
zoomLevel?numberZoom level of the map.

To specify which map tiles to use, the tiles attribute can be set to a string (currently to one of "Mapnik", "Stadia.AlidadeSmooth", "Stamen_Terrain", "Stamen_TerrainBackground", "Stamen.TonerBackground").

Alternatively, additional fields can be provided:

Url for the map tiles, in the format accepted by Leaflet.js

AttributeTypeDescription
urlstringUrl for the map tiles, in the format accepted by Leaflet.js
attribution?stringAttribution message to be displayed below the map.
accessToken?stringAPI access token.
minZoom?numberThe minimum enabled zoom level.
maxZoom?numberThe maximum enabled zoom level.
subdomains?stringSubdomains of the tile service (a work-around for browser limits on parallel requests per domain).
subdomains?stringSubdomains of the tile service (a work-around for browser limits on parallel requests per domain).

To preview available map tiles, we suggest using Leaflet-providers preview.

A layout based on a map

A layout based on a map needs to include the name of the map, and define how to extract the latitude and longitude for the items that are being laid out.

For example,

{
"name": "map-layout",
"network": "network",
"map": "my_map",
"lat": { "field": "latitude" },
"lng": { "field": "longitude"}
}

A map mark

A map mark has type map:

        "mark": {
"type": "map",
"map": "my_map"
},