Wax
Tools for improving web maps. The centerpiece of the code is a client
implementation of the MBTiles interaction specification.
Controls
OpenLayers
wax.ol.Interaction
wax.ol.Legend
wax.ol.Embedder
wax.ol.Switcher
Google Maps API v3
wax.g.Controls
wax.g.MapType
wax.g.mapBoxLogo
Modest Maps
.interaction()
.zoomer()
.legend()
.fullscreen()
.zoombox()
.hash()
Lib
Records
The main usage of mapping frameworks through Wax is via records. Records are pure JSON objects that have a 1:1 representation with function Javascript code, but, unlike imperative code, can be stored and manipulated as configuration. Records are tested with polymaps, openlayers, Modest Maps and Google Maps API v3, but the system (/lib/record.js
) is generalized beyond mapping tools of any sort, to exist as a basic Javascript AST interpreter.
Currently records support several control techniques:
@new
instantiates objects@chain
runs functions, changing the value of this
with each run@inject
runs a function in a @chain
without changing the reference to this
@call
runs a function from the global scope changing the value of this
@literal
allows an object attribute to be referenced@group
runs a set of record statements (e.g. using the keywords above) in order
These techniques (with arbitrary levels of nesting), are sufficient to construct maps in each mapping framework.
Requirements
Usage Examples
Samples of usage can be found in examples/. These depend on localizing copies of each API code.
To set up the examples first run:
make ext
Then check out the example html files.
Building library
For wax users, a minified library is already provided in build/.
But for developers you can rebuild a minified library by running:
make build
Install mainline UglifyJS:
npm install https://github.com/mishoo/UglifyJS/tarball/master
Make the combined & minified OpenLayers & Google Maps libraries:
rm -r build
make build
Building docs
Wax uses docco for documention. Install it like:
npm install docco
Make the docs:
make doc
Includes
Wax includes two libraries in /lib
which are included in builds
Changelog
1.4.1
- Tweaks to
boxselect
including removability.
1.4.0
- Added
.boxselect(function())
1.3.0
- Added
.zoombox()
and hash()
controls for Modest Maps.
1.2.1
1.2.0
- Functions on the Google Maps
Controls
object are now lowercase. - Changed
WaxProvider
's signature: now takes an object of settings and supports multiple domains, filetypes and zoom restrictions. - Changed
wax.g.MapType
's signature: now accepts an object of settings in the same form as WaxProvider
- Modest Maps
.interaction()
now supports clicks, with the same clickAction
setting as the OpenLayers version. - Added large manual for usage.
- Fixed Modest Maps
.fullscreen()
sizing. - Removed
/examples
directory: examples will be in manuals. - Performance optimization of interaction code: no calculations are performed during drag events.
1.1.0
- connector/mm: Added Modest Maps connector.
- control/mm: Added
.legend()
, .interaction()
, .fullscreen()
, and .zoomer()
controls for Modest Maps. - control/lib: Added
addedTooltip
event to tooltip.js
to allow for external styling code.
1.0.4
- connector/g: Hide error tiles and wrap on dateline.
- connector/g: Performance improvements.
- control/legend: Fix rerender bug.
- control/tooltip:
addedtooltip
event for binding/extending tooltip behavior. Subject to change.
1.0.3
- Embedder functionality for Google Maps and OpenLayers.
1.0.2
1.0.1
make ext
added for downloading and installing external libraries needed to use examples.- Bug fixes for legend, IE compatibility.
1.0.0
Authors
- Tom MacWright (tmcw)
- Young Hahn (yhahn)
- Will White (willwhite)