Example sources in the examples dir

This commit is contained in:
Tim Schaub
2015-04-14 10:27:32 -06:00
parent 8fd2e9f79f
commit 89f5e711e6
309 changed files with 21 additions and 16 deletions

20
examples/lazy-source.html Normal file
View File

@@ -0,0 +1,20 @@
---
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>