You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to build these markers in code and add them to the map? I need the ability to add and remove markers based on the result of an API call.
Currently, when the API returns 0 markers I set the variable markers to null and receive this error: TypeError: Cannot read properties of null (reading 'removeChild')... I can add more detail if you need it.
Thank you.
The text was updated successfully, but these errors were encountered:
I am currently adding markers to the map like this: (I have custom Marker Icons and popup code, this example is simplified).
<Map> {#if markers} {#each markers as m} <Marker lng={m.longitude} lat={m.latitude} label={m.name} /> {/each} {/if} </Map>
Is there a way to build these markers in code and add them to the map? I need the ability to add and remove markers based on the result of an API call.
Currently, when the API returns 0 markers I set the variable markers to null and receive this error: TypeError: Cannot read properties of null (reading 'removeChild')... I can add more detail if you need it.
Thank you.
The text was updated successfully, but these errors were encountered: