Cartagen is a Ruby on Rails application. Before you can work on it, you will need Ruby, Rails and Rake.
The Cartagen Javascript is in public/cartagen/src. However, it is concatenated info public/cartagen/cartagen.js by Sprockets. If you’re just modifying files, just make sure not to move or change lines starting with //=
– those lines are Sprocket directives. If you nee to add or move files, take a look at http://getsprockets.org/installation_and_usage to see how to get your files into the concatenated cartagen.js
To build cartagen.js, just run rake build
from public/cartagen. To have Cartagen automatically build wheneve the src/ directory is changed, run rake autobuild
. Be aware, though, that autobuild only checks every 5 seconds, so wait a few seconds after making a change before testing it in a browser.
Cartagen uses the Prototype JavaScript Framework. You should be at least somewhat familiar with Protoype before developing with Cartagen – it will save you a lot of time.
The Javascript source is documented with JsDoc Toolkit. Please try to add documentation for any functions or properties you add.
l(), which logs a message to the browser's console. Various other methods are in the
D name space.Coordinates in Cartagen can get complicated; there’s latitude, longitude, Map x, Map y, Screen x, Screen y… an more! Learn all about it on the Cartagen Coordinates page.
Cartagen makes extensive use of the Geohash geocoding system invented by Gustavo Niemeyer. Read more about Geo Hashes, make money online