Skip to content

Instantly share code, notes, and snippets.

@lemieux
Last active August 29, 2015 13:57
Show Gist options
  • Save lemieux/9634575 to your computer and use it in GitHub Desktop.
Save lemieux/9634575 to your computer and use it in GitHub Desktop.
define([
'map',
'fabric'
], function(Map, Fabric){
...
var map = new Map({
main: main,
canvas: new Fabric.Canvas('map_canvas', {
hoverCursor: 'pointer',
allowTouchScrolling: false
}),
});
define([
'lodash'
], function(
_
){
var Map = function(options){
this.options = options;
if(_.isFunction(this.initialize)){
this.initialize(options);
}
};
_.extend(Map.prototype, {
initialize: function(options){
this.main = options.main;
this.canvas = options.canvas;
this.app = options.app;
this.initializeEvents();
},
initializeEvents: function(){
this.addEvent(window, 'resize', _.bind(this.onWindowResize, this));
},
addEvent: function(element, event, callback){
},
renderPath: function(path){
},
center: function(){
},
onWindowResize: function(){
}
});
return Map;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment