Change "OpenLayers.Point" to OpenLayers.Pixel, so there's no confusion between LatLon and Point (a problem that has
and still does afflict the Google Maps API). git-svn-id: http://svn.openlayers.org/trunk/openlayers@19 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
OpenLayers.Util=new Object();
|
||||
|
||||
OpenLayers.Point = Class.create();
|
||||
OpenLayers.Point.prototype = {
|
||||
OpenLayers.Pixel = Class.create();
|
||||
OpenLayers.Pixel.prototype = {
|
||||
initialize: function(x,y) {
|
||||
this.x=x;
|
||||
this.y=y;
|
||||
@@ -13,7 +13,7 @@ OpenLayers.Point.prototype = {
|
||||
return ("x="+this.x+",y="+this.y);
|
||||
},
|
||||
copyOf:function() {
|
||||
return new OpenLayers.Point(this.x, this.y);
|
||||
return new OpenLayers.Pixel(this.x, this.y);
|
||||
},
|
||||
diff:function(pt){ // subtract pt from this
|
||||
return new OpenLayers.Size(this.x - pt.x, this.y - pt.y);
|
||||
@@ -23,20 +23,20 @@ OpenLayers.Point.prototype = {
|
||||
},
|
||||
diffPt:function(pt){
|
||||
sz=this.diff(pt);
|
||||
return new OpenLayers.Point(sz.w,sz.h);
|
||||
return new OpenLayers.Pixel(sz.w,sz.h);
|
||||
},
|
||||
equal:function(pt){
|
||||
d = this.diff(pt);
|
||||
return (d.w==0&&d.h==0);
|
||||
},
|
||||
addSize:function(sz){
|
||||
return new OpenLayers.Point(this.x+sz.w, this.y+sz.h);
|
||||
return new OpenLayers.Pixel(this.x+sz.w, this.y+sz.h);
|
||||
},
|
||||
addX:function(w){
|
||||
return new OpenLayers.Point(this.x+w, this.y);
|
||||
return new OpenLayers.Pixel(this.x+w, this.y);
|
||||
},
|
||||
addY:function(h){
|
||||
return new OpenLayers.Point(this.x, this.y+h);
|
||||
return new OpenLayers.Pixel(this.x, this.y+h);
|
||||
},
|
||||
samePT:function(pt){
|
||||
return (this.x==pt.x && this.y==pt.y);
|
||||
@@ -128,23 +128,23 @@ OpenLayers.Bounds.fromString=function(str){
|
||||
OpenLayers.Box = Class.create();
|
||||
OpenLayers.Box.prototype = {
|
||||
initialize: function(x,y,w,h){
|
||||
this.xy=new OpenLayers.Point(x,y);
|
||||
this.xy=new OpenLayers.Pixel(x,y);
|
||||
this.sz=new OpenLayers.Size(w,h);
|
||||
this.c = new OpenLayers.Point(x+(w/2), y+(h/2));
|
||||
this.br = new OpenLayers.Point(x+w-1,y+h-1);
|
||||
this.c = new OpenLayers.Pixel(x+(w/2), y+(h/2));
|
||||
this.br = new OpenLayers.Pixel(x+w-1,y+h-1);
|
||||
},
|
||||
|
||||
/* offset box by df
|
||||
* @df(OpenLayers.Size)
|
||||
*/
|
||||
offset:function(df){
|
||||
this.xy=new OpenLayers.Point(this.xy.x+df.w,this.xy.y+df.h);
|
||||
this.c = new OpenLayers.Point(this.xy.x+(this.sz.w/2), this.xy.y+(this.sz.h/2));
|
||||
this.xy=new OpenLayers.Pixel(this.xy.x+df.w,this.xy.y+df.h);
|
||||
this.c = new OpenLayers.Pixel(this.xy.x+(this.sz.w/2), this.xy.y+(this.sz.h/2));
|
||||
var x=this.xy.x;
|
||||
var y=this.xy.y;
|
||||
var w=this.sz.w;
|
||||
var h=this.sz.h;
|
||||
this.br = new OpenLayers.Point(x+w-1,y+h-1);
|
||||
this.br = new OpenLayers.Pixel(x+w-1,y+h-1);
|
||||
},
|
||||
|
||||
getOrigin:function(){return this.xy;},
|
||||
@@ -268,7 +268,7 @@ Array.prototype.clear=function() {this.length=0;};
|
||||
* zIndex is NOT set
|
||||
*
|
||||
* @param {str} id - HTML ID of new element, if empty something is made up
|
||||
* @param {OpenLayers.Point} pt - x,y point if missing 0,0 is used
|
||||
* @param {OpenLayers.Pixel} pt - x,y point if missing 0,0 is used
|
||||
* @param {OpenLayers.Size} sz - size else size of parent is used
|
||||
* @param {str} overflow - behavior of clipped/overflow content
|
||||
* @param {str} img - background image url
|
||||
@@ -325,7 +325,7 @@ OpenLayers.Util.ImageHTML=function(img,sz,alt){
|
||||
/**
|
||||
* @param {str} img - src URL
|
||||
* @param {OpenLayers.Size} sz
|
||||
* @param {OpenLayers.Point} xy
|
||||
* @param {OpenLayers.Pixel} xy
|
||||
* @param {str} position
|
||||
* @param {str} id
|
||||
* @param {int} border
|
||||
|
||||
Reference in New Issue
Block a user