How to stop polyline decorator marker displaying on map but image layer

المشرف العام

Administrator
طاقم الإدارة
I am working on application uses the leaflet api Live Here

User must enter "1" in alert input field to use the application.

Introduction

Application has some controls to draw different shapes on image.I am going to discuss one control, which suppose to draw line.

The line actually (polyline) uses leaflet polyline decorator library to decorate the line with some css, nut here i use the marker to display on polyline.

I am using multiple images using different featureGroups.

Problem

The line decorator works great, but it shows a strange behaviour as it also draw thos polyline decorator markers on map or map container.

The problem is actually when i draw on image except these polyline decorator marker everything works as desired.

Script

var polylinefence4 = new L.Polyline([], { color: 'red' }); L.easyButton('
', function () { }).addTo(map); function fencePlace4(e) { // Add coordinate to the polyline new L.Marker(e.latlng, { icon: fence4Icon, draggable: false }).addTo(currentFeatureGroup); polylinefence4.addLatLng(e.latlng).addTo(currentFeatureGroup);var decorator = L.polylineDecorator(polylinefence4, {patterns: [{ offset: 0, repeat: '10px', symbol: new L.Symbol.marker() }]}).addTo(currentFeatureGroup); }I don't know why this is happening, i can't entirely understand the polyline decorator so a bit confusion here.If someone has knowledge about that problem please do help.



أكثر...
 
أعلى