Hi, i save in a drop down list the index of the features and for selecting i use ctrlSelectFeature.select(lyr.features[idx]); (with ctrlSelectFeature = new OpenLayers.Control.SelectFeature(lyr, ctrlSelectFeatureOptions);)
Arnd Wippermann _____ Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Phil Maloney Gesendet: Donnerstag, 20. November 2008 12:19 An: [email protected] Betreff: [OpenLayers-Users] Selecting a feature programmatically? Hi, An OpenLayers newbie here, so apologies if I've skipped across this subject being covered else where. I am building a large-scale mapping interface allowing users to draw and edit polygons. I want to list the polygons drawn (aka Google MyMaps style) outside the map so the user can : - Hover list items to highlight corresponding polygons on the map - Click a list item to switch the corresponding polygon to "edit" mode In essence, what is required to link external HTML to a polygon feature on the map? Code sample: function listPolygon(event){ var html = "<a href=\"JavaScript:editPolygon('"+event.feature.id+"')\">"+event.feature.id+" </a>"; document.getElementById("polygonlist").innerHTML += html + "<br>"; } function editPolygon(e){ controls.select.select(e) } var vectors = new OpenLayers.Layer.Vector("Vector Layer"); vectors.events.on({featureadded": listPolygon}); I've attempted to use the selectControl.select method to achieve this with the feature ID...but this is obviously not the correct way of achieving this. Any pointers appreciated. Phil _____ BigSnapSearch.com - 24 prizes a day, every day. Search <http://clk.atdmt.com/UKM/go/117442309/direct/01/> now
_______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
