Ionic2 +Leaflet, leaflet plugins scrollTo include error


#1

Hello, i’m new to Ionic 2 and Angular, and i’m trying to get leaflet slideTo plugin working ( https://www.npmjs.com/package/leaflet.marker.slideto )

After npm install I’ve included library like

import ‘leaflet’;
import ‘leaflet.marker.slideto/Leaflet.Marker.SlideTo.js’;

but when i try to use it like that:

vehicle.slideTo(position, {
duration: 200,
keepAtCenter: true
});

console says “Property ‘slideTo’ does not exist on type ‘Marker’.”

The funny part is that it works 1 out of 10 builds… And i can’t figure out what’s wrong

What can i do to make it work ?


#2

all i did is i include "<script src='https://unpkg.com/leaflet.marker.slideto@0.2.0/Leaflet.Marker.SlideTo.js'></script>" after build/main.js


#3

Mine solution was to add proper typings for markers