This commit is contained in:
Amirhossein Mahmoodi
2024-07-14 13:53:20 +03:30
parent c63c8c46ac
commit 740c1006c4
7 changed files with 8 additions and 35 deletions

View File

@@ -1,32 +0,0 @@
import { useRef } from "react";
import { Marker, useMapEvents } from "react-leaflet";
const prefix = process.env.NODE_ENV === "production" ? "/v3" : "";
const locationMarker = L.icon({
iconUrl: prefix + "/images/locationMarker.png",
iconSize: [50, 50],
iconAnchor: [25, 50],
});
const MarkerLocation = ({ setValue }) => {
const location = useRef();
const map = useMapEvents({
move: (e) => {
const latlon = e.target.getCenter()
location.current?.setLatLng(latlon);
setValue('lat', latlon.lat)
setValue('lon', latlon.lng)
},
zoom: (e) => {
const latlon = e.target.getCenter()
location.current?.setLatLng(latlon);
setValue('lat', latlon.lat)
setValue('lon', latlon.lng)
},
});
return (
<Marker ref={location} icon={locationMarker} position={map.getCenter()} key="location" />
)
}
export default MarkerLocation

View File

@@ -1,7 +1,5 @@
const api = process.env.NEXT_PUBLIC_API_URL;
export const GET_CSRF = api + "/csrf";
export const GET_USER_ROUTE = api + "/webapi/user/get-permission";
export const GET_LOGIN_ROUTE = api + "/login_dev";
export const GET_INQUIRY_PRIVACY_FENCING_ROUTE = api + "/api/v3/harim/divarkeshi";