leaflet-ng2 icon indicating copy to clipboard operation
leaflet-ng2 copied to clipboard

Impossible add plugin leaflet-spin

Open juanmafont opened this issue 4 years ago • 1 comments

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.

juanmafont avatar Nov 09 '20 11:11 juanmafont

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

atd-schubert avatar Feb 23 '21 17:02 atd-schubert