--- template: "example.html" title: "Lazy Source" shortdesc: "Example of setting a layer source after construction." docs: >

Typically, the source for a layer is provided to the layer constructor. If you need to set a layer source after construction, this can be done with the layer.setSource() method.

The layer in the map above is constructed with no source. Use the links below to set/unset the layer source. A layer is not rendered until its source is set.

tags: "source" ---