Locations.js
Summary
No overview generated for 'Locations.js'
mapbuilder.loadScript(baseDir+"/widget/WidgetBaseXSL.js");
function Locations(widgetNode, model) {
WidgetBaseXSL.apply(this,new Array(widgetNode, model));
this.setAoi = function(bbox, targetModel, srsName) {
var srsTokens = srsName.split(/[:#]/);
srsName = 'EPSG:'+srsTokens[srsTokens.length-1];
if (!srsName) {
srsName = 'EPSG:4326';
}
var proj = new OpenLayers.Projection(srsName);
var bboxArray = new Array();
bboxArray = bbox.split(",");
var ptUL=new OpenLayers.Geometry.Point(parseFloat(bboxArray[0]),parseFloat(bboxArray[3]));
var ptLR=new OpenLayers.Geometry.Point(parseFloat(bboxArray[2]),parseFloat(bboxArray[1]));
ptUL.transform(proj,this.targetModel.proj);
ptLR.transform(proj,this.targetModel.proj);
var ul = new Array(ptUL.x,ptUL.y);
var lr = new Array(ptLR.x,ptLR.y);
this.targetModel.setParam("aoi",new Array(ul,lr));
this.targetModel.map.zoomToExtent(new OpenLayers.Bounds(ul[0],lr[1],lr[0],ul[1]));
}
}
Documentation generated by
JSDoc on Sun Apr 27 20:30:54 2008