<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">I don'<font style="font-size: 10pt;" size="2">t work</font> with Geoserver, but <font style="font-size: 10pt;" size="2">where do <font style="font-size: 10pt;" size="2">you call <font style="font-size: 10pt;" size="2">your <font style="font-size: 10pt;" size="2">features?</font></font></font></font> and <font style="font-size: 10pt;" size="2">definitely</font> you need GetFeature for this<font style="font-size: 10pt;" size="2">. About <font style="font-size: 10pt;" size="2">the "0" problem, is<font style="font-size: 10pt;" size="2"> it perhaps <font style="font-size: 10pt;" size="2">you have hover and b<font style="font-size: 10pt;" size="2">ox as false? </font></font></font></font></font><br id="FontBreak"></font><br><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: jawendell@digitalmapping.com<br>To: rajjad@gmail.com<br>CC: gamejihou@hotmail.com; openlayers-users@lists.osgeo.org<br>Subject: RE: [OpenLayers-Users] Highlight Features from WMS Layer<br>Date: Mon, 4 Mar 2013 14:23:14 -0500<br><br><style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink {
color:blue;
text-decoration:underline;
}
.ExternalClass span.ecxMsoHyperlinkFollowed {
color:purple;
text-decoration:underline;
}
.ExternalClass p {
font-size:12.0pt;
font-family:"Times New Roman","serif";
}
.ExternalClass pre {
font-size:10.0pt;
font-family:Consolas;
}
.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate {
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
}
.ExternalClass span.ecxBalloonTextChar {
font-family:"Tahoma","sans-serif";
}
.ExternalClass span.ecxEmailStyle20 {
font-family:"Calibri","sans-serif";
color:#1F497D;
}
.ExternalClass span.ecxHTMLPreformattedChar {
font-family:Consolas;
}
.ExternalClass .ecxMsoChpDefault {
}
.ExternalClass div.ecxWordSection1 {
}
--></style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Imran,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Thanks for the input. I have added a GetFeature control and a highlight layer based on </span><a href="http://openlayers.org/dev/examples/getfeature-wfs.html" target="_blank">http://openlayers.org/dev/examples/getfeature-wfs.html</a> <span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">as follows:</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> styleMap: myStyles,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> displayInLayerSwitcher: false,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> isBaseLayer: false</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> }</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> );</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">var highlightControl = new OpenLayers.Control.GetFeature({</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> box: false,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> hover: false,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> maxFeatures: 20</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> });</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> highlightControl.events.register("featureselected", this, function(e) {</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> highlightLayer.addFeatures([e.feature]);</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> });</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> highlightControl.events.register("featureunselected", this, function(e) {</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> highlightLayer.removeFeatures([e.feature]);</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> });</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">map.addControl(highlightControl);</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">highlightControl.activate();</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">The selected features are not being added to the highlightLayer layer. According to Firebug, the numberOfFeatures="0". Do you have any idea why there are no features being returned? I use geoserver and WFS is enabled.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Thanks,</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;">Jerome</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;"> </span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;"><p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";"> Imran Rajjad [mailto:rajjad@gmail.com] <br><b>Sent:</b> Monday, March 04, 2013 2:08 PM<br><b>To:</b> jawendell@digitalmapping.com<br><b>Cc:</b> Gery .; OpenLayers User List<br><b>Subject:</b> Re: [OpenLayers-Users] Highlight Features from WMS Layer</span></p></div><p class="ecxMsoNormal"> </p><p class="ecxMsoNormal">hi,</p><div><p class="ecxMsoNormal"> </p></div><div><p class="ecxMsoNormal">to make highlighting work, you will need to put your features in a vector layer anyway..</p></div><div><p class="ecxMsoNormal">regards,</p></div><div><p class="ecxMsoNormal">Imran</p></div><div><p class="ecxMsoNormal"> </p><div><p class="ecxMsoNormal">On Mon, Mar 4, 2013 at 11:32 PM, Jerome A. Wendell <<a href="mailto:jawendell@digitalmapping.com" target="_blank">jawendell@digitalmapping.com</a>> wrote:</p><div><div><p class="ecxMsoNormal" style=""><span style="color:#1F497D;">Gery,</span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;"> </span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;">Thanks for your reply. I have been searching a number of sites for the answer, but did not really find a definite answer. So, now I know I need to add another control.</span></p><div><p class="ecxMsoNormal" style=""><span style="color:#1F497D;"> </span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;">I appreciate your help.</span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;"> </span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;">Jerome</span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;"> </span></p><p class="ecxMsoNormal" style=""><span style="color:#1F497D;"> </span></p></div><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;"><p class="ecxMsoNormal" style=""><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";"> Gery . [mailto:<a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a>] <br><b>Sent:</b> Monday, March 04, 2013 12:41 PM</span></p><div><p class="ecxMsoNormal"><br><b>To:</b> <a href="mailto:jawendell@digitalmapping.com" target="_blank">jawendell@digitalmapping.com</a><br><b>Cc:</b> OpenLayers User List<br><b>Subject:</b> Re: [OpenLayers-Users] Highlight Features from WMS Layer</p></div></div></div><p class="ecxMsoNormal" style=""> </p><div><p class="ecxMsoNormal" style="">I think so, there are several posts about that in <a href="http://gisexchange.com" target="_blank">gisexchange.com</a><br><br>Sent from my iBath</p></div><div><div><p class="ecxMsoNormal" style=""><br>On Mar 4, 2013, at 18:18, "Jerome A. Wendell" <<a href="mailto:jawendell@digitalmapping.com" target="_blank">jawendell@digitalmapping.com</a>> wrote:</p></div><div><p class="ecxMsoNormal" style="">I have a control using WMSGetFeatureInfo that displays attributes of the selected features from a WMS layer in a popup. I have tried unsuccessfully to also highlight the features selected in that same control by adding them to a highlight layer. Do I need a separate control using GetFeature in order to highlight the selected features?</p><p class="ecxMsoNormal" style=""> </p><p class="ecxMsoNormal" style="">Any help would be greatly appreciated.</p><p class="ecxMsoNormal" style=""> </p><p class="ecxMsoNormal" style="">Thanks.</p><p class="ecxMsoNormal" style=""> </p></div><div><p class="ecxMsoNormal" style="">_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">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></p></div></div></div></div><p class="ecxMsoNormal" style=""><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">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></p></div><p class="ecxMsoNormal"><br><br clear="all"></p><div><p class="ecxMsoNormal"> </p></div><p class="ecxMsoNormal">-- <br>I.R </p></div></div></div> </div></body>
</html>