Hey Team,
I have an account that has custom Doctor entities which do not have addresses on them. Instead, they connect to related Practicing Location entities that do have addresses.
I’m wondering if the MapboxMap component has the ability to display the related entities rather than the Doctor entities which don’t have any geolocation data. The Doctor entity is configured with a builtin.location NLP filter on the c_practicing_location.builtin.location field.
Thanks!
Hey Daniel,
Great question! You can definitely use related entity fields to display locations on the MapboxMap
.
By default, the component looks for the yextDisplayCoordinate
field on the entity. Since your doctor entities don’t have the field, no pins will display on the map.
You need to use the getCoordinate
prop to address this issue. It might look something like this:
<MapboxMap
mapboxAccessToken={process.env.REACT_APP_MAPBOX_API_KEY}
getCoordinate={(result: Result<Ce_Doctor>) =>
result.rawData.c_practicingLocation?.[0].builtin.location.yextDisplayLocation}
/>
Hope this helps!