working on map in rms mission
This commit is contained in:
@@ -4,7 +4,22 @@ const DataBox = ({ isSource, isDest, sourcePosition, destPosition, editingTarget
|
|||||||
if (!isSource) return null;
|
if (!isSource) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ position: "absolute", bottom: 5, left: 5, zIndex: 1000, backgroundColor: "white", border: "1px solid #e1e1e1", padding: 1, borderRadius: 2, opacity: 0.8, gap: 1, display: "flex", flexDirection: "column" }}>
|
<Box
|
||||||
|
sx={{
|
||||||
|
position: "absolute",
|
||||||
|
bottom: 5,
|
||||||
|
left: 5,
|
||||||
|
zIndex: 1000,
|
||||||
|
backgroundColor: "white",
|
||||||
|
border: "1px solid #e1e1e1",
|
||||||
|
padding: 1,
|
||||||
|
borderRadius: 2,
|
||||||
|
opacity: 0.8,
|
||||||
|
gap: 1,
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div style={{ display: "flex", alignItems: "end", gap: 4 }}>
|
<div style={{ display: "flex", alignItems: "end", gap: 4 }}>
|
||||||
<TextField
|
<TextField
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -12,12 +27,7 @@ const DataBox = ({ isSource, isDest, sourcePosition, destPosition, editingTarget
|
|||||||
readOnly
|
readOnly
|
||||||
value={sourcePosition ? `${sourcePosition.lat.toFixed(6)}, ${sourcePosition.lng.toFixed(6)}` : ""}
|
value={sourcePosition ? `${sourcePosition.lat.toFixed(6)}, ${sourcePosition.lng.toFixed(6)}` : ""}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button variant="contained" color="success" size="small" onClick={onEditSource}>
|
||||||
variant="contained"
|
|
||||||
color="success"
|
|
||||||
size="small"
|
|
||||||
onClick={onEditSource}
|
|
||||||
>
|
|
||||||
ویرایش مبدا
|
ویرایش مبدا
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -29,12 +39,7 @@ const DataBox = ({ isSource, isDest, sourcePosition, destPosition, editingTarget
|
|||||||
readOnly
|
readOnly
|
||||||
value={destPosition ? `${destPosition.lat.toFixed(6)}, ${destPosition.lng.toFixed(6)}` : ""}
|
value={destPosition ? `${destPosition.lat.toFixed(6)}, ${destPosition.lng.toFixed(6)}` : ""}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button variant="contained" color="error" size="small" onClick={onEditDest}>
|
||||||
variant="contained"
|
|
||||||
color="error"
|
|
||||||
size="small"
|
|
||||||
onClick={onEditDest}
|
|
||||||
>
|
|
||||||
ویرایش مقصد
|
ویرایش مقصد
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -89,9 +89,7 @@ const Routing = () => {
|
|||||||
setSelectedRoute({ index: "main", coords: decoded });
|
setSelectedRoute({ index: "main", coords: decoded });
|
||||||
|
|
||||||
if (data.alternates && data.alternates.length > 0) {
|
if (data.alternates && data.alternates.length > 0) {
|
||||||
const decodedAlternates = data.alternates.map((alt) =>
|
const decodedAlternates = data.alternates.map((alt) => polyline.decode(alt.trip.legs[0].shape, 6));
|
||||||
polyline.decode(alt.trip.legs[0].shape, 6)
|
|
||||||
);
|
|
||||||
setAlternateCoords(decodedAlternates);
|
setAlternateCoords(decodedAlternates);
|
||||||
} else {
|
} else {
|
||||||
setAlternateCoords([]);
|
setAlternateCoords([]);
|
||||||
@@ -175,7 +173,7 @@ const Routing = () => {
|
|||||||
icon={prevDestIcon}
|
icon={prevDestIcon}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{alternateCoords.map((coords, index) => (
|
{alternateCoords.map((coords, index) => (
|
||||||
<Polyline
|
<Polyline
|
||||||
key={`alternate-${index}-${selectedRoute?.index === index}`}
|
key={`alternate-${index}-${selectedRoute?.index === index}`}
|
||||||
positions={coords}
|
positions={coords}
|
||||||
|
|||||||
Reference in New Issue
Block a user