<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Microsoft Sans Serif";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1478305886;
        mso-list-type:hybrid;
        mso-list-template-ids:-1637859598 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#254061'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Microsoft Sans Serif","sans-serif";color:blue'>need technical help/ guidance on OpenLayers. We’re stuck with following technical issue and seeking technical help/ advice for resolving the same.<o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='color:#254061'><o:p> </o:p></span></b></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-US style='font-family:Symbol;color:#254061'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span lang=EN-US style='color:#254061'>We are using Wms services (layers published via Geoserver), to display point, line and polygon features onto the map.<o:p></o:p></span></p><p class=MsoNormal style='text-indent:36.0pt'><span lang=EN-US style='color:#254061'>We are using the OpenLayers property “</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>new</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> OpenLayers.Layer.WMS()”, </span><span lang=EN-US style='color:#254061'>for displaying the layers.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#254061'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-US style='font-family:Symbol;color:#254061'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span lang=EN-US style='color:#254061'>However, the problem that we are facing is in using </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>OpenLayers.Control.GetFeature </span><span lang=EN-US style='color:#254061'>control. We have to perform a selection using BBox(drag box) and have used <o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>the following code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#254061'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='color:#254061'>                </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>control_select = <span style='color:blue'>new</span> OpenLayers.Control.GetFeature({<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>        protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layerName),<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>        box: <span style='color:blue'>true</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>        hover: <span style='color:blue'>true</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>        multipleKey: <span style='color:#A31515'>"shiftKey"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>        toggleKey: <span style='color:#A31515'>"ctrlKey"<o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>    });<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#254061'>This control is then added to the map.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#254061'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-US style='font-family:Symbol;color:#254061'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span lang=EN-US style='color:#254061'>The point feature selection works perfectly but when we select just one line feature, it happens to select many line features (sometimes more than 30 line features!).<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>Most of the lines are not even close or connected to the selected line feature!<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>We are using the </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>"featureselected"</span><span lang=EN-US style='color:#254061'> event to capture the selection made by the drag box. <o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>Syntax:- “</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>control_select.events.register(<span style='color:#A31515'>"featureselected"</span>, <span style='color:blue'>this</span>, <span style='color:blue'>function</span>(e) {}“<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-US style='font-family:Symbol;color:#254061'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span lang=EN-US style='color:#254061'>We tried to debug OpenLayers.js. It has a predefined set of Geometry types:<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:blue'>var</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'> order=[<span style='color:#A31515'>"MultiPolygon"</span>,<span style='color:#A31515'>"Polygon"</span>,<span style='color:#A31515'>"<span style='background:yellow;mso-highlight:yellow'>MultiLineString</span>"</span>,<span style='color:#A31515'>"LineString"</span>,<span style='color:#A31515'>"MultiPoint"</span>,<span style='color:#A31515'>"Point"</span>,<span style='color:#A31515'>"Envelope"</span>]<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>We have a table (for the line feature), that has a shape field as Multiline, which is then converted to Oracle Spatial format and then web services are created.<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>After the drag box is created, Openlayers identifies the selected feature as “MultiLineString” and somehow relates many other line features to create a tree structure.<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>It forms one parent node and this node has a nextSibling, which is another line feature. In this way, it creates a hierarchy of “nextSibling” for every previous Sibling, thus <o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='color:#254061'>selecting a huge range of line features!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#254061'><o:p> </o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-US style='font-family:Symbol;color:#254061'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>         </span></span></span><![endif]><span lang=EN-US style='color:#254061'>There is an array called “features” created by OpenLayers, where it pushes all the obtained features from the node:- “</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>obj.features.push(feature);”</span><span lang=EN-US style='color:#254061'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US style='color:#254061'>Depending on the length of the array</span><span lang=EN-US>, “</span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>featureselected” </span><span lang=EN-US style='color:#254061'>event is fired that many times thus returning all the features instead of only the selected ones.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'>Regards</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'>,</span><span lang=EN-US style='font-family:"Arial","sans-serif";color:navy'> <br></span><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'>Manish Barapatre <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:navy'>Office: 01473 650516<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>