[OpenLayers-Users] Selecting a feature programmatically?

Phil Maloney pj_maloney at hotmail.com
Fri Nov 21 10:52:20 EST 2008


Thanks Arnd, that worked perfectly.

From: arnd.wippermann at web.deTo: pj_maloney at hotmail.comCC: users at openlayers.orgSubject: AW: [OpenLayers-Users] Selecting a feature programmatically?Date: Thu, 20 Nov 2008 22:08:06 +0100


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: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im Auftrag von Phil MaloneyGesendet: Donnerstag, 20. November 2008 12:19An: users at openlayers.orgBetreff: [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 now
_________________________________________________________________
BigSnapSearch.com - 24 prizes a day, every day - Search Now!
http://clk.atdmt.com/UKM/go/117442309/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081121/87f553ef/attachment.html


More information about the Users mailing list