-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the map feature [bug] #28
base: main
Are you sure you want to change the base?
Conversation
Kingsuite
commented
Nov 28, 2024
Hey @Kingsuite ! I just checked your PR and I don't see any front dev in the file changes. Only config files modification. |
I have updated the files for reproduction. But I noticed some bug with integrating the map in this environment: |
@schwepps have you able to go through it? |
@Kingsuite I'm going to review it this morning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kingsuite I have added a few comments.
The map is displayed correctly, the coordinates are correctly fetched but the markers are not displayed on the map.
Could you check that please?
Also no need to change the marker on hover if too complicated.
|
||
function CustomMarker({ item }: CustomMarkerProps) { | ||
const id = item?.name.toString().toLowerCase().replace(' ', '_'); | ||
const image = item?.image_data ? item?.image_data.replaceAll('%23', '#') : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked locally and there is no image_data in item. The attribute is called image.
|
||
return ( | ||
<> | ||
{console.log(item, "WTF")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the console.log?
|
||
}) | ||
); | ||
console.log(updatedData, "Coordinates"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the console.log?
const mapRef = useRef<maplibregl.Map | null>(null); | ||
useEffect(() => { | ||
if (mapData) { | ||
console.log(filterByName(mapData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some code missing here instead of the console.log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No nothing was missing here I was testing the filter function
|
||
return mapData.length !== 0 ? <RMap | ||
initialCenter={locations[0] == undefined ? [0, 0] : [locations[0].coordinates[0], locations[0].coordinates[1]]} | ||
style={{ width: '100%', height: "800px", overflowY: "hidden" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the map height a bit smaller like 16:9 ratio?
@schwepps I will revert shortly. I am working on it |
For this I am still figuring out why it's not working. Because I started afresh a React app with these same library, and it worked perfectly. What if there's an overhead style interfering? |
@schwepps GM, have you had time to review the updates? |
@Kingsuite I think the issues with the markers and the projects images below are due to not having a unique key for each element. |
I have tried the key, but not so much has changed. I will push in my new observations. |
This is my observation: https://www.loom.com/share/d4cba707ddf34537bfd7a74f76a8fb1c |