line 2 routes B & U

master
Araozu 2024-09-04 09:03:31 -05:00
parent c863e06ceb
commit 74d0e9b59d
2 changed files with 20 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -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}
> >