Skip to content
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

[Bug]Returning response json source not drawing Markers on map. #2333

Closed
echo292 opened this issue Dec 25, 2023 · 2 comments
Closed

[Bug]Returning response json source not drawing Markers on map. #2333

echo292 opened this issue Dec 25, 2023 · 2 comments

Comments

@echo292
Copy link

echo292 commented Dec 25, 2023

Description

I'm using the latest version of react-map-gl 7.17. I have a Marker draw issue when using a valid fetched json response source.
I'm able to manually hardcode a list of json values and the pins show up on the map with no problem.
Then when trying to populate the map from a response json source, no markers are populating. I console.log confirmed the incoming data looks correct before and after the and it has latitude and longitude values.. I'm not getting any console errors/warnings to help me troubleshoot why the markers are not drawing so I don't think this is an asynchronous issue.

Expected Behavior

  1. Draw Markers on the map
  2. Return errors if something is wrong with the incoming data.

Steps to Reproduce

  1. Have a Django rest framework API that returns a json response of coordinates. Should produce the same issue with any fetched json response.
  2. With a basic react map gl setup, draw markers from the json response with coordinates.
  3. The following link in the discussions demonstrates all my attempts to get this to work. LINK

Environment

  • Framework version: react-map-gl@7.17
  • Map Library: mapbox-gl@3.0.1
  • Browser: Chrome Version 120.0.6099.111 (Official Build) (64-bit)
  • OS: Windows 10 Pro 22H2 19045.3803

Logs

No warnings to report
No errors to report

@echo292 echo292 added the bug label Dec 25, 2023
@Pessimistress
Copy link
Collaborator

If your fetched response does not behave the same as hard-coded data, then it's not in the same format. react-map-gl is not responsible for troubleshooting errors in your own API.

Issues are for reporting bugs in this library only. Please stick with Discussions for everything else.

@Pessimistress Pessimistress closed this as not planned Won't fix, can't repro, duplicate, stale Dec 25, 2023
@Pessimistress Pessimistress removed the bug label Dec 25, 2023
@echo292
Copy link
Author

echo292 commented Dec 26, 2023

As I mentioned in my post, the response data and the hardcoded data are 100% identical. The hardcoded data is a copy of the response data. I've done similar things on other applications so I know the data is good.
There's a bug in the <Marker></Marker>
The fact I had to convert the json data to an array to work is another problem that should be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants