mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-26 03:26:41 +07:00
stickers clearing on toggling button
This commit is contained in:
parent
7fc53444a8
commit
21532ba240
2 changed files with 31 additions and 10 deletions
|
@ -11,13 +11,13 @@ export class Stickers {
|
|||
|
||||
this.layer.addTo(this.map);
|
||||
}
|
||||
|
||||
createOnClick = e => {
|
||||
if (!e || !e.latlng) return;
|
||||
|
||||
const { latlng } = e;
|
||||
this.createSticker({ latlng });
|
||||
};
|
||||
//
|
||||
// createOnClick = e => {
|
||||
// if (!e || !e.latlng) return;
|
||||
//
|
||||
// const { latlng } = e;
|
||||
// this.createSticker({ latlng });
|
||||
// };
|
||||
|
||||
createSticker = ({ latlng, sticker }) => {
|
||||
const marker = new Sticker({
|
||||
|
@ -41,4 +41,12 @@ export class Stickers {
|
|||
this.map.removeLayer(ref.sticker);
|
||||
this.stickers.splice(index, 1);
|
||||
};
|
||||
|
||||
clearAll = () => {
|
||||
const target = [...this.stickers];
|
||||
target.map(sticker => {
|
||||
this.deleteStickerByReference(sticker);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue