mapbox-gl-js
mapbox-gl-js copied to clipboard
Support symbols for the source._dataType='vector' instead of source.type=='vector'
Motivation
So to add support to the custom vector layers I noticed that in the style.js we only support symbol layers for the vector
and geojson
source types. However I noticed that there is another parameter source._dataType
which can be used so it also supports custom source types
Here is the line that checks for the source.type
https://github.com/mapbox/mapbox-gl-js/blob/fd2045fd6aef55d9265c9a4c43fb48b294289482/src/style/style.js#L1408
I guess changing it to check based on source._dataType
will allow custom sources to support symbols too
Design Alternatives
it allows to add better support for the vector custom sources.
Implementation
https://github.com/mapbox/mapbox-gl-js/blob/fd2045fd6aef55d9265c9a4c43fb48b294289482/src/style/style.js#L1408
I guess changing it to check based on source._dataType
will allow custom sources to support symbols too