Closed kelcon closed 4 years ago
On iOS:
import icon from '../assets/example.png';
this.source = { "type": "FeatureCollection", "features": [{"type":"Feature","properties":{"name":"Icon", "icon": "icon","rotation":270},"geometry":{"type":"Point","coordinates":[ 21.1, 52.1]}} ] };
<MapboxGL.Images images={{icon}} /> <MapboxGL.ShapeSource id="_source" shape={this.source}> <MapboxGL.SymbolLayer id="_layer" style={ {iconImage: ['get', 'icon'] } } /> </MapboxGL.ShapeSource>
iconImage: '{icon}'
solved the problem (although not documented).
On iOS: