The map's render method can accept a callback that serves as a state generator. This callback will be called before rendering. Any changes to the map state can be made before rendering takes place (multiple changes will not result in multiple renders). The return from this callback indicates whether the generator is exhausted.
This target copies the ol built files, examples, and loader script to the build/gh-pages directory, making it possible to host our examples on gh-pages.
This loader is responsible for adding ol.js, ol.css and the example-specific js script to the document. This is the loader used in examples when hosted.
With this change, the map knows nothing of animation. Different renderers
may behave differently when their render method is called. A PDF renderer
(thought experiment at this point) might immediately render to a file. The
dom based renderers schedule a repaint for the next animation frame or in a
timeout depending on capabilities - in either case, setting multiple map
properties will *not* result in multiple reflow/repaints.
Telling the compiler that object keys are numeric causes more harm
than good (see === comparison that could never be met though the
compiler didn't catch it).
Never use goog functions without reading the source first. The
goog.array.sort method does nothing special sorting numeric strings
(so the zs array might be ['1', '10', '2'] here).
The render method always generates a map of all tiles that should be drawn
(called tilesToDrawByZ). This includes tiles at alternate resolutions, tiles
still loading, and tiles previously rendered. At the end of the render
sequence we can simply remove all previously rendered tiles that aren't in
tilesToDrawByZ. This provides an alternate solution to the problem described
in #53 and more.
The tilelayer renderer can be simplified a bit by waiting to append tiles to the dom until they have loaded. By calling `map.render()` on tile load, tiles will be appended to the dom in the next available rendering frame (see #33).
There is not currently a need for immediate rendering (so this change is not strictly necessary and could be reverted). If there is a need for immediate rendering, an alternate method can be provided, or an optional argument could be allowed.