leaflet-ng2
leaflet-ng2 copied to clipboard
Impossible add plugin leaflet-spin
I'm trying to add plugin leaflet-spin from here: https://github.com/makinacorpus/Leaflet.Spin
I had read https://github.com/yagajs/leaflet-ng2/issues/366 and similars, but I can't get add this simple plugin:
import * as L from 'leaflet';
import 'leaflet-spin';
import { MapComponent } from '@yaga/leaflet-ng2';
@Component({
selector: 'app',
template: `<yaga-map><!-- ... --></yaga-map>`
})
export class AppComponent implements AfterViewInit {
@ViewChild(MapComponent) private mapComponent: MapComponent;
public ngAfterViewInit(): void {
const spinPlugin = (L as any).Spinner();
this.mapComponent.addControl(spinPlugin);
}
}
but when I try to use I always got: Property 'Spinner' does not exist on type 'MapComponent'.
this.mapComponent.Spinner(true);
I try with other posibilities Spin(). spin() spinner() but not luck.
If possible add this plugin to yaga leaflet-ng2 ?
Thank you very much.
Do you also import Spin.JS? I don't know this plugin, but it seems possible to add it to leaflet-ng2 at first glance