Issue
I'm trying to drag a polygon in angular 13 empty project. The code is exactly the same as here (accepted answer): Leaflet : How to move a Polygon
i put css and js files in angular.json but tried also inside index.html and polygon is just not draggable
"styles": [
"src/styles.scss",
"./node_modules/leaflet/dist/leaflet.css",
"./node_modules/@bopen/leaflet-area-selection/dist/index.css"
],
"scripts": [
"./node_modules/leaflet/dist/leaflet.js",
"./src/assets/Path.Drag.min.js"
]
Solution
Truly recommended this article how to integrate leaflet plugins to angular project. Many working examples are included and polygon drag is one of them.
https://asymmetrik.com/ngx-leaflet-and-leaflet-plugins/
Basically need to add:
import 'leaflet-path-drag';
Answered By - eladr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.