OpenLayers vertices disappear (lose style?) when programmatically unselected

المشرف العام

Administrator
طاقم الإدارة
boundaryStyleMap: ( -> styleMap = new OpenLayers.StyleMap 'default': @get('activeStyle') 'select': @get('editStyle') 'temporary': @get('editStyle') 'vertex': @get('vertexStyle') styleMap ).property('activeStyle') boundaryLayer: ( -> new OpenLayers.Layer.Vector I18n.t('boundary_map.layers.current', model: I18n.t('activerecord.models.' + @get('currentType') + '.one')), renderers: OpenLayers.Layer.Vector.prototype.renderers sphericalMercator: true maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34) styleMap: @get('boundaryStyleMap') ).property('boundaryStyleMap') activeStyle: ( -> label = @get('currentModel.name') isNew = @get('currentModel.isNew') style = fillOpacity: .6 fillColor: '#178D64' strokeOpacity: .9 strokeColor: '#FFFFFF' strokeWidth: 3 fontColor: '#FFFFFF' labelOutlineColor: '#000000' labelOutlineWidth: 5 fontWeight: 'bold' fontSize: 16 strokeDashstyle: 'solid' style.label = label if (@get('currentType') isnt 'grower') or isNew style ).property('currentModel') editStyle: fillOpacity: .25 fillColor: '#000000' strokeOpacity: .9 strokeColor: '#FFFFFF' strokeWidth: 3 pointRadius: 14 graphicName: 'circle' vertexStyle: fillColor: '#000000' pointRadius: 14 graphicName: 'circle' label: null

On the ModifyFeature control I set vertexRenderIntent: 'vertex'.

On the map's featureclick event I do some custom logic, first unselecting all features, before selecting the one clicked. While the newly selected vertex changes style and is still visible, the one(s) unselected disappears. Seems like programmatically unselecting a selected vertex puts it into an intent/style I'm not expecting...

What I would expect to happen, is that the previously selected vertex goes back to its original style - same style it became when the shape was clicked.

Other info:

After making the edit and vertex styles have different graphicName (icon), I can see that when the polygon is clicked/selected, the vertices have the vertexStyle. Once a vertex is clicked, it gets the editStyle. Once it's unselected in code, it just disappears.



أكثر...
 
أعلى