'+description+'
'; - } - var feature = new OpenLayers.Feature(this, location, data); - this.features.append(feature); - var marker = feature.createMarker(); - marker.events.register('click', feature, this.markerClick); - this.addMarker(marker); - } - } - } - } - }, - - /** - * @param {Event} evt - */ - markerClick: function(evt) { - sameMarkerClicked = (this == this.layer.selectedFeature); - this.layer.selectedFeature = (!sameMarkerClicked) ? this : null; - for(var i=0; i < this.layer.map.popups.length; i++) { - this.layer.map.removePopup(this.layer.map.popups[i]); - } - if (!sameMarkerClicked) { - this.layer.map.addPopup(this.createPopup()); - } - Event.stop(evt); - }, - - /** - * - */ - clearFeatures: function() { - if (this.features != null) { - while(this.features.length > 0) { - var feature = this.features[0]; - this.features.remove(feature); - feature.destroy(); - } - } - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Text" -}); - - diff --git a/public/lib/OpenLayers/Layer/VirtualEarth.js b/public/lib/OpenLayers/Layer/VirtualEarth.js deleted file mode 100644 index 19db24817..000000000 --- a/public/lib/OpenLayers/Layer/VirtualEarth.js +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Layer.js - -// load VE map control script -document.write(""); - - -/** - * @class - */ -OpenLayers.Layer.VirtualEarth = Class.create(); -OpenLayers.Layer.VirtualEarth.prototype = - Object.extend( new OpenLayers.Layer(), { - - /** @type Boolean */ - viewPortLayer: true, - - /** @type VEMap */ - vemap: null, - - /** - * @constructor - * - * @param {str} name - */ - initialize:function(name) { - OpenLayers.Layer.prototype.initialize.apply(this, arguments); - }, - - /** - * @param {OpenLayers.Map} map - */ - setMap:function(map) { - OpenLayers.Layer.prototype.setMap.apply(this, arguments); - - // once our layer has been added to the map, we can create the vemap - this.map.events.register("addlayer", this, this.loadVEMap); - }, - - /** Virtual Earth layer is always a base class. - * @type Boolean - */ - isBaseLayer: function() { - return true; - }, - - /** - * @param {OpenLayers.Bounds} bounds - * @param {int} zoomChanged - */ - moveTo:function(bounds,zoomChanged) { - - if (this.vemap != null) { - var olCenter = this.map.getCenter(); - var olZoom = this.map.getZoom(); - - this.vemap.SetCenterAndZoom(new VELatLong(olCenter.lat, olCenter.lon), - olZoom + 1); - } - }, - - - /** - * - */ - loadVEMap:function() { - // create div and set to same size as map - var veDiv = OpenLayers.Util.createDiv(this.name); - var sz = this.map.getSize(); - veDiv.style.width = sz.w; - veDiv.style.height = sz.h; - this.div.appendChild(veDiv); - - // create VEMap, hide nav controls - this.vemap = new VEMap(this.name); - this.vemap.LoadMap(); - this.vemap.HideDashboard(); - - // catch pans and zooms from VE Map - this.vemap.AttachEvent("onendcontinuouspan", - this.catchPanZoom.bindAsEventListener(this)); - this.vemap.AttachEvent("onendzoom", - this.catchPanZoom.bindAsEventListener(this)); - - - }, - - /** - * @param {event} e - */ - catchPanZoom: function(e) { - var veCenter = this.vemap.GetCenter(); - var veZoom = this.vemap.GetZoomLevel(); - - var olCenter = new OpenLayers.LonLat(veCenter.Longitude, - veCenter.Latitude); - - this.map.setCenter(olCenter, veZoom - 1); - - }, - - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Layer.VirtualEarth" -}); \ No newline at end of file diff --git a/public/lib/OpenLayers/Layer/WFS.js b/public/lib/OpenLayers/Layer/WFS.js deleted file mode 100644 index 6885b3024..000000000 --- a/public/lib/OpenLayers/Layer/WFS.js +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Layer/Grid.js -// @require: OpenLayers/Layer/Markers.js -/** -* @class -*/ -OpenLayers.Layer.WFS = Class.create(); -OpenLayers.Layer.WFS.prototype = - Object.extend(new OpenLayers.Layer.Grid(), - Object.extend(new OpenLayers.Layer.Markers(), { - - /** @type Object */ - featureClass: OpenLayers.Feature.WFS, - - /** @final @type hash */ - DEFAULT_PARAMS: { service: "WFS", - version: "1.0.0", - request: "GetFeature", - typename: "docpoint" - }, - - /** - * @constructor - * - * @param {str} name - * @param {str} url - * @param {hash} params - * @param {Object} featureClass - */ - initialize: function(name, url, params, featureClass) { - if (featureClass != null) this.featureClass = featureClass; - - var newArguments = new Array(); - if (arguments.length > 0) { - //uppercase params - params = OpenLayers.Util.upperCaseObject(params); - newArguments.push(name, url, params); - } - OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); - OpenLayers.Layer.Markers.prototype.initialize.apply(this, newArguments); - - if (arguments.length > 0) { - OpenLayers.Util.applyDefaults( - this.params, - OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) - ); - } - }, - - - /** - * - */ - destroy: function() { - OpenLayers.Layer.Grid.prototype.destroy.apply(this, arguments); - OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments); - }, - - /** - * @param {OpenLayers.Bounds} bounds - * @param {Boolean} zoomChanged - */ - moveTo: function(bounds, zoomChanged) { - OpenLayers.Layer.Grid.prototype.moveTo.apply(this, arguments); - OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); - }, - - /** WFS layer is never a base class. - * @type Boolean - */ - isBaseLayer: function() { - return false; - }, - - /** - * @param {String} name - * @param {hash} params - * - * @returns A clone of this OpenLayers.Layer.WMS, with the passed-in - * parameters merged in. - * @type OpenLayers.Layer.WMS - */ - clone: function (name, params) { - var mergedParams = {} - Object.extend(mergedParams, this.params); - Object.extend(mergedParams, params); - var obj = new OpenLayers.Layer.WFS(name, this.url, mergedParams); - obj.setTileSize(this.tileSize); - return obj; - }, - - /** - * addTile creates a tile, initializes it (via 'draw' in this case), and - * adds it to the layer div. - * - * @param {OpenLayers.Bounds} bounds - * - * @returns The added OpenLayers.Tile.WFS - * @type OpenLayers.Tile.WFS - */ - addTile:function(bounds, position) { - url = this.getFullRequestString( - { BBOX:bounds.toBBOX() }); - - return new OpenLayers.Tile.WFS(this, position, bounds, - url, this.tileSize); - }, - - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Layer.WFS" -} -) -); diff --git a/public/lib/OpenLayers/Layer/WMS.js b/public/lib/OpenLayers/Layer/WMS.js deleted file mode 100644 index d0e21f7f5..000000000 --- a/public/lib/OpenLayers/Layer/WMS.js +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Layer/Grid.js -/** -* @class -*/ -OpenLayers.Layer.WMS = Class.create(); -OpenLayers.Layer.WMS.prototype = - Object.extend( new OpenLayers.Layer.Grid(), { - - /** @final @type hash */ - DEFAULT_PARAMS: { service: "WMS", - version: "1.1.1", - request: "GetMap", - styles: "", - exceptions: "application/vnd.ogc.se_inimage", - format: "image/jpeg" - }, - - /** - * @constructor - * - * @param {str} name - * @param {str} url - * @param {hash} params - */ - initialize: function(name, url, params) { - var newArguments = new Array(); - if (arguments.length > 0) { - //uppercase params - params = OpenLayers.Util.upperCaseObject(params); - newArguments.push(name, url, params); - } - OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); - - if (arguments.length > 0) { - OpenLayers.Util.applyDefaults( - this.params, - OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) - ); - } - }, - - - /** WFS layer is never a base class. - * @type Boolean - */ - isBaseLayer: function() { - return (this.params.TRANSPARENT != 'true'); - }, - - /** - * @param {String} name - * @param {hash} params - * - * @returns A clone of this OpenLayers.Layer.WMS, with the passed-in - * parameters merged in. - * @type OpenLayers.Layer.WMS - */ - clone: function (name, params) { - var mergedParams = {}; - Object.extend(mergedParams, this.params); - Object.extend(mergedParams, params); - var obj = new OpenLayers.Layer.WMS(name, this.url, mergedParams); - obj.setTileSize(this.tileSize); - return obj; - }, - - /** - * addTile creates a tile, initializes it (via 'draw' in this case), and - * adds it to the layer div. - * - * @param {OpenLayers.Bounds} bounds - * - * @returns The added OpenLayers.Tile.Image - * @type OpenLayers.Tile.Image - */ - addTile:function(bounds,position) { - url = this.getFullRequestString( - {BBOX:bounds.toBBOX(), - WIDTH:this.tileSize.w, - HEIGHT:this.tileSize.h}); - - return new OpenLayers.Tile.Image(this, position, bounds, - url, this.tileSize); - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Layer.WMS" -}); diff --git a/public/lib/OpenLayers/Layer/WMS/Untiled.js b/public/lib/OpenLayers/Layer/WMS/Untiled.js deleted file mode 100644 index 4486c4f02..000000000 --- a/public/lib/OpenLayers/Layer/WMS/Untiled.js +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Layer/Grid.js -/** -* @class -*/ -OpenLayers.Layer.WMS.Untiled = Class.create(); -OpenLayers.Layer.WMS.Untiled.prototype = - Object.extend( new OpenLayers.Layer.Grid(), { - - /** @final @type hash */ - DEFAULT_PARAMS: { service: "WMS", - version: "1.1.1", - request: "GetMap", - styles: "", - exceptions: "application/vnd.ogc.se_inimage", - format: "image/jpeg" - }, - - /** - * @constructor - * - * @param {str} name - * @param {str} url - * @param {hash} params - */ - initialize: function(name, url, params) { - var newArguments = new Array(); - if (arguments.length > 0) { - //uppercase params - params = OpenLayers.Util.upperCaseObject(params); - newArguments.push(name, url, params); - } - OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments); - - if (arguments.length > 0) { - OpenLayers.Util.applyDefaults( - this.params, - OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS) - ); - } - }, - - - /** WFS layer is never a base class. - * @type Boolean - */ - isBaseLayer: function() { - return (this.params.TRANSPARENT != true); - }, - - /** - * @param {String} name - * @param {hash} params - * - * @returns A clone of this OpenLayers.Layer.WMS, with the passed-in - * parameters merged in. - * @type OpenLayers.Layer.WMS - */ - clone: function (name, params) { - var mergedParams = {}; - Object.extend(mergedParams, this.params); - Object.extend(mergedParams, params); - var obj = new OpenLayers.Layer.WMS(name, this.url, mergedParams); - obj.setTileSize(this.tileSize); - return obj; - }, - - /** - * addTile creates a tile, initializes it (via 'draw' in this case), and - * adds it to the layer div. - * - * @param {OpenLayers.Bounds} bounds - * - * @returns The added OpenLayers.Tile.Image - * @type OpenLayers.Tile.Image - */ - addTile:function(bounds,position) { - url = this.getFullRequestString( - {BBOX:bounds.toBBOX(), - WIDTH:this.map.getSize().w, - HEIGHT:this.map.getSize().h}); - - return new OpenLayers.Tile.Image(this, position, bounds, - url, this.map.getSize()); - }, - moveTo:function(bounds,zoomChanged, minor) { - if (!minor) { - this.div.innerHTML = ""; - tile = this.addTile(bounds, new OpenLayers.Pixel(-parseInt(this.map.layerContainerDiv.style.left), -parseInt(this.map.layerContainerDiv.style.top))); - tile.draw(); - } - }, - /** @final @type String */ - CLASS_NAME: "OpenLayers.Layer.WMS.Untiled" -}); diff --git a/public/lib/OpenLayers/Layer/Yahoo.js b/public/lib/OpenLayers/Layer/Yahoo.js deleted file mode 100644 index eb9fab728..000000000 --- a/public/lib/OpenLayers/Layer/Yahoo.js +++ /dev/null @@ -1,149 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Layer.js - -// load Yahoo map control script -document.write(""); - -/** - * @class - */ -OpenLayers.Layer.Yahoo = Class.create(); -OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), { - - /** @type Boolean */ - viewPortLayer: true, - - /** @type GMap2 gmap stores the Google Map element */ - ymap:null, - - /** @type Boolean */ - dragging:false, - - /** - * @constructor - * - * @param {String} name - */ - initialize: function(name) { - OpenLayers.Layer.prototype.initialize.apply(this, [name]); - }, - - /** - * @param {OpenLayers.Map} map - */ - setMap:function(map) { - OpenLayers.Layer.prototype.setMap.apply(this, arguments); - - // once our layer has been added to the map, we can create the vemap - this.map.events.register("addlayer", this, this.loadYMap); - }, - - /** Yahoo layer is always a base class. - * @type Boolean - */ - isBaseLayer: function() { - return true; - }, - - /** - * @param {OpenLayers.Bounds} bounds - * @param {int} zoomChanged - */ - moveTo:function(bounds,zoomChanged) { - - if ((this.ymap != null) && (!this.dragging)) { - - var olCenter = this.map.getCenter(); - var yCenter = this.getYMapCenter(); - - var olZoom = this.map.getZoom(); - var yZoom = this.ymap.getZoomLevel(); - - if ((!olCenter.equals(yCenter)) || (( 16 - olZoom) != yZoom)) { - this.ymap.drawZoomAndCenter(new YGeoPoint(olCenter.lat, olCenter.lon), - 16 - olZoom); - } - } - }, - - /** - * - */ - loadYMap:function() { - // create div and set to same size as map - var yDiv = OpenLayers.Util.createDiv(this.name); - var sz = this.map.getSize(); - yDiv.style.width = sz.w; - yDiv.style.height = sz.h; - this.div.appendChild(yDiv); - - // create GMap, hide nav controls - this.ymap = new YMap(this.div); - - // catch pans and zooms from GMap - YEvent.Capture(this.ymap, - EventsList.endPan, - this.catchPanZoom, - this); - - // catch pans and zooms from GMap - YEvent.Capture(this.ymap, - EventsList.endAutoPan, - this.catchPanZoom, - this); - - - // attach to the drag start and end and we´ll set a flag so that - // we dont get recursivity. this is because the events fall through - // the gmaps div and into the main layer div - YEvent.Capture(this.ymap, - EventsList.startPan, - this.dragStart, - this); - - }, - - /** - * @private - */ - dragStart: function() { - this.dragging = true; - }, - - /** - * @private - * - * @param {event} e - */ - catchPanZoom: function(e) { - this.dragging = false; - - var olCenter = this.getYMapCenter(); - var yZoom = this.ymap.getZoomLevel(); - - this.map.setCenter(olCenter, 16 - yZoom); - - }, - - /** - * @private - * - * @returns An OpenLayers.LonLat with the center of the ymap, or null if - * the YMap has not been centered yet - * @type OpenLayers.LonLat - */ - getYMapCenter:function() { - var olCenter = null; - var yCenter = this.ymap.getCenterLatLon(); - if (yCenter != null) { - olCenter = new OpenLayers.LonLat(yCenter.Lon, yCenter.Lat); - } - return olCenter; - }, - - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Layer.Yahoo" -}); diff --git a/public/lib/OpenLayers/Map.js b/public/lib/OpenLayers/Map.js deleted file mode 100644 index 259175714..000000000 --- a/public/lib/OpenLayers/Map.js +++ /dev/null @@ -1,574 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Util.js -/** -* @class -* -* -*/ - -OpenLayers.Map = Class.create(); -OpenLayers.Map.prototype = { - // Hash: base z-indexes for different classes of thing - Z_INDEX_BASE: { Layer: 100, Popup: 200, Control: 1000 }, - - // Array: supported application event types - EVENT_TYPES: [ - "addlayer", "removelayer", "movestart", "move", "moveend", - "zoomend", "layerchanged", "popupopen", "popupclose", - "addmarker", "removemarker", "clearmarkers", "mouseover", - "mouseout", "mousemove", "dragstart", "drag", "dragend" ], - - // int: zoom levels, used to draw zoom dragging control and limit zooming - maxZoomLevel: 16, - - // OpenLayers.Bounds - maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), - - /* projection */ - projection: "EPSG:4326", - - /** @type OpenLayers.Size */ - size: null, - - // float - maxResolution: 1.40625, // degrees per pixel - // Default is whole world in 256 pixels, from GMaps - - // DOMElement: the div that our map lives in - div: null, - - // HTMLDivElement: the map's view port - viewPortDiv: null, - - // HTMLDivElement: the map's layer container - layerContainerDiv: null, - - // Array(OpenLayers.Layer): ordered list of layers in the map - layers: null, - - // Array(OpenLayers.Control) - controls: null, - - // Array(OpenLayers.Popup) - popups: null, - - // OpenLayers.LonLat - center: null, - - // int - zoom: null, - - // OpenLayers.Events - events: null, - - // OpenLayers.Pixel - mouseDragStart: null, - - /** @type OpenLayers.Layer */ - baseLayer: null, - - /** - * @param {DOMElement} div - */ - initialize: function (div, options) { - Object.extend(this, options); - - this.div = div = $(div); - - // the viewPortDiv is the outermost div we modify - var id = div.id + "_OpenLayers_ViewPort"; - this.viewPortDiv = OpenLayers.Util.createDiv(id, null, null, null, - "relative", null, - "hidden"); - this.viewPortDiv.style.width = "100%"; - this.viewPortDiv.style.height = "100%"; - this.div.appendChild(this.viewPortDiv); - - // the layerContainerDiv is the one that holds all the layers - id = div.id + "_OpenLayers_Container"; - this.layerContainerDiv = OpenLayers.Util.createDiv(id); - this.viewPortDiv.appendChild(this.layerContainerDiv); - - this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES); - - this.updateSize(); - // make the entire maxExtent fix in zoom level 0 by default - if (this.maxResolution == null || this.maxResolution == "auto") { - this.maxResolution = Math.max( - this.maxExtent.getWidth() / this.size.w, - this.maxExtent.getHeight() / this.size.h ); - } - // update the internal size register whenever the div is resized - this.events.register("resize", this, this.updateSize); - - this.layers = []; - - if (!this.controls) { - this.controls = []; - this.addControl(new OpenLayers.Control.MouseDefaults()); - this.addControl(new OpenLayers.Control.PanZoom()); - } - - this.popups = new Array(); - - // always call map.destroy() - Event.observe(window, 'unload', - this.destroy.bindAsEventListener(this)); - }, - - /** - * @private - */ - destroy:function() { - if (this.layers != null) { - for(var i=0; i< this.layers.length; i++) { - this.layers[i].destroy(); - } - this.layers = null; - } - if (this.controls != null) { - for(var i=0; i< this.controls.length; i++) { - this.controls[i].destroy(); - } - this.controls = null; - } - }, - - /** - * @param {OpenLayers.Layer} layer - */ - addLayer: function (layer) { - layer.setMap(this); - layer.div.style.overflow = ""; - layer.div.style.zIndex = this.Z_INDEX_BASE['Layer'] + this.layers.length; - - if (layer.viewPortLayer) { - this.viewPortDiv.appendChild(layer.div); - } else { - this.layerContainerDiv.appendChild(layer.div); - } - this.layers.push(layer); - - // hack hack hack - until we add a more robust layer switcher, - // which is able to determine which layers are base layers and - // which are not (and put baselayers in a radiobutton group and - // other layers in checkboxes) this seems to be the most straight- - // forward way of dealing with this. - // - if (layer.isBaseLayer()) { - this.baseLayer = layer; - } - this.events.triggerEvent("addlayer"); - }, - - /** Removes a layer from the map by removing its visual element (the - * layer.div property), then removing it from the map's internal list - * of layers, setting the layer's map property to null. - * - * a "removelayer" event is triggered. - * - * very worthy of mention is that simply removing a layer from a map - * will not cause the removal of any popups which may have been created - * by the layer. this is due to the fact that it was decided at some - * point that popups would not belong to layers. thus there is no way - * for us to know here to which layer the popup belongs. - * - * A simple solution to this is simply to call destroy() on the layer. - * the default OpenLayers.Layer class's destroy() function - * automatically takes care to remove itself from whatever map it has - * been attached to. - * - * The correct solution is for the layer itself to register an - * event-handler on "removelayer" and when it is called, if it - * recognizes itself as the layer being removed, then it cycles through - * its own personal list of popups, removing them from the map. - * - * @param {OpenLayers.Layer} layer - */ - removeLayer: function(layer) { - this.layerContainerDiv.removeChild(layer.div); - this.layers.remove(layer); - layer.map = null; - this.events.triggerEvent("removelayer"); - }, - - /** - * @param {Array(OpenLayers.Layer)} layers - */ - addLayers: function (layers) { - for (var i = 0; i < layers.length; i++) { - this.addLayer(layers[i]); - } - }, - - /** - * @param {OpenLayers.Control} control - * @param {OpenLayers.Pixel} px - */ - addControl: function (control, px) { - control.map = this; - this.controls.push(control); - var div = control.draw(px); - if (div) { - div.style.zIndex = this.Z_INDEX_BASE['Control'] + - this.controls.length; - this.viewPortDiv.appendChild( div ); - } - }, - - /** - * @param {OpenLayers.Popup} popup - */ - addPopup: function(popup) { - popup.map = this; - this.popups.push(popup); - var popupDiv = popup.draw(); - if (popupDiv) { - popupDiv.style.zIndex = this.Z_INDEX_BASE['Popup'] + - this.popups.length; - this.layerContainerDiv.appendChild(popupDiv); - } - }, - - /** - * @param {OpenLayers.Popup} popup - */ - removePopup: function(popup) { - this.popups.remove(popup); - if (popup.div) { - this.layerContainerDiv.removeChild(popup.div); - } - popup.map = null; - }, - - /** - * @return {float} - */ - getResolution: function () { - // return degrees per pixel - return this.maxResolution / Math.pow(2, this.zoom); - }, - - /** - * @return {int} - */ - getZoom: function () { - return this.zoom; - }, - - /** - * @returns {OpenLayers.Size} - */ - getSize: function () { - return this.size; - }, - - /** - * @private - */ - updateSize: function() { - this.size = new OpenLayers.Size( - this.div.clientWidth, this.div.clientHeight); - this.events.div.offsets = null; - // Workaround for the fact that hidden elements return 0 for size. - if (this.size.w == 0 && this.size.h == 0) { - var dim = Element.getDimensions(this.div); - this.size.w = dim.width; - this.size.h = dim.height; - } - if (this.size.w == 0 && this.size.h == 0) { - this.size.w = parseInt(this.div.style.width); - this.size.h = parseInt(this.div.style.height); - } - }, - - /** - * @return {OpenLayers.LonLat} - */ - getCenter: function () { - return this.center; - }, - - /** - * @return {OpenLayers.Bounds} - */ - getExtent: function () { - if (this.center) { - var res = this.getResolution(); - var size = this.getSize(); - var w_deg = size.w * res; - var h_deg = size.h * res; - return new OpenLayers.Bounds( - this.center.lon - w_deg / 2, - this.center.lat - h_deg / 2, - this.center.lon + w_deg / 2, - this.center.lat + h_deg / 2); - } else { - return null; - } - }, - - /** - * @return {OpenLayers.Bounds} - */ - getFullExtent: function () { - return this.maxExtent; - }, - - getZoomLevels: function() { - return this.maxZoomLevel; - }, - - /** - * @param {OpenLayers.Bounds} bounds - * - * @return {int} - */ - getZoomForExtent: function (bounds) { - var size = this.getSize(); - var width = bounds.getWidth(); - var height = bounds.getHeight(); - var deg_per_pixel = (width > height ? width / size.w : height / size.h); - var zoom = Math.log(this.maxResolution / deg_per_pixel) / Math.log(2); - return Math.floor(Math.min(Math.max(zoom, 0), this.getZoomLevels())); - }, - - /** - * @param {OpenLayers.Pixel} layerPx - * - * @returns px translated into view port pixel coordinates - * @type OpenLayers.Pixel - * @private - */ - getViewPortPxFromLayerPx:function(layerPx) { - var viewPortPx = layerPx.copyOf(); - - viewPortPx.x += parseInt(this.layerContainerDiv.style.left); - viewPortPx.y += parseInt(this.layerContainerDiv.style.top); - - return viewPortPx; - }, - - /** - * @param {OpenLayers.Pixel} viewPortPx - * - * @returns px translated into view port pixel coordinates - * @type OpenLayers.Pixel - * @private - */ - getLayerPxFromViewPortPx:function(viewPortPx) { - var layerPx = viewPortPx.copyOf(); - - layerPx.x -= parseInt(this.layerContainerDiv.style.left); - layerPx.y -= parseInt(this.layerContainerDiv.style.top); - - return layerPx; - }, - - - /** - * @param {OpenLayers.Pixel} px - * - * @return {OpenLayers.LonLat} - */ - getLonLatFromLayerPx: function (px) { - //adjust for displacement of layerContainerDiv - px = this.getViewPortPxFromLayerPx(px); - return this.getLonLatFromViewPortPx(px); - }, - - /** - * @param {OpenLayers.Pixel} viewPortPx - * - * @returns An OpenLayers.LonLat which is the passed-in view port - * OpenLayers.Pixel, translated into lon/lat given the - * current extent and resolution - * @type OpenLayers.LonLat - * @private - */ - getLonLatFromViewPortPx: function (viewPortPx) { - var center = this.getCenter(); //map center lon/lat - var res = this.getResolution(); - var size = this.getSize(); - - var delta_x = viewPortPx.x - (size.w / 2); - var delta_y = viewPortPx.y - (size.h / 2); - - return new OpenLayers.LonLat(center.lon + delta_x * res , - center.lat - delta_y * res); - }, - - // getLonLatFromPixel is a convenience function for the API - /** - * @param {OpenLayers.Pixel} pixel - * - * @returns An OpenLayers.LonLat corresponding to the given - * OpenLayers.Pixel, translated into lon/lat using the - * current extent and resolution - * @type OpenLayers.LonLat - */ - getLonLatFromPixel: function (px) { - return this.getLonLatFromViewPortPx(px); - }, - - /** - * @param {OpenLayers.LonLat} lonlat - * - * @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, - * translated into layer pixels given the current extent - * and resolution - * @type OpenLayers.Pixel - */ - getLayerPxFromLonLat: function (lonlat) { - //adjust for displacement of layerContainerDiv - var px = this.getViewPortPxFromLonLat(lonlat); - return this.getLayerPxFromViewPortPx(px); - }, - - /** - * @param {OpenLayers.LonLat} lonlat - * - * @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, - * translated into view port pixels given the current extent - * and resolution - * @type OpenLayers.Pixel - * @private - */ - getViewPortPxFromLonLat: function (lonlat) { - var resolution = this.getResolution(); - var extent = this.getExtent(); - return new OpenLayers.Pixel( - Math.round(1/resolution * (lonlat.lon - extent.left)), - Math.round(1/resolution * (extent.top - lonlat.lat)) - ); - }, - - // getLonLatFromPixel is a convenience function for the API - /** - * @param {OpenLayers.LonLat} lonlat - * - * @returns An OpenLayers.Pixel corresponding to the OpenLayers.LonLat - * translated into view port pixels using the current extent - * and resolution - * @type OpenLayers.Pixel - */ - getPixelFromLonLat: function (lonlat) { - return this.getViewPortPxFromLonLat(lonlat); - }, - - /** - * @param {OpenLayers.LonLat} lonlat - * @param {int} zoom - */ - setCenter: function (lonlat, zoom, minor) { - if (this.center) { // otherwise there's nothing to move yet - this.moveLayerContainer(lonlat); - } - this.center = lonlat.copyOf(); - var zoomChanged = null; - if (zoom != null && zoom != this.zoom - && zoom >= 0 && zoom <= this.getZoomLevels()) { - zoomChanged = (this.zoom == null ? 0 : this.zoom); - this.zoom = zoom; - } - - if (!minor) this.events.triggerEvent("movestart"); - this.moveToNewExtent(zoomChanged, minor); - if (!minor) this.events.triggerEvent("moveend"); - }, - - /** - * ZOOM TO BOUNDS FUNCTION - * @private - */ - moveToNewExtent: function (zoomChanged, minor) { - if (zoomChanged != null) { // reset the layerContainerDiv's location - this.layerContainerDiv.style.left = "0px"; - this.layerContainerDiv.style.top = "0px"; - - //redraw popups - for (var i = 0; i < this.popups.length; i++) { - this.popups[i].updatePosition(); - } - - } - var bounds = this.getExtent(); - for (var i = 0; i < this.layers.length; i++) { - this.layers[i].moveTo(bounds, (zoomChanged != null), minor); - } - this.events.triggerEvent("move"); - if (zoomChanged != null) - this.events.triggerEvent("zoomend", - {oldZoom: zoomChanged, newZoom: this.zoom}); - }, - - /** - * zoomIn - * Increase zoom level by one. - * @param {int} zoom - */ - zoomIn: function() { - if (this.zoom != null && this.zoom <= this.getZoomLevels()) { - this.zoomTo( this.zoom += 1 ); - } - }, - - /** - * zoomTo - * Set Zoom To int - * @param {int} zoom - */ - zoomTo: function(zoom) { - if (zoom >= 0 && zoom <= this.getZoomLevels()) { - var oldZoom = this.zoom; - this.zoom = zoom; - this.moveToNewExtent(oldZoom); - } - }, - - /** - * zoomOut - * Decrease zoom level by one. - * @param {int} zoom - */ - zoomOut: function() { - if (this.zoom != null && this.zoom > 0) { - this.zoomTo( this.zoom - 1 ); - } - }, - - /** - * zoomToFullExtent - * Zoom to the full extent and recenter. - */ - zoomToFullExtent: function() { - var fullExtent = this.getFullExtent(); - this.setCenter( - new OpenLayers.LonLat((fullExtent.left+fullExtent.right)/2, - (fullExtent.bottom+fullExtent.top)/2), - this.getZoomForExtent(fullExtent) - ); - }, - - /** - * @param {OpenLayers.LonLat} lonlat - * @private - */ - moveLayerContainer: function (lonlat) { - var container = this.layerContainerDiv; - var resolution = this.getResolution(); - - var deltaX = Math.round((this.center.lon - lonlat.lon) / resolution); - var deltaY = Math.round((this.center.lat - lonlat.lat) / resolution); - - var offsetLeft = parseInt(container.style.left); - var offsetTop = parseInt(container.style.top); - - container.style.left = (offsetLeft + deltaX) + "px"; - container.style.top = (offsetTop - deltaY) + "px"; - }, - - CLASS_NAME: "OpenLayers.Map" -}; diff --git a/public/lib/OpenLayers/Marker.js b/public/lib/OpenLayers/Marker.js deleted file mode 100644 index 0640295d7..000000000 --- a/public/lib/OpenLayers/Marker.js +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -/** -* @class -*/ -OpenLayers.Marker = Class.create(); -OpenLayers.Marker.prototype = { - - /** @type OpenLayers.Icon */ - icon: null, - - /** location of object - * @type OpenLayers.LonLat */ - lonlat: null, - - /** @type OpenLayers.Events*/ - events: null, - - /** @type OpenLayers.Map */ - map: null, - - /** - * @constructor - * - * @param {OpenLayers.Icon} icon - * @param {OpenLayers.LonLat lonlat - */ - initialize: function(lonlat, icon) { - this.lonlat = lonlat; - this.icon = (icon) ? icon : OpenLayers.Marker.defaultIcon(); - - this.events = new OpenLayers.Events(this, this.icon.imageDiv, null); - }, - - destroy: function() { - this.map = null; - - if (this.icon != null) { - this.icon.destroy(); - this.icon = null; - } - }, - - /** - * @param {OpenLayers.Pixel} px - * - * @return A new DOM Image with this marker´s icon set at the - * location passed-in - * @type DOMElement - */ - draw: function(px) { - return this.icon.draw(px); - }, - - /** - * @param {OpenLayers.Pixel} px - */ - moveTo: function (px) { - if ((px != null) && (this.icon != null)) { - this.icon.moveTo(px); - } - }, - - /** - * @returns Whether or not the marker is currently visible on screen. - * @type Boolean - */ - onScreen:function() { - - var onScreen = false; - if (this.map) { - var screenBounds = this.map.getExtent(); - onScreen = screenBounds.contains(this.lonlat.lon, this.lonlat.lat); - } - return onScreen; - }, - - /** - * @param {float} inflate - */ - inflate: function(inflate) { - if (this.icon) { - var newSize = new OpenLayers.Size(this.icon.size.w * inflate, - this.icon.size.h * inflate); - this.icon.setSize(newSize); - } - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Marker" -}; - - -/** - * @returns A default OpenLayers.Icon to use for a marker - * @type OpenLayers.Icon - */ -OpenLayers.Marker.defaultIcon = function() { - var url = OpenLayers.Util.getImagesLocation() + "marker.png"; - var size = new OpenLayers.Size(21, 25); - var calculateOffset = function(size) { - return new OpenLayers.Pixel(-(size.w/2), -size.h); - }; - - return new OpenLayers.Icon(url, size, null, calculateOffset); -}; - - diff --git a/public/lib/OpenLayers/Popup.js b/public/lib/OpenLayers/Popup.js deleted file mode 100644 index 1491109c5..000000000 --- a/public/lib/OpenLayers/Popup.js +++ /dev/null @@ -1,232 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -/** -* @class -*/ -OpenLayers.Popup = Class.create(); - -OpenLayers.Popup.count = 0; -OpenLayers.Popup.WIDTH = 200; -OpenLayers.Popup.HEIGHT = 200; -OpenLayers.Popup.COLOR = "white"; -OpenLayers.Popup.OPACITY = 1; -OpenLayers.Popup.BORDER = "0px"; - -OpenLayers.Popup.prototype = { - - /** @type OpenLayers.Events*/ - events: null, - - /** @type String */ - id: "", - - /** @type OpenLayers.LonLat */ - lonlat: null, - - /** @type DOMElement */ - div: null, - - /** @type OpenLayers.Size*/ - size: null, - - /** @type String */ - contentHTML: "", - - /** @type String */ - backgroundColor: "", - - /** @type float */ - opacity: "", - - /** @type String */ - border: "", - - /** this gets set in Map.js when the popup is added to the map - * @type OpenLayers.Map */ - map: null, - - /** - * @constructor - * - * @param {String} id - * @param {OpenLayers.LonLat} lonlat - * @param {OpenLayers.Size} size - * @param {String} contentHTML - */ - initialize:function(id, lonlat, size, contentHTML) { - OpenLayers.Popup.count += 1; - this.id = (id != null) ? id : "Popup" + OpenLayers.Popup.count; - this.lonlat = lonlat; - this.size = (size != null) ? size - : new OpenLayers.Size( - OpenLayers.Popup.WIDTH, - OpenLayers.Popup.HEIGHT); - if (contentHTML != null) { - this.contentHTML = contentHTML; - } - this.backgroundColor = OpenLayers.Popup.COLOR; - this.opacity = OpenLayers.Popup.OPACITY; - this.border = OpenLayers.Popup.BORDER; - - this.div = OpenLayers.Util.createDiv(this.id + "_div", null, null, - null, null, null, "hidden"); - - this.events = new OpenLayers.Events(this, this.div, null); - }, - - /** - */ - destroy: function() { - if (this.map != null) { - this.map.removePopup(this); - } - this.div = null; - this.map = null; - }, - - /** - * @param {OpenLayers.Pixel} px - * - * @returns Reference to a div that contains the drawn popup - * @type DOMElement - */ - draw: function(px) { - if (px == null) { - if ((this.lonlat != null) && (this.map != null)) { - px = this.map.getLayerPxFromLonLat(this.lonlat); - } - } - - this.setSize(); - this.setBackgroundColor(); - this.setOpacity(); - this.setBorder(); - this.setContentHTML(); - this.moveTo(px); - - return this.div; - }, - - /** - * if the popup has a lonlat and its map members set, - * then have it move itself to its proper position - */ - updatePosition: function() { - if ((this.lonlat) && (this.map)) { - var px = this.map.getLayerPxFromLonLat(this.lonlat); - this.moveTo(px); - } - }, - - /** - * @param {OpenLayers.Pixel} px - */ - moveTo: function(px) { - if ((px != null) && (this.div != null)) { - this.div.style.left = px.x + "px"; - this.div.style.top = px.y + "px"; - } - }, - - /** - * @returns Boolean indicating whether or not the popup is visible - * @type Boolean - */ - visible: function() { - return Element.visible(this.div); - }, - - /** - * - */ - toggle: function() { - Element.toggle(this.div); - }, - - /** - * - */ - show: function() { - Element.show(this.div); - }, - - /** - * - */ - hide: function() { - Element.hide(this.div); - }, - - /** - * @param {OpenLayers.Size} size - */ - setSize:function(size) { - if (size != undefined) { - this.size = size; - } - - if (this.div != null) { - this.div.style.width = this.size.w; - this.div.style.height = this.size.h; - } - }, - - /** - * @param {String} color - */ - setBackgroundColor:function(color) { - if (color != undefined) { - this.backgroundColor = color; - } - - if (this.div != null) { - this.div.style.backgroundColor = this.backgroundColor; - } - }, - - /** - * @param {float} opacity - */ - setOpacity:function(opacity) { - if (opacity != undefined) { - this.opacity = opacity; - } - - if (this.div != null) { - // for Mozilla and Safari - this.div.style.opacity = this.opacity; - - // for IE - this.div.style.filter = 'alpha(opacity=' + this.opacity*100 + ')'; - } - }, - - /** - * @param {int} border - */ - setBorder:function(border) { - if (border != undefined) { - this.border = border; - } - - if (this.div != null) { - this.div.style.border = this.border; - } - }, - - /** - * @param {String} contentHTML - */ - setContentHTML:function(contentHTML) { - if (contentHTML != null) { - this.contentHTML = contentHTML; - } - - if (this.div != null) { - this.div.innerHTML = this.contentHTML; - } - }, - - CLASS_NAME: "OpenLayers.Popup" -}; diff --git a/public/lib/OpenLayers/Popup/Anchored.js b/public/lib/OpenLayers/Popup/Anchored.js deleted file mode 100644 index 90db91279..000000000 --- a/public/lib/OpenLayers/Popup/Anchored.js +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Popup.js - -/** -* @class -*/ -OpenLayers.Popup.Anchored = Class.create(); -OpenLayers.Popup.Anchored.prototype = - Object.extend( new OpenLayers.Popup(), { - - /** "lr", "ll", "tr", "tl" - relative position of the popup. - * @type String */ - relativePosition: null, - - /** Object which must have expose a 'size' (OpenLayers.Size) and - * 'offset' (OpenLayers.Pixel) - * @type Object */ - anchor: null, - - /** - * @constructor - * - * @param {String} id - * @param {OpenLayers.LonLat} lonlat - * @param {OpenLayers.Size} size - * @param {String} contentHTML - * @param {Object} anchor Object which must expose a - * - 'size' (OpenLayers.Size) and - * - 'offset' (OpenLayers.Pixel) - * (this is generally an OpenLayers.Icon) - */ - initialize:function(id, lonlat, size, contentHTML, anchor) { - var newArguments = new Array(id, lonlat, size, contentHTML); - OpenLayers.Popup.prototype.initialize.apply(this, newArguments); - - this.anchor = (anchor != null) ? anchor - : { size: new OpenLayers.Size(0,0), - offset: new OpenLayers.Pixel(0,0)}; - }, - - /** - * @param {OpenLayers.Pixel} px - * - * @returns Reference to a div that contains the drawn popup - * @type DOMElement - */ - draw: function(px) { - if (px == null) { - if ((this.lonlat != null) && (this.map != null)) { - px = this.map.getLayerPxFromLonLat(this.lonlat); - } - } - - //calculate relative position - this.relativePosition = this.calculateRelativePosition(px); - - return OpenLayers.Popup.prototype.draw.apply(this, arguments); - }, - - /** - * @private - * - * @param {OpenLayers.Pixel} px - * - * @returns The relative position ("br" "tr" "tl "bl") at which the popup - * should be placed - * @type String - */ - calculateRelativePosition:function(px) { - var lonlat = this.map.getLonLatFromLayerPx(px); - - var extent = this.map.getExtent(); - var quadrant = extent.determineQuadrant(lonlat); - - return OpenLayers.Bounds.oppositeQuadrant(quadrant); - }, - - /** - * @param {OpenLayers.Pixel} px - */ - moveTo: function(px) { - - var newPx = this.calculateNewPx(px); - - var newArguments = new Array(newPx); - OpenLayers.Popup.prototype.moveTo.apply(this, newArguments); - }, - - /** - * @param {OpenLayers.Size} size - */ - setSize:function(size) { - OpenLayers.Popup.prototype.setSize.apply(this, arguments); - - if ((this.lonlat) && (this.map)) { - var px = this.map.getLayerPxFromLonLat(this.lonlat); - this.moveTo(px); - } - }, - - /** - * @private - * - * @param {OpenLayers.Pixel} px - * - * @returns The the new px position of the popup on the screen - * relative to the passed-in px - * @type OpenLayers.Pixel - */ - calculateNewPx:function(px) { - var newPx = px.offset(this.anchor.offset); - - var top = (this.relativePosition.charAt(0) == 't'); - newPx.y += (top) ? -this.size.h : this.anchor.size.h; - - var left = (this.relativePosition.charAt(1) == 'l'); - newPx.x += (left) ? -this.size.w : this.anchor.size.w; - - return newPx; - }, - - CLASS_NAME: "OpenLayers.Popup.Anchored" -}); diff --git a/public/lib/OpenLayers/Popup/AnchoredBubble.js b/public/lib/OpenLayers/Popup/AnchoredBubble.js deleted file mode 100644 index 352086dbd..000000000 --- a/public/lib/OpenLayers/Popup/AnchoredBubble.js +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Popup/Anchored.js - -/** -* @class -*/ -OpenLayers.Popup.AnchoredBubble = Class.create(); - -//Border space for the rico corners -OpenLayers.Popup.AnchoredBubble.CORNER_SIZE = 5; - -OpenLayers.Popup.AnchoredBubble.prototype = - Object.extend( new OpenLayers.Popup.Anchored(), { - - /** @type DOMElement */ - contentDiv:null, - - - /** - * @constructor - * - * @param {String} id - * @param {OpenLayers.LonLat} lonlat - * @param {OpenLayers.Size} size - * @param {String} contentHTML - * @param {Object} anchor Object which must expose a - * - 'size' (OpenLayers.Size) and - * - 'offset' (OpenLayers.Pixel) - * (this is generally an OpenLayers.Icon) - */ - initialize:function(id, lonlat, size, contentHTML, anchor) { - OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments); - }, - - /** - * @param {OpenLayers.Pixel} px - * - * @returns Reference to a div that contains the drawn popup - * @type DOMElement - */ - draw: function(px) { - - OpenLayers.Popup.Anchored.prototype.draw.apply(this, arguments); - - // make the content Div - var contentSize = this.size.copyOf(); - contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE); - - var id = this.div.id + "-contentDiv"; - this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize, - null, "relative", null, - "hidden"); - this.div.appendChild(this.contentDiv); - this.setContentHTML(); - - this.setRicoCorners(true); - - //set the popup color and opacity - this.setBackgroundColor(); - this.setOpacity(); - - return this.div; - }, - - /** - * @param {OpenLayers.Size} size - */ - setSize:function(size) { - OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); - - if (this.contentDiv != null) { - - var contentSize = this.size.copyOf(); - contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE); - - this.contentDiv.style.height = contentSize.h + "px"; - - //size has changed - must redo corners - this.setRicoCorners(false); - } - }, - - /** - * @param {String} color - */ - setBackgroundColor:function(color) { - if (color != undefined) { - this.backgroundColor = color; - } - - if (this.div != null) { - if (this.contentDiv != null) { - this.div.style.background = "transparent"; - Rico.Corner.changeColor(this.contentDiv, this.backgroundColor); - } - } - }, - - /** - * @param {float} opacity - */ - setOpacity:function(opacity) { - if (opacity != undefined) { - this.opacity = opacity; - } - - if (this.div != null) { - if (this.contentDiv != null) { - Rico.Corner.changeOpacity(this.contentDiv, this.opacity); - } - } - }, - - /** Bubble Popups can not have a border - * - * @param {int} border - */ - setBorder:function(border) { - this.border = 0; - }, - - /** - * @param {String} contentHTML - */ - setContentHTML:function(contentHTML) { - if (contentHTML != null) { - this.contentHTML = contentHTML; - } - - if (this.contentDiv != null) { - this.contentDiv.innerHTML = this.contentHTML; - } - }, - - /** - * @private - * - * @param {Boolean} firstTime Is this the first time the corners are being - * rounded? - * - * update the rico corners according to the popup's - * current relative postion - */ - setRicoCorners:function(firstTime) { - - var corners = this.getCornersToRound(this.relativePosition); - var options = {corners: corners, - color: this.backgroundColor, - bgColor: "transparent", - blend: false}; - - if (firstTime) { - Rico.Corner.round(this.div, options); - } else { - Rico.Corner.reRound(this.contentDiv, options); - //set the popup color and opacity - this.setBackgroundColor(); - this.setOpacity(); - } - }, - - /** - * @private - * - * @returns The proper corners string ("tr tl bl br") for rico - * to round - * @type String - */ - getCornersToRound:function() { - - var corners = ['tl', 'tr', 'bl', 'br']; - - //we want to round all the corners _except_ the opposite one. - var corner = OpenLayers.Bounds.oppositeQuadrant(this.relativePosition); - corners.remove(corner); - - return corners.join(" "); - }, - - CLASS_NAME: "OpenLayers.Popup.AnchoredBubble" -}); diff --git a/public/lib/OpenLayers/SingleFile.js b/public/lib/OpenLayers/SingleFile.js deleted file mode 100644 index 857c48490..000000000 --- a/public/lib/OpenLayers/SingleFile.js +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -_OPENLAYERS_SFL_=true - diff --git a/public/lib/OpenLayers/Tile.js b/public/lib/OpenLayers/Tile.js deleted file mode 100644 index eca7c0bca..000000000 --- a/public/lib/OpenLayers/Tile.js +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -/* - * OpenLayers.Tile - * - * @class This is a class designed to designate a single tile, however - * it is explicitly designed to do relatively little. Tiles store information - * about themselves -- such as the URL that they are related to, and their - * size - but do not add themselves to the layer div automatically, for - * example. - */ -OpenLayers.Tile = Class.create(); -OpenLayers.Tile.prototype = { - - /** @type OpenLayers.Layer */ - layer: null, - - /** @type String url of the request */ - url:null, - - /** @type OpenLayers.Bounds */ - bounds:null, - - /** @type OpenLayers.Size */ - size:null, - - /** Top Left pixel of the tile - * @type OpenLayers.Pixel */ - position:null, - - /** - * @constructor - * - * @param {OpenLayers.Layer} layer - * @param {OpenLayers.Pixel} position - * @param {OpenLayers.Bounds} bounds - * @param {String} url - * @param {OpenLayers.Size} size - */ - initialize: function(layer, position, bounds, url, size) { - if (arguments.length > 0) { - this.layer = layer; - this.position = position; - this.bounds = bounds; - this.url = url; - this.size = size; - } - }, - - /** nullify references to prevent circular references and memory leaks - */ - destroy:function() { - this.layer = null; - this.bounds = null; - this.size = null; - }, - - /** - */ - draw:function() { - - // HACK HACK - should we make it a standard to put this sort of warning - // message in functions that are supposed to be overridden? - // - // Log.warn(this.CLASS_NAME + ": draw() not implemented"); - - }, - - /** remove this tile from the ds - */ - remove:function() { - }, - - /** - * @type OpenLayers.Pixel - */ - getPosition: function() { - return this.position; - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Tile" -}; - diff --git a/public/lib/OpenLayers/Tile/Image.js b/public/lib/OpenLayers/Tile/Image.js deleted file mode 100644 index 6a386f8c2..000000000 --- a/public/lib/OpenLayers/Tile/Image.js +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Tile.js -/** -* @class -*/ -OpenLayers.Tile.Image = Class.create(); -OpenLayers.Tile.Image.prototype = - Object.extend( new OpenLayers.Tile(), { - - /** @type DOMElement img */ - imgDiv:null, - - /** - * @constructor - * - * @param {OpenLayers.Grid} layer - * @param {OpenLayers.Pixel} position - * @param {OpenLayers.Bounds} bounds - * @param {String} url - * @param {OpenLayers.Size} size - */ - initialize: function(layer, position, bounds, url, size) { - OpenLayers.Tile.prototype.initialize.apply(this, arguments); - }, - - destroy: function() { - if ((this.imgDiv != null) && (this.imgDiv.parentNode == this.layer.div)) { - this.layer.div.removeChild(this.imgDiv); - } - this.imgDiv = null; - OpenLayers.Tile.prototype.destroy.apply(this, arguments); - }, - - /** - */ - draw:function(transparent) { - if (false) { // don't actually use the alpha PNG hack right now - // it has a fiercely bad effect on IE6's performance - // if (transparent) { - this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null, - this.position, - this.size, - this.url, - "absolute"); - } else { - this.imgDiv = OpenLayers.Util.createImage(null, - this.position, - this.size, - this.url, - "absolute"); - } - this.layer.div.appendChild(this.imgDiv); - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Tile.Image" - } -); diff --git a/public/lib/OpenLayers/Tile/WFS.js b/public/lib/OpenLayers/Tile/WFS.js deleted file mode 100644 index 486d1384c..000000000 --- a/public/lib/OpenLayers/Tile/WFS.js +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -// @require: OpenLayers/Tile.js -/** -* @class -*/ -OpenLayers.Tile.WFS = Class.create(); -OpenLayers.Tile.WFS.prototype = - Object.extend( new OpenLayers.Tile(), { - - /** @type Array(OpenLayers.Feature)*/ - features: null, - - - /** - * @constructor - * - * @param {OpenLayers.Layer} layer - * @param {OpenLayers.Pixel} position - * @param {OpenLayers.Bounds} bounds - * @param {String} url - * @param {OpenLayers.Size} size - */ - initialize: function(layer, position, bounds, url, size) { - OpenLayers.Tile.prototype.initialize.apply(this, arguments); - - this.features = new Array(); - }, - - /** - * - */ - destroy: function() { - for(var i=0; i < this.features.length; i++) { - this.features[i].destroy(); - } - OpenLayers.Tile.prototype.destroy.apply(this, arguments); - }, - - /** - */ - draw:function() { - this.loadFeaturesForRegion(this.requestSuccess); - }, - - - /** get the full request string from the ds and the tile params - * and call the AJAX loadURL(). - * - * input are function pointers for what to do on success and failure. - * - * @param {function} success - * @param {function} failure - */ - loadFeaturesForRegion:function(success, failure) { - - if (!this.loaded) { - - if (this.url != "") { - - // TODO: Hmmm, this stops multiple loads of the data when a - // result isn't immediately retrieved, but it's hacky. - // Do it better. - this.loaded = true; - OpenLayers.loadURL(this.url, null, this, success, failure); - } - } - }, - - /** Return from AJAX request - * - * @param {} request - */ - requestSuccess:function(request) { - var doc = request.responseXML; - - if (!doc || request.fileType!="XML") { - doc = OpenLayers.parseXMLString(request.responseText); - } - - var resultFeatures = doc.getElementsByTagName("featureMember"); - - //clear old featureList - this.features = new Array(); - - for (var i=0; i < resultFeatures.length; i++) { - - var feature = new this.layer.featureClass(this.layer, - resultFeatures[i]); - this.features.append(feature); - } - - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Tile.WFS" - } -); - diff --git a/public/lib/OpenLayers/Util.js b/public/lib/OpenLayers/Util.js deleted file mode 100644 index 9270821e0..000000000 --- a/public/lib/OpenLayers/Util.js +++ /dev/null @@ -1,1010 +0,0 @@ -/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license. - * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full - * text of the license. */ -/** -* @class -*/ -OpenLayers.Util = new Object(); - - - - -/** -* @class This class represents a screen coordinate, in x and y coordinates -*/ -OpenLayers.Pixel = Class.create(); -OpenLayers.Pixel.prototype = { - - /** @type float */ - x: 0.0, - - /** @type float */ - y: 0.0, - - /** - * @constructor - * - * @param {float} x - * @param {float} y - */ - initialize: function(x, y) { - this.x = x; - this.y = y; - }, - - /** - * @return string representation of Pixel. ex: "x=200.4,y=242.2" - * @type str - */ - toString:function() { - return ("x=" + this.x + ",y=" + this.y); - }, - - /** - * @type OpenLayers.Pixel - */ - copyOf:function() { - return new OpenLayers.Pixel(this.x, this.y); - }, - - /** - * @param {OpenLayers.Pixel} px - * - * @return whether or not the point passed in as parameter is equal to this - * note that if px passed in is null, returns false - * @type bool - */ - equals:function(px) { - var equals = false; - if (px != null) { - equals = ((this.x == px.x) && (this.y == px.y)); - } - return equals; - }, - - /** - * @param {int} x - * @param {int} y - * - * @return a new Pixel with this pixel's x&y augmented by the - * values passed in. - * @type OpenLayers.Pixel - */ - add:function(x, y) { - return new OpenLayers.Pixel(this.x + x, this.y + y); - }, - - /** - * @param {OpenLayers.Pixel} px - * - * @return a new Pixel with this pixel's x&y augmented by the - * x&y values of the pixel passed in. - * @type OpenLayers.Pixel - */ - offset:function(px) { - return this.add(px.x, px.y); - }, - - /** @final @type str */ - CLASS_NAME: "OpenLayers.Pixel" -}; - - -/** -* @class This class represents a width and height pair -*/ -OpenLayers.Size = Class.create(); -OpenLayers.Size.prototype = { - - /** @type float */ - w: 0.0, - - /** @type float */ - h: 0.0, - - - /** - * @constructor - * - * @param {float} w - * @param {float} h - */ - initialize: function(w, h) { - this.w = w; - this.h = h; - }, - - /** - * @return String representation of OpenLayers.Size object. - * (ex. "w=55,h=66") - * @type String - */ - toString:function() { - return ("w=" + this.w + ",h=" + this.h); - }, - - /** - * @return New OpenLayers.Size object with the same w and h values - * @type OpenLayers.Size - */ - copyOf:function() { - return new OpenLayers.Size(this.w, this.h); - }, - - /** - * @param {OpenLayers.Size} sz - * @returns Boolean value indicating whether the passed-in OpenLayers.Size - * object has the same w and h components as this - * note that if sz passed in is null, returns false - * - * @type bool - */ - equals:function(sz) { - var equals = false; - if (sz != null) { - equals = ((this.w == sz.w) && (this.h == sz.h)); - } - return equals; - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Size" -}; - -/** -* @class This class represents a longitude and latitude pair -*/ -OpenLayers.LonLat = Class.create(); -OpenLayers.LonLat.prototype = { - - /** @type float */ - lon: 0.0, - - /** @type float */ - lat: 0.0, - - /** - * @constructor - * - * @param {float} lon - * @param {float} lat - */ - initialize: function(lon, lat) { - this.lon = lon; - this.lat = lat; - }, - - /** - * @return String representation of OpenLayers.LonLat object. - * (ex. "lon=5,lat=42") - * @type String - */ - toString:function() { - return ("lon=" + this.lon + ",lat=" + this.lat); - }, - - /** - * @return Shortened String representation of OpenLayers.LonLat object. - * (ex. "5, 42") - * @type String - */ - toShortString:function() { - return (this.lon + ", " + this.lat); - }, - - /** - * @return New OpenLayers.LonLat object with the same lon and lat values - * @type OpenLayers.LonLat - */ - copyOf:function() { - return new OpenLayers.LonLat(this.lon, this.lat); - }, - - /** - * @param {float} lon - * @param {float} lat - * - * @return A new OpenLayers.LonLat object with the lon and lat passed-in - * added to this's. - * @type OpenLayers.LonLat - */ - add:function(lon, lat) { - return new OpenLayers.LonLat(this.lon + lon, this.lat + lat); - }, - - /** - * @param {OpenLayers.LonLat} ll - * @returns Boolean value indicating whether the passed-in OpenLayers.LonLat - * object has the same lon and lat components as this - * note that if ll passed in is null, returns false - * - * @type bool - */ - equals:function(ll) { - var equals = false; - if (ll != null) { - equals = ((this.lon == ll.lon) && (this.lat == ll.lat)); - } - return equals; - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.LonLat" -}; - -/** Alternative constructor that builds a new OpenLayers.LonLat from a -* parameter string -* -* @constructor -* -* @param {String} str Comma-separated Lon,Lat coordinate string. -* (ex. "5,40") -* -* @returns New OpenLayers.LonLat object built from the passed-in String. -* @type OpenLayers.LonLat -*/ -OpenLayers.LonLat.fromString = function(str) { - var pair = str.split(","); - return new OpenLayers.LonLat(parseFloat(pair[0]), - parseFloat(pair[1])); -}; - - - - -/** -* @class This class represents a bounding box. -* Data stored as left, bottom, right, top floats -*/ -OpenLayers.Bounds = Class.create(); -OpenLayers.Bounds.prototype = { - - /** @type float */ - left: 0.0, - - /** @type float */ - bottom: 0.0, - - /** @type float */ - right: 0.0, - - /** @type float */ - top: 0.0, - - /** - * @constructor - * - * @param {float} left - * @param {float} bottom - * @param {float} right - * @param {float} top - * - */ - initialize: function(left, bottom, right, top) { - this.left = left; - this.bottom = bottom; - this.right = right; - this.top = top; - }, - - /** - * @returns A fresh copy of the bounds - * @type OpenLayers.Bounds - */ - copyOf:function() { - return new OpenLayers.Bounds(this.left, this.bottom, - this.right, this.top); - }, - - /** - * @param {OpenLayers.Bounds} bounds - * @returns Boolean value indicating whether the passed-in OpenLayers.Bounds - * object has the same left, right, top, bottom components as this - * note that if bounds passed in is null, returns false - * - * @type bool - */ - equals:function(bounds) { - var equals = false; - if (bounds != null) { - equals = ((this.left == bounds.left) && - (this.right == bounds.right) && - (this.top == bounds.top) && - (this.bottom == bounds.bottom)); - } - return equals; - }, - - /** - * @return String representation of OpenLayers.Bounds object. - * (ex."left-bottom=(5,42) right-top=(10,45)") - * @type String - */ - toString:function(){ - return ( "left-bottom=(" + this.left + "," + this.bottom + ")" - + " right-top=(" + this.right + "," + this.top + ")" ); - }, - - /** - * @return Simple String representation of OpenLayers.Bounds object. - * (ex. "5,42,10,45") - * @type String - */ - toBBOX:function() { - return (this.left + "," + this.bottom + "," - + this.right + "," + this.top); - }, - - /** - * @returns The width of the bounds - * @type float - */ - getWidth:function() { - return (this.right - this.left); - }, - - /** - * @returns The height of the bounds - * @type float - */ - getHeight:function() { - return (this.top - this.bottom); - }, - - /** - * @returns An OpenLayers.Size which represents the size of the box - * @type OpenLayers.Size - */ - getSize:function() { - return new OpenLayers.Size(this.getWidth(), this.getHeight()); - }, - - /** - * @returns An OpenLayers.Pixel which represents the center of the bounds - * @type OpenLayers.Pixel - */ - getCenterPixel:function() { - return new OpenLayers.Pixel( (this.left + this.right) / 2, - (this.bottom + this.top) / 2); - }, - - /** - * @returns An OpenLayers.LonLat which represents the center of the bounds - * @type OpenLayers.LonLat - */ - getCenterLonLat:function() { - return new OpenLayers.LonLat( (this.left + this.right) / 2, - (this.bottom + this.top) / 2); - }, - - /** - * @param {float} x - * @param {float} y - * - * @returns A new OpenLayers.Bounds whose coordinates are the same as this, - * but shifted by the passed-in x and y values - * @type OpenLayers.Bounds - */ - add:function(x, y){ - return new OpenLayers.Box(this.left + x, this.bottom + y, - this.right + x, this.top + y); - }, - - /** - * @param {float} x - * @param {float} y - * @param {Boolean} inclusive Whether or not to include the border. - * Default is true - * - * @return Whether or not the passed-in coordinates are within this bounds - * @type Boolean - */ - contains:function(x, y, inclusive) { - - //set default - if (inclusive == null) { - inclusive = true; - } - - var contains = false; - if (inclusive) { - contains = ((x >= this.left) && (x <= this.right) && - (y >= this.bottom) && (y <= this.top)); - } else { - contains = ((x > this.left) && (x < this.right) && - (y > this.bottom) && (y < this.top)); - } - return contains; - }, - - /** - * @param {OpenLayers.Bounds} bounds - * @param {Boolean} partial If true, only part of passed-in - * OpenLayers.Bounds needs be within this bounds. - * If false, the entire passed-in bounds must be - * within. Default is false - * @param {Boolean} inclusive Whether or not to include the border. - * Default is true - * - * @return Whether or not the passed-in OpenLayers.Bounds object is - * contained within this bounds. - * @type Boolean - */ - containsBounds:function(bounds, partial, inclusive) { - - //set defaults - if (partial == null) { - partial = false; - } - if (inclusive == null) { - inclusive = true; - } - - var inLeft; - var inTop; - var inRight; - var inBottom; - - if (inclusive) { - inLeft = (bounds.left >= this.left) && (bounds.left <= this.right); - inTop = (bounds.top >= this.bottom) && (bounds.top <= this.top); - inRight= (bounds.right >= this.left) && (bounds.right <= this.right); - inBottom = (bounds.bottom >= this.bottom) && (bounds.bottom <= this.top); - } else { - inLeft = (bounds.left > this.left) && (bounds.left < this.right); - inTop = (bounds.top > this.bottom) && (bounds.top < this.top); - inRight= (bounds.right > this.left) && (bounds.right < this.right); - inBottom = (bounds.bottom > this.bottom) && (bounds.bottom < this.top); - } - - return (partial) ? (inTop || inBottom) && (inLeft || inRight ) - : (inTop && inLeft && inBottom && inRight); - }, - - /** - * @param {OpenLayers.LonLat} lonlat - * - * @returns The quadrant ("br" "tr" "tl" "bl") of the bounds in which - * the coordinate lies. - * @type String - */ - determineQuadrant: function(lonlat) { - - var quadrant = ""; - var center = this.getCenterLonLat(); - - quadrant += (lonlat.lat < center.lat) ? "b" : "t"; - quadrant += (lonlat.lon < center.lon) ? "l" : "r"; - - return quadrant; - }, - - /** @final @type String */ - CLASS_NAME: "OpenLayers.Bounds" -}; - -/** Alternative constructor that builds a new OpenLayers.Bounds from a -* parameter string -* -* @constructor -* -* @param {String} str Comma-separated bounds string. (ex. "5,42,10,45") -* -* @returns New OpenLayers.Bounds object built from the passed-in String. -* @type OpenLayers.Bounds -*/ -OpenLayers.Bounds.fromString = function(str) { - var bounds = str.split(","); - return OpenLayers.Bounds.fromArray(bounds); -}; - -/** Alternative constructor that builds a new OpenLayers.Bounds -* from an array -* -* @constructor -* -* @param {Array} bbox Array of bounds values (ex. [5,42,10,45]) -* -* @returns New OpenLayers.Bounds object built from the passed-in Array. -* @type OpenLayers.Bounds -*/ -OpenLayers.Bounds.fromArray = function(bbox) { - return new OpenLayers.Bounds(parseFloat(bbox[0]), - parseFloat(bbox[1]), - parseFloat(bbox[2]), - parseFloat(bbox[3])); -}; - -/** Alternative constructor that builds a new OpenLayers.Bounds -* from an OpenLayers.Size -* -* @constructor -* -* @param {OpenLayers.Size} size -* -* @returns New OpenLayers.Bounds object built with top and left set to 0 and -* bottom right taken from the passed-in OpenLayers.Size. -* @type OpenLayers.Bounds -*/ -OpenLayers.Bounds.fromSize = function(size) { - return new OpenLayers.Bounds(0, - size.h, - size.w, - 0); -}; -/** - * @param {String} quadrant - * - * @returns The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if - * you pass in "bl" it returns "tr", if you pass in "br" it - * returns "tl", etc. - * @type String - */ -OpenLayers.Bounds.oppositeQuadrant = function(quadrant) { - var opp = ""; - - opp += (quadrant.charAt(0) == 't') ? 'b' : 't'; - opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l'; - - return opp; -}; - -// Some other helpful things - -/** -* @param {String} sStart -* -* @returns Whether or not this string starts with the string passed in. -* @type Boolean -*/ -String.prototype.startsWith = function(sStart){ - return (this.substr(0,sStart.length) == sStart); -}; - -/** -* @returns A trimmed version of the string - all leading and -* trailing spaces removed -* @type String -*/ -String.prototype.trim = function() { - - var b = 0; - while(this.substr(b,1) == " ") { - b++; - } - - var e = this.length - 1; - while(this.substr(e,1) == " ") { - e--; - } - - return this.substring(b, e+1); -}; - -/** Remove an object from an array. Iterates through the array -* to find the item, then removes it. -* -* @param {Object} item -* -* @returns A reference to the array -* @type Array -*/ -Array.prototype.remove = function(item) { - for(var i=0; i < this.length; i++) { - if(this[i] == item) { - this.splice(i,1); - //break;more than once?? - } - } - return this; -} - -/** -* @returns A fresh copy of the array -* @type Array -*/ -Array.prototype.copyOf = function() { - var copy = new Array(); - for (var i = 0; i < this.length; i++) { - copy[i] = this[i]; - } - return copy; -}; - -/** -* @param {Object} item -*/ -Array.prototype.prepend = function(item) { - this.splice(0, 0, item); -}; - -/** -* @param {Object} item -*/ -Array.prototype.append = function(item){ - this[this.length] = item; -}; - -/** -*/ -Array.prototype.clear = function() { - this.length = 0; -}; - -/** -* @param {Object} element -* -* @returns The first index of the element in the array if found. Else returns -1 -* @type int -*/ -Array.prototype.indexOf = function(element) { - var index = -1; - for(var i=0; i < this.length; i++) { - if (this[i] == element) { - index = i; - break; - } - } - return index; -} - -/** - * @param {String} id - * @param {OpenLayers.Pixel} px - * @param {OpenLayers.Size} sz - * @param {String} position - * @param {String} border - * @param {String} overflow - */ -OpenLayers.Util.modifyDOMElement = function(element, id, px, sz, position, - border, overflow) { - - if (id) { - element.id = id; - } - if (px) { - element.style.left = px.x + "px"; - element.style.top = px.y + "px"; - } - if (sz) { - element.style.width = sz.w + "px"; - element.style.height = sz.h + "px"; - } - if (position) { - element.style.position = position; - } - if (border) { - element.style.border = border; - } - if (overflow) { - element.style.overflow = overflow; - } -}; - -/** -* zIndex is NOT set -* -* @param {String} id -* @param {OpenLayers.Pixel} px -* @param {OpenLayers.Size} sz -* @param {String} imgURL -* @param {String} position -* @param {String} border -* @param {String} overflow -* -* @returns A DOM Div created with the specified attributes. -* @type DOMElement -*/ -OpenLayers.Util.createDiv = function(id, px, sz, imgURL, position, - border, overflow) { - - var dom = document.createElement('div'); - - //set specific properties - dom.style.padding = "0"; - dom.style.margin = "0"; - if (imgURL) { - dom.style.backgroundImage = 'url(' + imgURL + ')'; - } - - //set generic properties - if (!id) { - id = "OpenLayersDiv" + (Math.random() * 10000 % 10000); - } - if (!position) { - position = "absolute"; - } - OpenLayers.Util.modifyDOMElement(dom, id, px, sz, - position, border, overflow); - - return dom; -}; - -/** -* @param {String} id -* @param {OpenLayers.Pixel} px -* @param {OpenLayers.Size} sz -* @param {String} imgURL -* @param {String} position -* @param {String} border -* -* @returns A DOM Image created with the specified attributes. -* @type DOMElement -*/ -OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border) { - - image = document.createElement("img"); - - //set special properties - image.style.alt = id; - image.galleryImg = "no"; - if (imgURL) { - image.src = imgURL; - } - - //set generic properties - if (!id) { - id = "OpenLayersDiv" + (Math.random() * 10000 % 10000); - } - if (!position) { - position = "relative"; - } - OpenLayers.Util.modifyDOMElement(image, id, px, sz, position, border); - - return image; -}; - -OpenLayers.Util.alphaHack = function() { - var arVersion = navigator.appVersion.split("MSIE"); - var version = parseFloat(arVersion[1]); - - return ( (document.body.filters) && - (version >= 5.5) && (version < 7) ); -} - -/** -* @param {DOMElement} div Div containing Alpha-adjusted Image -* @param {String} id -* @param {OpenLayers.Pixel} px -* @param {OpenLayers.Size} sz -* @param {String} imgURL -* @param {String} position -* @param {String} border -* @param {String} sizing 'crop', 'scale', or 'image'. Default is "scale" -*/ -OpenLayers.Util.modifyAlphaImageDiv = function(div, id, px, sz, imgURL, - position, border, sizing) { - - OpenLayers.Util.modifyDOMElement(div, id, px, sz); - - var img = div.childNodes[0]; - - if (imgURL) { - img.src = imgURL; - } - OpenLayers.Util.modifyDOMElement(img, div.id + "_innerImage", null, sz, - "relative", border); - - if (OpenLayers.Util.alphaHack()) { - div.style.display = "inline-block"; - if (sizing == null) { - sizing = "scale"; - } - div.style.filter = "progid:DXImageTransform.Microsoft" + - ".AlphaImageLoader(src='" + img.src + "', " + - "sizingMethod='" + sizing + "')"; - img.style.filter = "progid:DXImageTransform.Microsoft" + - ".Alpha(opacity=0)"; - } -}; - -/** -* @param {String} id -* @param {OpenLayers.Pixel} px -* @param {OpenLayers.Size} sz -* @param {String} imgURL -* @param {String} position -* @param {String} border -* @param {String} sizing 'crop', 'scale', or 'image'. Default is "scale" -* -* @returns A DOM Div created with a DOM Image inside it. If the hack is -* needed for transparency in IE, it is added. -* @type DOMElement -*/ -OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL, - position, border, sizing) { - - var div = OpenLayers.Util.createDiv(); - var img = OpenLayers.Util.createImage(); - div.appendChild(img); - - OpenLayers.Util.modifyAlphaImageDiv(div, id, px, sz, imgURL, - position, border, sizing); - - return div; -}; - - -/** Creates a new hash and copies over all the keys from the -* passed-in object, but storing them under an uppercased -* version of the key at which they were stored. -* -* @param {Object} object -* -* @returns A new Object with all the same keys but uppercased -* @type Object -*/ -OpenLayers.Util.upperCaseObject = function (object) { - var uObject = new Object(); - for (var key in object) { - uObject[key.toUpperCase()] = object[key]; - } - return uObject; -}; - -/** Takes a hash and copies any keys that don't exist from -* another hash, by analogy with Object.extend() from -* Prototype.js. -* -* @param {Object} to -* @param {Object} from -* -* @type Object -*/ -OpenLayers.Util.applyDefaults = function (to, from) { - for (var key in from) { - if (to[key] == null) { - to[key] = from[key]; - } - } - return to; -}; - -/** -* @param {Object} params -* -* @returns a concatenation of the properties of an object in -* http parameter notation. -* (ex. "key1=value1&key2=value2&key3=value3") -* @type String -*/ -OpenLayers.Util.getParameterString = function(params) { - paramsArray = new Array(); - - for (var key in params) { - var value = params[key]; - //skip functions - if (typeof value == 'function') continue; - - paramsArray.push(key + "=" + value); - } - - return paramsArray.join("&"); -}; - -/** -* @returns The fully formatted image location string -* @type String -*/ -OpenLayers.Util.getImagesLocation = function() { - return OpenLayers._getScriptLocation() + "img/"; -}; - - - -/** These could/should be made namespace aware? -* -* @param {} p -* @param {str} tagName -* -* @return {Array} -*/ -OpenLayers.Util.getNodes=function(p, tagName) { - var nodes = Try.these( - function () { - return OpenLayers.Util._getNodes(p.documentElement.childNodes, - tagName); - }, - function () { - return OpenLayers.Util._getNodes(p.childNodes, tagName); - } - ); - return nodes; -}; - -/** -* @param {Array} nodes -* @param {str} tagName -* -* @return {Array} -*/ -OpenLayers.Util._getNodes=function(nodes, tagName) { - var retArray = new Array(); - for (var i=0;i