jieter / Leaflet-semicircle

Extend Leaflet's circle class to display semicircles.
http://jieter.github.io/Leaflet-semicircle/examples/semicircle.html
MIT License
123 stars 52 forks source link

I can use this extension in angular? #36

Closed souzaemmanuel closed 4 years ago

souzaemmanuel commented 4 years ago

I installed the dependency via npm but I was unable to use the properties of the semicircle.

Some help?

souzaemmanuel commented 4 years ago

Ok, I found the correct way to draw semicircles. The problem was that in addition to installing the Leaflet-semicircle extension via npm I needed to import the javascript file properly.

Just follow the steps:

  npm i leaflet --save  
    npm install --save leaflet-semicircle

In angular.json file add the libraries as follows:


    "scripts": [
          "node_modules/leaflet/dist/leaflet.js",
          "./node_modules/leaflet-semicircle/semicircle.js"
      ]

And finaly, the problem was here:


    import 'leaflet';
    import 'leaflet-semicircle';

    //Right way to import and extend all extensions importeds previously
    declare let L;

    //Doesn't works */
    //import * as L from 'leaflet';