dont worry about checking for the corners of the marker. just check the lonlat. that is good enough

git-svn-id: http://svn.openlayers.org/trunk/openlayers@534 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-07 13:02:14 +00:00
parent 7cc874d26b
commit c2832cf83a

View File

@@ -65,16 +65,12 @@ OpenLayers.Marker.prototype = {
*/
onScreen:function() {
var screenBounds = OpenLayers.Bounds.fromSize(this.map.getSize());
var iconTop = parseInt(this.icon.div.style.top);
var iconLeft = parseInt(this.icon.div.style.left);
var iconBottom = iconTop + parseInt(this.icon.div.style.height);
var iconRight = iconLeft + parseInt(this.icon.div.style.width);
var iconBounds =
new OpenLayers.Bounds(iconLeft, iconBottom, iconRight, iconTop);
return screenBounds.containsBounds(iconBounds, true);
var onScreen = false;
if (this.map) {
var screenBounds = this.map.getExtent();
onScreen = screenBounds.contains(this.lonlat.lon, this.lonlat.lat);
}
return onScreen;
},
/**