25 lines
825 B
JavaScript
25 lines
825 B
JavaScript
// components/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="fixed top-5 left-5 z-50 bg-white shadow-lg rounded-lg 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-blue-500 text-white p-2 rounded w-full hover:bg-blue-600">
|
|
Zu Marker zoomen
|
|
</button>
|
|
</form>
|
|
);
|
|
};
|
|
|
|
export default CoordinateInput;
|