i'm trying figure out how display dynamic markers in form of list within separate div using openlayers, i'm hoping display seen within current view. means whenever map moved, list of marker info changes. have suggestions achieving this? i'm still learning openlayers, apologize if answer question should obvious. thank in advance.
you register map's moveend
event , check features displayed using onscreen()
method.
var map = new openlayer.map( ... ); var layer = new openlayers.layer.vector( ... ); map.events.register('moveend', this, function() { var displayedfeatures = []; (var i=0, len=layer.features.length; i<len; i++) { var feature = layer.features[i]; if (feature.onscreen()) displayedfeatures.push(feature); } //do somthing displayedfeatures });
Comments
Post a Comment