0.1.0 • Published 6 years ago

ol-geolocation v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

ol-geolocation

Geolocation Control for OpenLayers

Install

npm install ol-geolocation

Usage

import Map from 'ol/map';
import View from 'ol/view';
import GeolocationToggle from 'ol-geolocation';

new Map({
   controls: [
     new GeolocationToggle(),
   ],
   target: 'map-container',
   view: new View({
     center: [0,0],
     zoom: 14
   })
 });

Options

All parameters are optional.

ParameterTypeDescription
accuracyStyleol.style.StyleStyle to apply to "accuracy" feature
positionStyleol.style.StyleStyle to apply to "position" feature
transformFn(geometry)FunctionGeometry transformation function.

Style

CSS styles need to be included to style the control elements.

Examples

TODO

Test

TODO

0.1.0

6 years ago