Declarative Geolocation API as Web Components.
npm install x-geolocation> Declarative Geolocation API as Web Components.



Using npm:
``sh`
$ npm install x-geolocation
Import XGeolocation and register it.
`html`
Put tag.
`html`
To monitor position changing, execute monitorPosition() function.
`js`
document.querySelector('x-geolocation').monitorPosition();
Or set monitor attribute.
`html`
Handle positionchange event using addEventListener().
`js``
document.querySelector('x-geolocation').addEventListener('positionchange', e => {
console.log('latitude:', e.detail.latitude);
console.log('longitude:', e.detail.longitude)
});