TrackLayer: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== About == The Track Layer is used to display the track system in Maria GDK. ==Setup== <source lang="ts"> export interface ITrackLayerInfo extends IBaseLayerInfo { L...") Â |
(→â€)  |
||
(One intermediate revision by the same user not shown) | |||
Line 29: | Line 29: | ||
<source lang="ts"> | <source lang="ts"> | ||
include {Layers} from "@mariateleplan/map-core" | include {Layers} from "@mariateleplan/map-core" | ||
const | const trackLayerInfo: Layers.ITrackLayerInfo = { | ||
      "LayerType": "TrackLayer", | |||
      "Id": "ais_tracks", // | |||
      "Name": "Tracks ais", | |||
      "ListName": "ais.test", | |||
      "SymbolPointServiceUrl": "http://servicehost:PORT/symbolpoint", | |||
      "ServiceUrl": "http://servicehost:PORT/tracks", | |||
      "StyleXml": { | |||
        "Value": "./data/style/TrackStyleSet.xml", //expects a style xml at this location, an example of a style xml is found in the maria-map example project | |||
} | Â Â Â Â Â Â Â Â "Type": "url" | ||
      }, | |||
      "UpdateInterval": 250, | |||
      "SimplifiedZoomRange": [ | |||
        0, | |||
        7 | |||
      ], | |||
      "LogLevel": "debug" | |||
    }, | |||
const layers: Layers.ILayersInfo = { | const layers: Layers.ILayersInfo = { | ||
   Services:{}, |    Services:{}, | ||
   Layers:[new Layers. |    Layers:[new Layers.TrackLayer(trackLayerInfo);] | ||
} | } | ||
const props = {Â Â | const props = {Â Â |
Latest revision as of 09:04, 3 May 2022
About
The Track Layer is used to display the track system in Maria GDK.
Setup
export interface ITrackLayerInfo extends IBaseLayerInfo {
LayerType: "TrackLayer";
/** Name of tracklist to recieve from track service */
ListName: string;
/** Track service URL */
ServiceUrl: URL;
SymbolPointServiceUrl: URL;
/** Set default style Xml */
StyleXml: UrlOrInlineData;
/** Set default filter. If empty, none is chosen. */
FilterXml?: UrlOrInlineData;
/** Default symbol size in pixels */
BaseSymbolSize?: number;
/** Sets the update interval time in [ms] between new get requests for tracks*/
UpdateIntervalMs?: number;
/** When in this zoom range, use a simplified, high preformance track symbols */
SimplifiedZoomRange?: [min: number, max: number];
}
Example
include {Layers} from "@mariateleplan/map-core"
const trackLayerInfo: Layers.ITrackLayerInfo = {
"LayerType": "TrackLayer",
"Id": "ais_tracks", //
"Name": "Tracks ais",
"ListName": "ais.test",
"SymbolPointServiceUrl": "http://servicehost:PORT/symbolpoint",
"ServiceUrl": "http://servicehost:PORT/tracks",
"StyleXml": {
"Value": "./data/style/TrackStyleSet.xml", //expects a style xml at this location, an example of a style xml is found in the maria-map example project
"Type": "url"
},
"UpdateInterval": 250,
"SimplifiedZoomRange": [
0,
7
],
"LogLevel": "debug"
},
const layers: Layers.ILayersInfo = {
Services:{},
Layers:[new Layers.TrackLayer(trackLayerInfo);]
}
const props = {
"Zoom": 10,
"Center": [1197567, 8380058],
"Projection": 'EPSG:3857'
}
const mapHtmlId = "map";
const maria = new MariaCore(props, mapHtmlId)
maria.SetupLayers(layers)