How to install leaflet-locatecontrol plugin


#1

How to install this plugin for ionic ?


i followed instructions
i used npm install then tried to include but couldnt make it work.


#2

Still active.I really need this :frowning:


#3

Still active.I really need this


#4

Thanks to Suraj Rao from the stackoverflow answer:

To install a js library and import it in Typescript file, you need to have a type declaration file.
For leaflet-locatecontrol, it is present in DefinitelyTyped library and can be saved from npm

npm i @types/leaflet.locatecontrol --save-dev

In order to use in a typescript file do:

import * as L from 'leaflet';
import 'leaflet.locatecontrol';