npm.io
0.1.0 • Published 8 years ago

ol-geolocation

Licence
MIT
Version
0.1.0
Deps
1
Size
101 kB
Vulns
0
Weekly
0

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.

Parameter Type Description
accuracyStyle ol.style.Style Style to apply to "accuracy" feature
positionStyle ol.style.Style Style to apply to "position" feature
transformFn(geometry) Function Geometry transformation function.

Style

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

Examples

TODO

Test

TODO