Skip to content

Ol Package

Tzahi Levi edited this page May 7, 2019 · 3 revisions

@ansyn/ol give the ability to use OpenLayers api without the need to know anything about OpenLayers.

Install

npm i @ansyn/ol

@ansyn/ol must be install with the @ansyn/imagery packages

Classes

@ansyn/ol supply number of clases that you can provide to your imagery module

  1. OpenLayersMap - To create an open layers map container in your app.
  2. OpenLayerOSMSourceProvider - To use open layers map with OSM as your world map source provider.
  3. OpenLayerBingSourceProvider - To use open layers map with BING as your world map source provider.
  4. OpenLayerESRI4326SourceProvider - To use open layers map with ESRI_4326 as your world map source provider.
  5. OpenLayerTileWMSSourceProvider - To use open layers map with TileWMS server as your world map source provider.
  6. AnnotationsVisualizer - Open Layers plugin to draw annotations on the map.

Providers

When we use OpenLayersMap we must provide to our root module an OL_CONFIG config in our app.module.ts we pass

import {OL_CONFIG} from '@ansyn/ol';

...
providers: [
  {
    provide: OL_CONFIG,
    useValue: {}
 }
...
]

We can pass an empty object to use the default config or pass an object with the structure:

{
    tilesLoadingDoubleBuffer: {
        debounceTimeInMs: number;
        timeoutInMs: number;
    };
    floatingPositionSuffix?: string;
}
  • tilesLoadingDoubleBuffer: time to wait when loading tiles before show them
    • debounceTimeInMs: add delay to the event.
    • timeoutInMs: start showing the tiles.
  • floatingPositionSuffix: string to concat to the coordinates position.