-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
- Can’t drag or transform polygon in Vue 3 project
- Computer
- MacOS BigSur 11.6.1
- Ram 8 GB
- Version
- vue: 3.2.41
- leaflet: 1.7.1
- leaflet-path-transform: 1.1.1
Code
import L from 'leaflet';
import 'leaflet-path-transform';
import 'leaflet/dist/leaflet.css';
const map = L.map('map').setView([0, 0], 2);
L.tileLayer('https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png', {
attribution:
'© <a target="_blank" href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
const poly1 = [
[
[-25, -35],
[-25, 35],
[25, 35],
[25, -35]
]
];
const polygon = new L.Polygon([poly1], {
draggable: true,
transform: true
}).addTo(map);
polygon.transform.setOptions({ rotation: false, scaling: true }).enable();
Transform
Drag
What's the fix for this? Any help would be appreciated.
Metadata
Metadata
Assignees
Labels
No labels



