Difference between revisions of "ARK2/Maps"

From ARK
Jump to: navigation, search
(Created page with " ARK2 supports the display of maps and mapping layers using OpenLayers4. Maps and layers can be dynamically defined in the config database and then linked to a defined page vi...")
 
(Configuration)
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= Maps =
  
ARK2 supports the display of maps and mapping layers using OpenLayers4. Maps and layers can be dynamically defined in the config database and then linked to a defined page view.
+
ARK2 supports the display of maps and mapping layers using OpenLayers4. Maps and layers can be dynamically defined in the config database and then linked to a defined page view. Much of the config closely reflects the [http://openlayers.org/en/latest/apidoc/ OpenLayers4 API] as this is the map library used by the ARK2 frontend.
  
 
== Configuration ==
 
== Configuration ==
  
The following database tables can be configured to define a map view.
+
The following database tables can be configured to define an OL4 map.
 +
 
 +
 
 +
Define available [http://openlayers.org/en/latest/apidoc/ol.source.html OL4 Sources] in ark_map_source.
  
 
{| class="wikitable" style="margin: 0; border: 1px solid grey; text-align:left" cellpadding="4" cellspacing="2"
 
{| class="wikitable" style="margin: 0; border: 1px solid grey; text-align:left" cellpadding="4" cellspacing="2"
! Field || Type || Size || Description || Example
+
! colspan="6" | ark_map_source
 +
|-
 +
! Field || Type || Size || Required || Description || Example
 +
|-
 +
| source  || varchar  || 30 || PK  || The key for the source || bing
 +
|-
 +
| type  || varchar  ||  30  || Y || The type of the source (raster, vector) || raster
 +
|-
 +
| subtype  || varchar  ||  30  || Y || The subtype of the source (image, tile, vector) || tile
 +
|-
 +
| format  || varchar  ||  30  || Y || The format of the source (wms, gml, etc) || bing
 +
|-
 +
| view_class  || varchar  ||  100  || Y || The [http://openlayers.org/en/latest/apidoc/ol.source.html OL4 Class] of the source || BingMaps
 +
|-
 +
| keyword  || varchar  ||  100  || Y || The ARK translation keyword || map.source.bing
 +
|-
 +
| ticket  || varchar  ||  100  || N || The API auth ticket for the source ||
 +
|-
 +
| ticket_expiry  || datetime  ||  || N || The expiry date for the API auth ticket ||
 +
|-
 +
| options  || varchar  ||  4000  ||  N || The OL4 Options to pass to the Source class in JSON format ||
 +
|-
 +
|}
 +
 
 +
 
 +
Define available [http://openlayers.org/en/latest/apidoc/ol.layer.html OL4 Layers] for each Source in ark_map_layer.
 +
 
 +
{| class="wikitable" style="margin: 0; border: 1px solid grey; text-align:left" cellpadding="4" cellspacing="2"
 +
! colspan="6" | ark_map_layer
 +
|-
 +
! Field || Type || Size || Required || Description || Example
 +
|-
 +
| source  || varchar  ||  30  || PK || The source key from ark_map_source || bing
 +
|-
 +
| layer  || varchar  ||  30  || PK || The layer key || aerial
 +
|-
 +
| source_name  || varchar  ||  50  || Y || The key of the layer as defined by the source provider || Aerial
 +
|-
 +
| keyword  || varchar  ||  100  || Y || The ARK translation keyword || map.layer.bing.aerial
 +
|-
 +
| url  || varchar  ||  2000  ||  N || The url of the layer ||
 +
|-
 +
| options  || varchar  ||  4000  ||  N || The OL4 Options to pass to the Layer class in JSON format ||
 +
|-
 +
| parameters  || varchar  ||  4000  ||  N || The layer parameters to pass to the source provider ||
 +
|-
 +
|}
 +
 
 +
 
 +
Define available [http://openlayers.org/en/latest/apidoc/ol.Map.html OL4 Map] views in ark_map.
 +
 
 +
{| class="wikitable" style="margin: 0; border: 1px solid grey; text-align:left" cellpadding="4" cellspacing="2"
 +
! colspan="6" | ark_map_source
 +
|-
 +
! Field || Type || Size || Required || Description || Example
 +
|-
 +
| map  || varchar  || 30 || PK  || The key for the map || ark_map_main
 +
|-
 +
| draggable  || boolean  ||  || Y || If the map view is draggable ||
 +
|-
 +
| clickable  || boolean  ||  || Y || If the map view is clickable ||
 +
|-
 +
| zoomable  || boolean  ||  || Y || If the map view is zoomable ||
 +
|-
 +
| zoom  || integer  ||  || Y || The default zoom level || 7
 +
|-
 +
| min_zoom  || integer  ||  || N || The minimum zoom level || 6
 +
|-
 +
| max_zoom  || integer  ||  || N || The maximum zoom level || 16
 +
|-
 +
| srid  || integer  ||  || N || The SRID of the map projection || 4512
 +
|-
 +
| center  || varchar  ||  50  || Y || The default center point of the map view in WKT format || POINT (1155972 7580813)
 +
|-
 +
| extent  || varchar  ||  100  || N || The maximum extent of the map view in WKT format || MULTIPOINT (831000 7230000, 1750000 7950000)
 +
|-
 +
| keyword  || varchar  ||  100  || N || The ARK translation keyword || ark.map.main
 +
|-
 +
| options  || varchar  ||  4000  ||  N || The OL4 Options to pass to the Map class in JSON format ||
 +
|-
 +
|}
 +
 
 +
 
 +
Define the Source Layers displayed in a Map View in the ark_map_legend table.
 +
 
 +
{| class="wikitable" style="margin: 0; border: 1px solid grey; text-align:left" cellpadding="4" cellspacing="2"
 +
! colspan="6" | ark_map_layer
 +
|-
 +
! Field || Type || Size || Required || Description || Example
 
|-
 
|-
| source || varchar  || 30  || bing || bing
+
| map || varchar  || 30 || PK || The map key from ark_map || ark_map_main
 
|-
 
|-
| type || varchar  ||  30  || bing || raster
+
| source || varchar  ||  30  || PK || The source key from ark_map_layer || bing
 
|-
 
|-
| subtype || varchar  ||  30  || bing || tile
+
| layer || varchar  ||  30  || PK || The layer key from ark_map_layer || aerial
 
|-
 
|-
| format || varchar ||  30  || bing || bing
+
| seq || integer ||  || Y || The sequence of the layer in the legend || 1
 
|-
 
|-
| view_class || varchar ||  100  || bing || BingMaps
+
| is_default || boolean ||  || Y || If the view layer is the default ||
 
|-
 
|-
| keyword || varchar ||  100  || bing || map.source.bing
+
| visible || boolean ||  || Y || If the view layer is visible by default ||
 
|-
 
|-
| ticket || varchar ||  100  || bing || zzzzz
+
| enabled || boolean ||  || Y || If the view layer is enabled ||
 
|-
 
|-
| ticket_expiry || datetime ||  || bing || 2020-01-01 00:00:00
+
| keyword || varchar || 100 || Y || The ARK translation keyword || map.layer.bing.aerial
 
|-
 
|-
| options  || varchar  ||  4000  || bing ||
+
| options  || varchar  ||  4000  || N || The OL4 Options to pass to the Layer class in JSON format ||
 
|-
 
|-
 
|}
 
|}

Latest revision as of 14:21, 30 November 2017

Maps

ARK2 supports the display of maps and mapping layers using OpenLayers4. Maps and layers can be dynamically defined in the config database and then linked to a defined page view. Much of the config closely reflects the OpenLayers4 API as this is the map library used by the ARK2 frontend.

Configuration

The following database tables can be configured to define an OL4 map.


Define available OL4 Sources in ark_map_source.

ark_map_source
Field Type Size Required Description Example
source varchar 30 PK The key for the source bing
type varchar 30 Y The type of the source (raster, vector) raster
subtype varchar 30 Y The subtype of the source (image, tile, vector) tile
format varchar 30 Y The format of the source (wms, gml, etc) bing
view_class varchar 100 Y The OL4 Class of the source BingMaps
keyword varchar 100 Y The ARK translation keyword map.source.bing
ticket varchar 100 N The API auth ticket for the source
ticket_expiry datetime N The expiry date for the API auth ticket
options varchar 4000 N The OL4 Options to pass to the Source class in JSON format


Define available OL4 Layers for each Source in ark_map_layer.

ark_map_layer
Field Type Size Required Description Example
source varchar 30 PK The source key from ark_map_source bing
layer varchar 30 PK The layer key aerial
source_name varchar 50 Y The key of the layer as defined by the source provider Aerial
keyword varchar 100 Y The ARK translation keyword map.layer.bing.aerial
url varchar 2000 N The url of the layer
options varchar 4000 N The OL4 Options to pass to the Layer class in JSON format
parameters varchar 4000 N The layer parameters to pass to the source provider


Define available OL4 Map views in ark_map.

ark_map_source
Field Type Size Required Description Example
map varchar 30 PK The key for the map ark_map_main
draggable boolean Y If the map view is draggable
clickable boolean Y If the map view is clickable
zoomable boolean Y If the map view is zoomable
zoom integer Y The default zoom level 7
min_zoom integer N The minimum zoom level 6
max_zoom integer N The maximum zoom level 16
srid integer N The SRID of the map projection 4512
center varchar 50 Y The default center point of the map view in WKT format POINT (1155972 7580813)
extent varchar 100 N The maximum extent of the map view in WKT format MULTIPOINT (831000 7230000, 1750000 7950000)
keyword varchar 100 N The ARK translation keyword ark.map.main
options varchar 4000 N The OL4 Options to pass to the Map class in JSON format


Define the Source Layers displayed in a Map View in the ark_map_legend table.

ark_map_layer
Field Type Size Required Description Example
map varchar 30 PK The map key from ark_map ark_map_main
source varchar 30 PK The source key from ark_map_layer bing
layer varchar 30 PK The layer key from ark_map_layer aerial
seq integer Y The sequence of the layer in the legend 1
is_default boolean Y If the view layer is the default
visible boolean Y If the view layer is visible by default
enabled boolean Y If the view layer is enabled
keyword varchar 100 Y The ARK translation keyword map.layer.bing.aerial
options varchar 4000 N The OL4 Options to pass to the Layer class in JSON format