WebMap Service

The WebMapService enables communication with the BackEnd of a WebMap application.

Configuration

The WebMapService should exist as a singleton instance inside the application. This service allows to specify a configuration when the default behavior wants to be modified.

To use a non-default configuration for this service you can use two methods:

  1. Provide the WEBMAP_CONFIG InjectionToken in the root module with the configuration value. To learn more about Angular's dependency injection tokens check out the official documentation.

     @NgModule({
     declarations: [ AppComponent ],
     imports: [ WebMapModule ],
     providers: [
         { provide: WEBMAP_CONFIG, useValue: { useDynamicServerEvents: false }},
         WebMapService
     ],
     bootstrap: [ AppComponent ]
     })
     export class AppModule { }
  2. Use the static function provide(config: WebMapServiceConfig) that is available from the service's class.

     @NgModule({
     declarations: [ AppComponent ],
     imports: [ WebMapModule ],
     providers: [ WebMapService.provide({ useDynamicServerEvents: false }) ],
     bootstrap: [ AppComponent ]
     })
     export class AppModule { }

Below are the list of configuration options:

Option

Type

Default

Description

`useDynamicServerEvents`

`boolean`

`true`

Enabled by default. Allows the Web Components to automatically send events to the Server when they have handlers in the Server Code. The typical case for disabling this is when the WebMap Application will handle manually all events that must be sent to the server.

`webMapVersion`

`string`

`v5`

Its default value is v5. Allows to choose between protocol WebMAP5 (v5) and WepMAP4 (v4) for managing the communication between the back-end server and the front-end.

Configuration Object Example

webmapConfig = {
    useDynamicServerEvents: false,
    webMapVersion: 'v5'
}

Last updated