replace all usage of copyOf() with clone(). Now copyOf() is officially deprecated and unused. supported only if users out there have used it, but we can phase it out in the next official release.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@961 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -56,7 +56,7 @@ OpenLayers.Control.prototype = {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
}
|
||||
if (px != null) {
|
||||
this.position = px.copyOf();
|
||||
this.position = px.clone();
|
||||
}
|
||||
this.moveTo(this.position);
|
||||
return this.div;
|
||||
|
||||
@@ -58,7 +58,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.performedDrag = false;
|
||||
if (evt.shiftKey) {
|
||||
this.map.div.style.cursor = "crosshair";
|
||||
@@ -102,7 +102,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
size.h / 2 + deltaY);
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( newXY );
|
||||
this.map.setCenter(newCenter, null, true);
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.map.div.style.cursor = "move";
|
||||
}
|
||||
this.performedDrag = true;
|
||||
|
||||
@@ -94,7 +94,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
if (evt.shiftKey && this.mode !="zoombox") {
|
||||
this.switchModeTo("zoombox");
|
||||
} else if (evt.altKey && this.mode !="measure") {
|
||||
@@ -215,7 +215,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
size.h / 2 + deltaY);
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( newXY );
|
||||
this.map.setCenter(newCenter, null, true);
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -147,8 +147,8 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.map.events.register("mousemove", this, this.passEventToSlider);
|
||||
this.map.events.register("mouseup", this, this.passEventToSlider);
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.zoomStart = evt.xy.copyOf();
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.zoomStart = evt.xy.clone();
|
||||
this.div.style.cursor = "move";
|
||||
Event.stop(evt);
|
||||
},
|
||||
@@ -168,7 +168,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
var newTop = parseInt(this.slider.style.top) - deltaY;
|
||||
this.slider.style.top = newTop+"px";
|
||||
}
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
}
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
@@ -70,7 +70,7 @@ OpenLayers.Layer.Grid.prototype =
|
||||
|
||||
// copy/set any non-init, non-simple values here
|
||||
if (this.tileSize != null) {
|
||||
obj.tileSize = this.tileSize.copyOf();
|
||||
obj.tileSize = this.tileSize.clone();
|
||||
}
|
||||
|
||||
// we do not want to copy reference to grid. that should stay at null
|
||||
@@ -98,7 +98,7 @@ OpenLayers.Layer.Grid.prototype =
|
||||
*/
|
||||
setTileSize: function (size) {
|
||||
if (size) {
|
||||
this.tileSize = size.copyOf();
|
||||
this.tileSize = size.clone();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -357,8 +357,8 @@ OpenLayers.Layer.Grid.prototype =
|
||||
|
||||
for (var i=0; i < modelRow.length; i++) {
|
||||
var modelTile = modelRow[i];
|
||||
var bounds = modelTile.bounds.copyOf();
|
||||
var position = modelTile.position.copyOf();
|
||||
var bounds = modelTile.bounds.clone();
|
||||
var position = modelTile.position.clone();
|
||||
bounds.bottom = bounds.bottom + deltaLat;
|
||||
bounds.top = bounds.top + deltaLat;
|
||||
position.y = position.y + deltaY;
|
||||
@@ -393,8 +393,8 @@ OpenLayers.Layer.Grid.prototype =
|
||||
modelTileIndex = (prepend) ? 0 : (row.length - 1);
|
||||
var modelTile = row[modelTileIndex];
|
||||
|
||||
var bounds = modelTile.bounds.copyOf();
|
||||
var position = modelTile.position.copyOf();
|
||||
var bounds = modelTile.bounds.clone();
|
||||
var position = modelTile.position.clone();
|
||||
bounds.left = bounds.left + deltaLon;
|
||||
bounds.right = bounds.right + deltaLon;
|
||||
position.x = position.x + deltaX;
|
||||
|
||||
@@ -43,7 +43,7 @@ OpenLayers.Layer.WFS.prototype =
|
||||
OpenLayers.Layer.Markers.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
if (options && options['tileSize']) {
|
||||
this.tileSize = options['tileSize'].copyOf();
|
||||
this.tileSize = options['tileSize'].clone();
|
||||
} else {
|
||||
this.tileSize = new OpenLayers.Size(256, 256);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
bounds = this.map.getExtent();
|
||||
}
|
||||
|
||||
var size = this.map.getSize().copyOf();
|
||||
var size = this.map.getSize().clone();
|
||||
|
||||
// get the url
|
||||
var url = this.getFullRequestString( {BBOX: bounds.toBBOX(),
|
||||
@@ -186,7 +186,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
*/
|
||||
loadImageDiv: function() {
|
||||
|
||||
var size = this.map.getSize().copyOf();
|
||||
var size = this.map.getSize().clone();
|
||||
var bounds = this.map.getExtent();
|
||||
|
||||
var url = "";
|
||||
|
||||
@@ -478,12 +478,12 @@ OpenLayers.Map.prototype = {
|
||||
// (must be done before setting this.center to new value)
|
||||
this.centerLayerContainer(lonlat);
|
||||
}
|
||||
this.center = lonlat.copyOf();
|
||||
this.center = lonlat.clone();
|
||||
}
|
||||
|
||||
// (re)set the layerContainerDiv's location
|
||||
if ((zoomChanged) || (this.layerContainerOrigin == null)) {
|
||||
this.layerContainerOrigin = this.center.copyOf();
|
||||
this.layerContainerOrigin = this.center.clone();
|
||||
this.layerContainerDiv.style.left = "0px";
|
||||
this.layerContainerDiv.style.top = "0px";
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
|
||||
OpenLayers.Popup.Anchored.prototype.draw.apply(this, arguments);
|
||||
|
||||
// make the content Div
|
||||
var contentSize = this.size.copyOf();
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
|
||||
var id = this.div.id + "-contentDiv";
|
||||
@@ -72,7 +72,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
|
||||
|
||||
if (this.contentDiv != null) {
|
||||
|
||||
var contentSize = this.size.copyOf();
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
|
||||
this.contentDiv.style.height = contentSize.h + "px";
|
||||
|
||||
Reference in New Issue
Block a user