34 lines
887 B
JavaScript
34 lines
887 B
JavaScript
// /components/uiWidgets/CoordinateInput.js
|
|
import React, { useState } from "react";
|
|
|
|
const CoordinateInput = ({ onCoordinatesSubmit }) => {
|
|
const [coordinates, setCoordinates] = useState("");
|
|
|
|
const handleSubmit = e => {
|
|
e.preventDefault();
|
|
if (onCoordinatesSubmit) {
|
|
onCoordinatesSubmit(coordinates);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<form
|
|
onSubmit={handleSubmit}
|
|
className="absolute top-16 right-3 z-50 bg-white rounded-lg shadow-md p-4 w-72"
|
|
>
|
|
<input
|
|
type="text"
|
|
placeholder="Koordinaten eingeben (lat,lng)"
|
|
value={coordinates}
|
|
onChange={e => setCoordinates(e.target.value)}
|
|
className="border p-2 rounded w-full mb-2"
|
|
/>
|
|
<button type="submit" className="bg-littwin-blue text-white p-2 rounded w-full ">
|
|
Zu Marker zoomen
|
|
</button>
|
|
</form>
|
|
);
|
|
};
|
|
|
|
export default CoordinateInput;
|