Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49248

Multiple import on the same namespace (Extend library)

$
0
0

@Ponchia wrote:

Probably the title is wrong, I still have to figure out what I am missing of this.

So I have an application which as leaflet running and everything is fine.

Now I want to be able to add any of the existing project created to extend the functionality of leaflet.

Example: LeafLet + Leaflet.EasyButton

Example 2: LeafLet + leaflet.offline

Now I find myself in the situation on which I have to write the imports:

import leaflet from 'leaflet';
import leaflet from 'leaflet-easybutton';

Of course I can’t because of the douled namespace, now my question is how can I use the second library as an extension of the first one?

Going back to the first example, using the example given on github, I should be able to do something like this:

    leaflet.easyButton('fa-globe', function(btn, map){
          console.log("cicked");
    }).addTo(this.map);

But I cannot figure out how to extend the first library with the second in order to be able to use it as I explained.

I know it is a silly question, but I was not able to solve it in hours.

Thanks to whoever can help me.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>