Hi, everyone!
I am working on a GIS API, that uses OpenLayers. I initialize the map lke
this:
xgis.map = OpenLayers.Class(OpenLayers.Map, {
var mapOptions = {};
mapOptions.allOverlays = false;
/*
more mapOptions here
*/
OpenLayers.Map.prototype.initialize.apply(this, ['map',
mapOptions]);
});
Of course, I do this because I want to create my own methods, like this
one, for example.
xgis.map.prototype.zoom(action) {
switch(action) {
case 'in:
this.zoomIn(); // Uses the OpenLayers zoomIn method
break;
case 'out:
this.zoomOut(); // Uses the OpenLayers zoomOut method
break;
};
The problem is this 'zoom' method I created is not recognized as a function
(I get: number is not a function), because OpenLayers has a 'zoom' numeric
value where it stores the zoom.
Is there a way to use inheritance and access the parent's methods like this?
this.parent.zoomIn()
This would definitely fix the 'zoom' name problem.
Thanks.
João Rodrigues
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users