ui-mapbox icon indicating copy to clipboard operation
ui-mapbox copied to clipboard

Add getSource() method to plugin

Open ignacio68 opened this issue 4 years ago • 0 comments
trafficstars

Hi, it's possible to add getSource() MapBox method to the plugin?

I have some problems when I remove sources. Mapbox returns a error message "Could not remove source with id: mySourceId". I need to know if the source exits in the map instance.

Example

export const deleteSource = (id: string): void => {

const source = map.getSource(id)

!!source ? map.removeSource(id) : console.log('No source")

}

Thanks in advance.

ignacio68 avatar Feb 22 '21 11:02 ignacio68