-
-
Notifications
You must be signed in to change notification settings - Fork 847
Deprecated URLInIconImages
Miklós Fazekas edited this page Apr 1, 2023
·
2 revisions
Using images/urls directly in styles
<SymbolLayer style={{iconImage: require('foo.png')}} />
<SymbolLayer style={{iconImage: 'https://download.samplelib.com/png/sample-red-100x75.png'}} />
<Images images={{foo: require('foo.png')}} />
<SymbolLayer style={{iconImage: 'foo'}}/>
<Images images={{foo: 'sample-red-100x75.png'}} />
<SymbolLayer style={{'sample-red-100x75.png': 'https://download.samplelib.com/png/sample-red-100x75.png'}}/>
Required a lot of extra code, and it's esp. an issue since image loading is async, also it's a leaky abstraction as doesn't work with expressions:. The alternative is more flexible.