line 2 routes B & U
This commit is contained in:
parent
c863e06ceb
commit
74d0e9b59d
File diff suppressed because one or more lines are too long
@ -58,6 +58,13 @@ export function Editor() {
|
||||
saveAs(file, "output.json");
|
||||
};
|
||||
|
||||
const copyPoints = () => {
|
||||
const jsonData = JSON.stringify(points().map((obj) => [obj.lat,obj.lng]));
|
||||
navigator.clipboard.writeText(jsonData)
|
||||
.then(() => alert("Copiado"))
|
||||
.catch(() => alert("Error al copiar."));
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="grid grid-cols-[30rem_auto]">
|
||||
<div>
|
||||
@ -105,6 +112,11 @@ export function Editor() {
|
||||
>
|
||||
Reiniciar
|
||||
</button>
|
||||
<button class="bg-c-primary text-white py-2 px-4 rounded mr-2"
|
||||
onClick={copyPoints}
|
||||
>
|
||||
Copiar puntos
|
||||
</button>
|
||||
<button class="bg-c-primary text-white py-2 px-4 rounded mr-2"
|
||||
onClick={saveJson}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user