I want to use the diagnostic plugin. I have installed it, but when I try to use diagnostic.islocationavailable in the following code, I get a error " Expected 0 arguments, but got 2."
I’m lost with this because in the plugin’s user manual there are 2 functions as parameters.
import { Component, Input, Injectable } from '@angular/core';
import * as L from 'leaflet';
import { Diagnostic } from '@ionic-native/diagnostic';
export class MapComponent {
constructor(private diagnostic: Diagnostic) {
}
ngOnInit() {
this.showMap();
this.checkLocation();
//this.navigation();
}
showMap() {
this.map = L.map('map').
setView([42.1003479, -8.6134110],
12);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?').addTo(this.map);
}
checkLocation() {
this.diagnostic.isLocationAvailable(function (available) {
alert("Location is " + (available ? "available" : "not available"));
}, function (error) {
alert("The following error occurred: " + error);
});
}
}