bug :lady_beetle:good first issue
Description
mapbox-gl-js version: tested on 1.1.0, probably since forever
browser: Chrome 75.0.3770.100 (Official Build) (64-bit)
Steps to Trigger Behavior
- setStyle on a style with raster-dem source
- getStyle anytime
- setStyle with serialized style object from getStyle
Link to Demonstration
https://jsfiddle.net/srmanc/L20ha5um/1/
Expected Behavior
setStyle should work without error msgs
Actual Behavior
setStyle breaks because bounds and url are set on source but are undefined. Sometimes tiles is undefined on source as well. There are actually two issues:
- Why does setStyle break at all if some undefined properties are set on source (this only happens for raster-dem type).
- When is it acceptable to call getStyle() to get all the relevant properties on sources - they are set initially so there would be no point in not setting them right away - however, tiles property is missing at the first "styledata" event - please review the jsfiddle example with console.log msgs for more input. We can make this work using delete operator but this seems like a nasty bug.