add onScreen() function to OpenLayers.Feature, and add tests to prove it.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1510 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -72,6 +72,21 @@ OpenLayers.Feature.prototype= {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Whether or not the feature is currently visible on screen
|
||||
* (based on its 'lonlat' property)
|
||||
* @type Boolean
|
||||
*/
|
||||
onScreen:function() {
|
||||
|
||||
var onScreen = false;
|
||||
if ((this.layer != null) && (this.layer.map != null)) {
|
||||
var screenBounds = this.layer.map.getExtent();
|
||||
onScreen = screenBounds.containsLonLat(this.lonlat);
|
||||
}
|
||||
return onScreen;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @returns A Marker Object created from the 'lonlat' and 'icon' properties
|
||||
|
||||
Reference in New Issue
Block a user