Demo Site

Sunday, July 20, 2008

Javascript Inheritance Notes

var mymaps = new ExtMyMapsControl();
function markerControl(){
var me = this;
me.a = "ere";
}
markerControl.prototype = new ExtMyMapsControl();
markerControl.prototype.constructor = markerControl;
markerControl.prototype.initialize = function(map){
var me = this;
me.container = mymaps.initialize.call(this,map);
me.container.id = "yeah!";
return me.container;
}

var mc = new markerControl();

mymaps.options.controlPosition = "changed";

console.log(map);
console.log(mymaps.initialize(map));
console.log(mc.initialize(map));

1 comment:

Labels

Labels

Labels