Leaflet.Arc | Leaflet.js plugin for drawing Great Circle arcs using arc.js | Plugin library
kandi X-RAY | Leaflet.Arc Summary
kandi X-RAY | Leaflet.Arc Summary
Leaflet.js plugin for drawing Great Circle arcs using arc.js. This Leaflet.js plugin adds L.Polyline.Arc function which wraps arc.js functionality for drawing Great Circle arcs on your maps. Tested with Leaflet v1.0.0-beta.2 and v1.0.0-rc.3.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Leaflet.Arc
Leaflet.Arc Key Features
Leaflet.Arc Examples and Code Snippets
Community Discussions
Trending Discussions on Leaflet.Arc
QUESTION
How do I use the leaflet-arc plugin in Angular? What I've tried so far:
npm install --save leaflet-arc
- Add
"scripts": ["node_modules/leaflet-arc/src/leaflet-arc.js"]
toangular.json
. - Add
import '../../../node_modules/leaflet-arc/src/leaflet-arc.js';
tomy-component.component.ts
.
However when I do the following inside my-component.component.ts
, it still gives me an error that Property 'Arc' does not exist on type 'typeof Polyline'.
:
L.Polyline.Arc(...)
When I do ng serve
this actually works, but it still gives the error when compiling.
Any ideas?
...ANSWER
Answered 2019-Feb-21 at 12:57To make it work you need to follow these steps:
npm i leaflet --save
npm install --save leaflet-arc
Go to angular.json an add the two libraries as follows:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Leaflet.Arc
Include leaflet-arc.min.js after Leaflet: <script src='leaflet-arc.min.js'></script> You can use hosted version from unpkg.com: <script src='//unpkg.com/leaflet-arc/bin/leaflet-arc.min.js'></script> Or install from npm: npm install --save leaflet-arc
Create arcs! L.Polyline.Arc([43.11667, 131.90000], [55.7522200, 37.6155600]).addTo(map); You can also change number of vertices in line or use all L.Polyline options: L.Polyline.Arc([59.56667, 150.80000], [67.50000, 64.03333], { color: 'red', vertices: 200 }).addTo(map);
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page