Comments (2)
Yes, you can do this by overriding the onFeatureAdd method of the PolylineEditor class if you only want to effect polylines. You can change the startof the index.html example script so that it starts like:
<script type="text/javascript">
var startPoint = [43.1249, 1.254];
const MyPolylineEditor = L.Editable.PolylineEditor.extend({
// Override to disable path dragging
onFeatureAdd: function () {
this.tools.editLayer.addLayer(this.editLayer);
if (this.feature.dragging) this.feature.dragging.disable();
},
});
var map = L.map('map', {
editable: true,
editOptions: {
polylineEditorClass: MyPolylineEditor,
}}).setView(startPoint, 16),
from leaflet.editable.
That's working great. Thanks a lot. Maybe this could become a parameter of Leaflet.Editable..
from leaflet.editable.
Related Issues (20)
- Grid Snap Editing
- enableEdit is not a function with L.Layer class HOT 1
- Layers are no longer draggable after being toggled HOT 2
- editable:true not recognized as property in MapOptions HOT 3
- How remove last point on a Polygon created by editTools.startPolygon() using pop() method?
- L.geoJSON, L.CircleMarker not supported for editing HOT 1
- New feature: Download edited data HOT 1
- Polyline pop() not working
- Circle resize-handle position incorrect at higher latitudes
- Limit radius of editable circle HOT 3
- Polygon last point
- Rectangle setBounds breaks refreshVertexMarkers HOT 1
- Can't connect library in vue
- Help needed? HOT 3
- Leaflet Polygon Enable Edit forces Polygon to be draggable
- Middlemarkers not visible on L.Rectangle
- [Tips] Creating & Editing does not fire same event (event for Saving changes)
- Marker works in Leaflet v1.7.1, has undefined _renderer errors in Leaflet v1.9.4
- Edit polygon points via input field, without using mouse on map
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.editable.