Skip to content

Instantly share code, notes, and snippets.

@ryanwilliams
Created March 30, 2010 09:06
Show Gist options
  • Save ryanwilliams/348938 to your computer and use it in GitHub Desktop.
Save ryanwilliams/348938 to your computer and use it in GitHub Desktop.
RouteTool.mapController = SC.ObjectController.create(
/** @scope RouteTool.mapController.prototype */ {
overlayObjects: new Array(),
addRoute: function(sender, route) {
if (!route) {
var route = RouteTool.store.createRecord(RouteTool.Route, {
points: [[37.772323, -122.214897], [21.291982, -157.821856], [-18.142599, 178.431], [-27.46758, 153.027892]],
description: 'Test Route 1'
});
}
this.get('overlayObjects').pushObject(route);
console.log('Adding route to map:', route.toString());
},
overlayObjectsPropertyDidChange: function() {
console.log('Overlays changed: ', this.get('overlayObjects'));
}.observes('overlayObjects.[]')
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment