Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created July 12, 2011 02:00
Show Gist options
  • Save tmcw/1077250 to your computer and use it in GitHub Desktop.
Save tmcw/1077250 to your computer and use it in GitHub Desktop.
wow - map-making cheat codes

wow

Wow is a collection of higher-level scripts building on Wax, Modest Maps, and/or other mapping frameworks. It's mostly maintained by the MapBox crew but anyone is free to play.

It's inspired by 140byt.es and thus the rules are pretty much the same.

How to play

  1. Click the Fork button above to fork this gist.
  2. Modify all the files to according to the rules below.
  3. Save your entry and tweet it up!

Keep in mind that thanks to the awesome sensibilities of the GitHub team, gists are just repos. So feel free to clone yours and work locally for a more comfortable environment, and to allow commit messages.

Dependencies

  • Dependency on jQuery is discouraged and should be noted if present
  • Wax build dependency implies reqwest dependency - you can use it for AJAX.
  • All wow scripts should prop themselves up with the following chunks of code as headers:

Modest Maps

var wow = wow || {};
wow.mm = wow.mm || {};

Leaflet

var wow = wow || {};
wow.leaf = wow.leaf || {};

Google Maps API v3

var wow = wow || {};
wow.g = wow.g || {};

OpenLayers

var wow = wow || {};
wow.ol = wow.ol || {};

Code

Try to use all the tools you can to jazz up your code.

  • JSHint gives suggestions about code improvements and will highlight some browser dead-ends.
  • Read Modest Map's util.js to see if you can use its functions instead of including a library.
wow = wow || {};
wow.mm = wow.mm || {};
wow.mm.example = function(map, options) { };
<!DOCTYPE html>
<title>Test</title>
<script src='https://raw.github.com/stamen/modestmaps-js/master/modestmaps.js'></script>
<script>
wow = wow || {};
wow.mm = wow.mm || {};
wow.mm.example = function(map, options) { };
</script>
<body>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment