Created
March 30, 2010 09:06
-
-
Save ryanwilliams/348938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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