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");
|
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 (
|
return (
|
||||||
<div class="grid grid-cols-[30rem_auto]">
|
<div class="grid grid-cols-[30rem_auto]">
|
||||||
<div>
|
<div>
|
||||||
@ -105,6 +112,11 @@ export function Editor() {
|
|||||||
>
|
>
|
||||||
Reiniciar
|
Reiniciar
|
||||||
</button>
|
</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"
|
<button class="bg-c-primary text-white py-2 px-4 rounded mr-2"
|
||||||
onClick={saveJson}
|
onClick={saveJson}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user