Can someone assist me with importing files? I am currently utilizing @types/leaflet which defines a specific type.
export namespace Icon {
interface DefaultIconOptions extends BaseIconOptions {
imagePath?: string;
}
class Default extends Icon<DefaultIconOptions> {
static imagePath?: string;
constructor(options?: DefaultIconOptions);
}
}
Now, I am interested in using this library that expands on the Icon functionality: https://www.npmjs.com/package/leaflet-fa-markers. The problem is that it's written in plain JS and lacks a defined type in @types...
L.Icon.FontAwesome = L.Icon.extend({
options: {
popupAnchor: [0, -50]
},
createIcon: function () {
var div = document.createElement('div');
...
Currently, I've imported both the js and css files in .angular-cli.json, however, I'm struggling with how to import it into my service. So far, I've only imported the js lib
import 'leaflet-fa-markers';
//...
let marker = new L.Marker([ lat, lng], {
icon: L.icon.fontAwesome({
iconClasses: 'fa fa-info-circle', // you _could_ add other icon classes, not tested.
markerColor: '#00a9ce',
iconColor: '#FFF'
}),
draggable: true});
But I encounter the following error:
src/app/_services/canimap.service.ts (99,24): Property 'fontAwesome' does not exist on type '(options: IconOptions) => Icon<IconOptions>'.