gregallensworth / L.TileLayer.Cordova

Leaflet TileLayer subclass which caches to local filesystem, for Cordova/Phonegap
MIT License
87 stars 25 forks source link

Usage with ionic 2 ? #20

Closed davidanquetin closed 7 years ago

davidanquetin commented 7 years ago

Hej, is your lib usable with Ionic 2 ? if yes, which is the process to include it ? thanks

gregallensworth commented 7 years ago

I have not tried it with Ionic, but I expect it would work. It uses only standard Cordova plugins File and FileDownload

You should be able to download the distribution and add it to your "www" folder, then follow the examples. No other installation (`cordova' commands) should be necessary.

davidanquetin commented 7 years ago

thanks @gregallensworth , i am trying, i had imported js files within index.html of ionic app, and then in my component

import  'leaflet';
import  'leaflet-tilelayer-cordova';

and it seems to work, L variable is available.

I have now to detect cordova and adapt my code to work with my app.

thanks again.

davidanquetin commented 7 years ago

the only alert that i have is Property 'tileLayerCordova' does not exist on type 'typeof L'. I have installed types for leaflet, but not for your script.. Are they existing ?

davidanquetin commented 7 years ago

Finally i resolved the problem with passing L variable to a local typsecript variable

L : any;
....
this.L = L;

now it seems to work.