79374135

Date: 2025-01-21 11:09:33
Score: 0.5
Natty:
Report link

You must parse the campgroundGeometry before accessing the coordinates and passing it to setLngLat.

const campgroundGeometry = '{"type":"Point","coordinates":[-122.419906,37.779026]}'
const geometry = JSON.parse(campgroundGeometry);
new mapboxgl.Marker().setLngLat(geometry.coordinates);

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Bankole Idris