Hi,<br><br>somehow my combined select and drag does not work the way I want..<br>for the first time I click on "marker-green" it turns into "marker blue", but after i clicked out and reselect the feature it won't turn to blue. But then it's still draggable.. just the selectControl seems to be deactivated.<br>
<br>And my second question: Is it possible to use both hover and select ? Because turning on hover turns off the normal selectFeature ability...<br><br><br>take a look at the code that is responsible for the above described problem:<br>
<br> var vectors1 = new OpenLayers.Layer.Vector("Vector Layer 1", {<br> styleMap: new OpenLayers.StyleMap({<br> "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({<br>
externalGraphic: "../img/marker-green.png",<br> graphicOpacity: 1,<br> rotation: -45,<br> pointRadius: 10<br> }, OpenLayers.Feature.Vector.style["default"])),<br>
"select": new OpenLayers.Style({<br> externalGraphic: "../img/marker-blue.png"<br> })<br> })<br> });<br><br> map.addLayers([wmsLayer, vectors1]);<br>
map.addControl(new OpenLayers.Control.LayerSwitcher());<br> <br> selectControl = new OpenLayers.Control.SelectFeature(<br> [vectors1],<br> {<br> clickout: true, toggle: false,<br>
multiple: false, hover: false, <br> toggleKey: "ctrlKey", <br> multipleKey: "shiftKey" <br> }<br> );<br> <br>
map.addControl(selectControl);<br> <br> map.setCenter(new OpenLayers.LonLat(0, 0), 3);<br> vectors1.addFeatures(createFeatures());<br><br> var dragFeature = new OpenLayers.Control.DragFeature(vectors1,{}); <br>
<br>
<br> map.addControl(dragFeature);
<br> dragFeature.activate();<br> selectControl.activate();<br><br><br><br>in hope someone could help me..<br>regards<br>mehmet sirin c.<br>