select (click) labels in openlayers

المشرف العام

Administrator
طاقم الإدارة
I have the following style for an OpenLayers vector layer.

Color and Name come from Geoserver/PostGIS.

I red that setting labelSelect to true, user can also click the label, not only the point and fire an event such as featureclick. But no reaction. Clicking the point works, clicking the label does not. For my case, the following code is for points, lines and polys. What am I missing?

Thanks

var style_d = new OpenLayers.Style({ 'fillColor': '${p_color}', 'fillOpacity': 0.8, 'fontColor': 'black', 'pointRadius': 12, 'fontWeight':'bold', 'strokeColor': 'black', 'strokeWidth': 1, 'fontFamily': 'Arial', 'fontSize': 15, 'label': '${p_name}', 'labelAlign': 'tc', 'labelOutlineColor':'white', 'labelOutlineWidth':3, 'labelOutlineOpacity':0, 'labelSelect': true, 'labelXOffset': 4, 'labelYOffset':4});

أكثر...
 
أعلى