refactoring locations.js.coffee for map drawing