DrawObjectLayer

From Maria GDK Wiki
Jump to navigation Jump to search

About

The Draw Object Layer is used to display tactical graphics served as map tiles from the draw object service.

Setup

interface IGdkDrawLayerInfo extends IBaseLayerInfo {
    LayerType: "GdkDrawLayer";
    /** Set which store is used on the draw object service  */
    StoreId?: string;
    /** Set default style Xml. If empty, the service default will be chosen  */
    StyleXml?: UrlOrInlineData;
    /** Set default filter. If empty, none is chosen. */
    FilterXml?: UrlOrInlineData;
    /** Maria draw object service URL */
    DrawObjectServiceUri?: URL;
    /** Maria draw object rendering service URL */
    RenderServiceUri?: URL;
    /** Sets the update interval time in [ms] checking for new draw objects */
    UpdateIntervalMs?: number;
}

Example

include {Layers} from "@mariateleplan/map-core"
const drawObjectInfo: Layers.IGdkDrawLayerInfo = {
          LayerType:"GdkDrawLayer",
          Id:"drawobjs",
          StoreId:"test",
          Name:"GDK Objects",
          Description:"TPG test draw object layer",
          DrawObjectServiceUri:new URL("http://serviceHosterName:PORT/drawobjects/web/"),
          RenderServiceUri:new URL("http://serviceHosterName:PORT/drawobjectrendering/web/"),
          StyleXml:{Type:"inline", Value:""}
}

const layers: Layers.ILayersInfo = {
    Services:{},
    Layers:[new Layers.DrawObjectLayer(drawObjectInfo);]
}
const props = {   
      "Zoom": 10,
      "Center": [1197567, 8380058],
      "Projection": 'EPSG:3857'
    }
const mapHtmlId = "map";
const maria = new MariaCore(props, mapHtmlId)
maria.SetupLayers(layers)