<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>@font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@font-face {
font-family: Tahoma;
}
@page WordSection1 {margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0in 0in 0pt
}
LI.MsoNormal {
FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0in 0in 0pt
}
DIV.MsoNormal {
FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman","serif"; MARGIN: 0in 0in 0pt
}
A:link {
TEXT-DECORATION: underline; COLOR: blue
}
SPAN.MsoHyperlink {
TEXT-DECORATION: underline; COLOR: blue
}
A:visited {
TEXT-DECORATION: underline; COLOR: purple
}
SPAN.MsoHyperlinkFollowed {
TEXT-DECORATION: underline; COLOR: purple
}
SPAN.EmailStyle17 {
FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d
}
.MsoChpDefault {
FONT-SIZE: 10pt
}
</style><style id="owaParaStyle">P {
MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple" fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p>Ok, I tried that earlier today and it didn't work so maybe I just have a bug. I did verify that the features are actually being marked as selected on the layer, I'm just not getting the callback. I'll take a closer look next week when I'm back it the office.
Are you getting the featureselected event from the layer or the onSelect callback from the SelectFeature control? Thanks Jerome.
</p>
<p> </p>
<p>If anybody has a good explanation of what standalone mode means or when to use it I'm still interested though.</p>
<div style="FONT-SIZE: 16px; FONT-FAMILY: Times New Roman; COLOR: #000000">
<hr tabindex="-1">
<div id="divRpF528009" style="DIRECTION: ltr"><font color="#000000" size="2" face="Tahoma"><b>From:</b> Jerome A. Wendell [jawendell@suddenlink.net]<br>
<b>Sent:</b> Wednesday, February 04, 2015 7:10 PM<br>
<b>To:</b> Ruff, Thomas; openlayers-users@lists.osgeo.org<br>
<b>Subject:</b> RE: [OpenLayers-Users] feature selection events with ModifyFeature control<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d">Tom,</span></p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d"></span> </p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d">I am using a ModifyFeature control in a similar way in OL 2.13. I have standalone set to false. I had to setup a SelectFeature control on the same layer
for my layer event functions to work.</span></p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d"></span> </p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d">Hope this helps!</span></p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d"></span> </p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d">Jerome Wendell</span></p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d"></span></p>
<p class="MsoNormal"><span style="FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d"></span> </p>
<div>
<div style="BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0in; PADDING-TOP: 3pt; PADDING-LEFT: 0in; BORDER-LEFT: medium none; PADDING-RIGHT: 0in">
<p class="MsoNormal"><b><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"">From:</span></b><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif""> openlayers-users-bounces@lists.osgeo.org [mailto:openlayers-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Ruff, Thomas<br>
<b>Sent:</b> Wednesday, February 04, 2015 7:30 PM<br>
<b>To:</b> openlayers-users@lists.osgeo.org<br>
<b>Subject:</b> [OpenLayers-Users] feature selection events with ModifyFeature control</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal"><span style="COLOR: black">Could anyone clarify the way feature selection works in OL 2.13. Currently I'm using a ModifyFeature control that is not configured for standalone mode. The user clicks features using the mouse and this effectively
sets the select render intent on the feature. The user can also select features from a grid control, in which case I call modifyFeature.selectFeature(featureRef), which also sets the select render intent for the feature. That all works fine, but now I need
to handle selectfeature events and do some extra stuff but when I registered a handler on the layer for the featureselected event like this:</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span> </p>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">layer.events.on({"featureselected": onFeatureSelectedHandler});</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span> </p>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">it never gets called. So I found this link
<a href="https://github.com/openlayers/openlayers/issues/972" target="_blank">https://github.com/openlayers/openlayers/issues/972</a> that says this is not a bug I but still really don't understand standalone vs non-standalone mode. </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span> </p>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">I also tried adding a selectFeature control and supplying a callback function like this:</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span> </p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; COLOR: black">selectFeatureControl = new OpenLayers.Control.SelectFeature([layer],</span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; COLOR: black"> { onSelect: function () { console.info("selectFeature.onselect fired"); } }</span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; COLOR: black">);</span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; COLOR: black">map.addControls([modifyFeatureControl, selectFeatureControl]);</span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; COLOR: black"></span> </p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">but that didn't work either.</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span> </p>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">What do I need to do in order to be able to receive selectFeature events and still do the other stuff described above? Should I use standalone or non-standalone mode? Do I have to use a selectFeature control
regardless of the mode if I want an event to fire when a feature becomes selected?</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span> </p>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">Thanks,</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="COLOR: black">Tom</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black"></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>