Maps
NetPanorama is able to draw geographical networks superimposed on a map.
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
mapmark
Defining maps
Maps are defined at the top-level of the specification.
| Attribute | Type | Description |
|---|---|---|
| name | string | Name for this map. |
| center? | [number, number] | Latitude and longitude of the center of this map. |
| zoomLevel? | number | Zoom level of the map. |
| zoomLevel? | number | Zoom 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
| Attribute | Type | Description |
|---|---|---|
| url | string | Url for the map tiles, in the format accepted by Leaflet.js |
| attribution? | string | Attribution message to be displayed below the map. |
| accessToken? | string | API access token. |
| minZoom? | number | The minimum enabled zoom level. |
| maxZoom? | number | The maximum enabled zoom level. |
| subdomains? | string | Subdomains of the tile service (a work-around for browser limits on parallel requests per domain). |
| subdomains? | string | Subdomains 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"
},