addSprite(
id:string,url:string,options?:StyleSetterOptions):this
Defined in: ui/map.ts:3823
Adds a sprite to the map's style. Fires the style event.
Parameters
| Parameter | Type | Description |
|---|---|---|
id |
string |
The ID of the sprite to add. Must not conflict with existing sprites. |
url |
string |
The URL to load the sprite from |
options? |
StyleSetterOptions |
Options object. |
Returns
this
Example
map.addSprite('sprite-two', 'http://example.com/sprite-two');