<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
If you can narrow down which style properties are unique for
each feature, instead of defining a unique style and use it as
feature.style, you could define custom properties in the feature
attributes to hold the unique values and use them in your context,
as you do with ${type}.<br>
<br>
Here's a copy of the drawFeature method in Layer/Vector.js :<br>
if (typeof style != "object") {<br>
if(!style && feature.state ===
OpenLayers.State.DELETE) {<br>
style = "delete";<br>
}<br>
var renderIntent = style || feature.renderIntent;<br>
style = feature.style || this.style;<br>
if (!style) {<br>
style = this.styleMap.createSymbolizer(feature,
renderIntent);<br>
}<br>
}<br>
<br>
So, the feature style is obtained in that order of priority :<br>
* feature.style<br>
* layer.style<br>
* feature.renderIntent<br>
<br>
In order to let the styleMap manage the feature style, you
should avoid setting the feature.style directly.<br>
<br>
Using this method, your layer styleMap should contain both
default and select keys in order to work properly, with select
containing the additionnal label: "${type}" property set.<br>
<br>
You could try that and see how it goes.<br>
<br>
HTH,<br>
<br>
Alexandre<br>
<br>
<br>
On 12-07-30 02:56 PM, BERÉNYI Attila wrote:<br>
</div>
<blockquote
cite="mid:CAEuci3c31m2fBvggkFg1R9EJd48NmPwiirSX-jLufhFA=24QsA@mail.gmail.com"
type="cite">Hi,
<div><br>
</div>
<div>thank you for your response, it seems like I have not been
clear enough.</div>
<div>If every single vector feature has its own style, the layer's
styleMap object cannot be used (it looks like it is ignored,
check here: <a moz-do-not-send="true"
href="http://gislab.hu/ol/selectFeature-selectStyle-propertyStyle-1.html">http://gislab.hu/ol/selectFeature-selectStyle-propertyStyle-1.html</a>)
that's why I try to use selectStyle.</div>
<div>I've update the original example as well: <a
moz-do-not-send="true"
href="http://gislab.hu/ol/selectFeature-selectStyle-propertyStyle.html">http://gislab.hu/ol/selectFeature-selectStyle-propertyStyle.html</a>.</div>
<div><br>
</div>
<div>
BR,</div>
<div>Attila</div>
<div>
<div><br>
<div class="gmail_quote">2012/7/30 Alexandre Dubé <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:adube@mapgears.com" target="_blank">adube@mapgears.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi,<br>
<br>
Instead of defining a selectStyle in the control,
you could try setting a styleMap to your layer
object. This example should point you to the right
direction since it uses a '${type}' symbolizer value
and a select control :<br>
<br>
<a moz-do-not-send="true"
href="http://openlayers.org/dev/examples/graphic-name.html"
target="_blank">http://openlayers.org/dev/examples/graphic-name.html</a><br>
<br>
HTH,<br>
<br>
Alexandre<br>
<br>
P.S. Btw, this question would have been more suitable
for the users mailing list.
<div>
<div class="h5"><br>
<br>
<br>
On 12-07-30 05:52 AM, BERÉNYI Attila wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="h5">Hi!
<div><br>
</div>
<div>I wanted to use the selectFeature control's
selectStyle property to display a property-based
label for the selected features, however, it
seems that the selectStyle property doesn't
support property-based styling.</div>
<div>Example here: <a moz-do-not-send="true"
href="http://gislab.hu/ol/selectFeature-selectStyle-propertyStyle.html"
target="_blank">http://gislab.hu/ol/selectFeature-selectStyle-propertyStyle.html</a></div>
<div><br>
</div>
<div>Is this a bug or am I doing something wrong?</div>
<div><br>
</div>
<div>BR,</div>
<div>Attila</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
Dev mailing list
<a moz-do-not-send="true" href="mailto:Dev@lists.osgeo.org" target="_blank">Dev@lists.osgeo.org</a>
<a moz-do-not-send="true" href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre>
<span class="HOEnZb"><font color="#888888"> </font></span></blockquote>
<span class="HOEnZb"><font color="#888888"> <br>
<br>
<pre cols="72">--
Alexandre Dubé
Mapgears
<a moz-do-not-send="true" href="http://www.mapgears.com" target="_blank">www.mapgears.com</a>
</pre>
</font></span></div>
<br>
_______________________________________________<br>
Dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev"
target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
BERÉNYI Attila, PhD<br>
ügyvezető igazgató<br>
<br>
GISLab Hungary Kft.<br>
1031 Budapest, Kadosa utca 59.<br>
+36 20 457 1800<br>
<br>
</div>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Alexandre Dubé
Mapgears
<a class="moz-txt-link-abbreviated" href="http://www.mapgears.com">www.mapgears.com</a>
</pre>
</body>
</html>