You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was reported to me. OpenLayers.Geometry.prototype.atPoint is slow because of time taken in OpenLayers.Util.toFloat and the constructor of OpenLayers.Bounds.
The following code which bypasses those is twice as fast:
OpenLayers.Geometry.prototype.atPoint = function(lonlat, toleranceLon, toleranceLat) {
var atPoint = false;
var bounds = this.getBounds();
if ((bounds != null) && (lonlat != null)) {
var dX = (toleranceLon != null) ? toleranceLon : 0;
var dY = (toleranceLat != null) ? toleranceLat : 0;
var tb = this.bounds;
var x = lonlat.lon;
var y = lonlat.lat;
atPoint = (x > (tb.left - dX)) && (x < (tb.right + dX)) && (y > (tb.bottom - dY)) && (y < (tb.top + dY));
}
return atPoint;
}
The text was updated successfully, but these errors were encountered:
This was reported to me. OpenLayers.Geometry.prototype.atPoint is slow because of time taken in OpenLayers.Util.toFloat and the constructor of OpenLayers.Bounds.
The following code which bypasses those is twice as fast:
The text was updated successfully, but these errors were encountered: