Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is there no edit point? #183

Open
trowa1234 opened this issue Aug 20, 2021 · 1 comment
Open

Why is there no edit point? #183

trowa1234 opened this issue Aug 20, 2021 · 1 comment

Comments

@trowa1234
Copy link

leaflet: 1.7.1
leaflet-freedraw: 2.13.2

createDraw() {
      this.freeDrawInstance = new FreeDraw({
        mode: CREATE | EDIT | DELETE
      });
      this.MAP.addLayer(this.freeDrawInstance);
      this.freeDrawInstance.on('markers', event => {
        console.log(event.latLngs);
      });
    }

my screenshot:
image

Example screenshot:
image

@thucvu97
Copy link

thucvu97 commented Aug 27, 2023

it works
import FreeDraw, { ALL} from 'leaflet-freedraw';
const freeDraw = new FreeDraw({ mode: ALL });

update css

.leaflet-container {
height: 400px;
width: 90%;
margin: 0 auto;
}

path.leaflet-line {
stroke: #50622b;
stroke-width: 2;
}

div.leaflet-edge {
background-color: #95bc59;
box-shadow: 0 0 0 2px white, 0 0 10px rgba(0, 0, 0, 0.35);
border-radius: 50%;
cursor: move;
outline: none;
transition: background-color 0.25s;
}

div.leaflet-edge.disabled {
pointer-events: none;
background-color: #bbb;
}

path.leaflet-polygon {
fill: #b4cd8a;
stroke: #50622b;
stroke-width: 2;
fill-opacity: 0.75;
}

.map.mode-create {
cursor: crosshair;
}

.checkboxContainer {
display: flex;
flex-direction: column;
margin: 40px 40px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants