<html><head><style type=text/css><!--
.mcnt p.mcntMsoNormal, .mcnt li.mcntMsoNormal, .mcnt div.mcntMsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";}
.mcnt a:link, .mcnt span.mcntMsoHyperlink {mso-style-priority:99;color:blue;text-decoration:underline;}
.mcnt a:visited, .mcnt span.mcntMsoHyperlinkFollowed {mso-style-priority:99;color:purple;text-decoration:underline;}
.mcnt span.mcntEmailStyle17 {mso-style-type:personal-compose;font-family:"Calibri","sans-serif";color:windowtext;}
.mcnt .mcntMsoChpDefault {mso-style-type:export-only;}
.mcnt div.mcntWordSection1 {page:WordSection1;}
.mcnt a {color:blue;}
.mcnt a:visited {color:purple;}

--></style></head><body>You have to define a select renderIntent with the wanted visuals for highlighting.<br>For example, at creating the vectorlayer:<br><br>var style = new OpenLayers.Style(<br>// the first argument is a base symbolizer<br>// all other symbolizers in rules will extend this one<br>{<br>    graphicWidth: 21,<br>    graphicHeight: 21,<br>    graphicYOffset: -28, // shift graphic up 28 pixels<br>    label: "${label}",<br>   symbolizer: {<br>            externalGraphic: "../../images/treeview/radio_rood.gif"<br>        }<br>}<br>}<br>);<br>var selectstyle = new OpenLayers.Style(<br>// the first argument is a base symbolizer<br>// all other symbolizers in rules will extend this one<br>{<br>    graphicWidth: 31,<br>    graphicHeight: 31,<br>    graphicYOffset: -28, // shift graphic up 28 pixels<br>    label: "${label}",<br>   symbolizer: {<br>            externalGraphic: "../../images/treeview/radio_rood.gif"<br>        }<br>}<br>}<br>);<br><br>this.vectorLayer = new OpenLayers.Layer.Vector("Points", {<br>            styleMap: new OpenLayers.StyleMap( {<br>                "default": style,<br>                "select": selectstyle<br>            })<br>        }<br>        );<br><br>And then (for example) use a selectfeaturecontrol for selecting the features (on <br>var select = new OpenLayers.Control.SelectFeature(this.vectorLayer, {hover: true});<br>this.map.addControl(select);<br>select.activate();<br><br><br>Met vriendelijke groet,<br><br>Meine Toonen<br>B3Partners BV<br>Tel: 030 214 2083<br><br><br><div>Jerome A. Wendell <jawendell@digitalmapping.com> , 15-1-2013 22:24:<br><blockquote class="mcnt" style="margin:0 0 0 .8ex;border-left:2px blue solid;padding-left:1ex;"><div class="mcnt"><p class="mcntMsoNormal">I have a map where I have selected a feature by attribute, and then centered and zoomed to the feature using the following:</p><p class="mcntMsoNormal"> </p><p class="mcntMsoNormal">                vectorlayer.events.register('loadend', vectorlayer, function () {</p><p class="mcntMsoNormal">                                var selfeatures = vectorlayer.getFeaturesByAttribute("description","description");</p><p class="mcntMsoNormal">                                map.setCenter(selfeatures[0].geometry.getCentroid());</p><p class="mcntMsoNormal">                                map.zoomToExtent(selfeatures[0].geometry.getBounds());</p><p class="mcntMsoNormal">                });</p><p class="mcntMsoNormal"> </p><p class="mcntMsoNormal">I am having trouble getting the feature to highlight.  My select control for the map uses a popup.  Could this be the problem?  Do I need a second control to highlight the feature?</p><p class="mcntMsoNormal"> </p><p class="mcntMsoNormal">Any suggestions are appreciated.</p><p class="mcntMsoNormal"> </p><p class="mcntMsoNormal">Thanks,</p><p class="mcntMsoNormal"> </p><p class="mcntMsoNormal">Jerome Wendell</p><p class="mcntMsoNormal"> </p></div><br><br>_______________________________________________
<br>Users mailing list
<br><a href="mailto:Users@lists.osgeo.org" class="mailto">Users@lists.osgeo.org</a>
<br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
<br></blockquote></div></body></html>