Files
openlayers/examples_src/lazy-source.html

20 lines
760 B
HTML

---
template: "example.html"
title: "Lazy Source"
shortdesc: "Example of setting a layer source after construction."
docs: >
<p>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 <code>layer.setSource()</code> method.</p>
<p>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.</p>
tags: "source"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<button id="set-source" class="code">layer.setSource(source)</button>
<button id="unset-source" class="code">layer.setSource(null)</button>