I've crated a map and tried, but it doesn't change until another event is caught or zooming map or by switching the browser tabs. What is the reason for this. please help me I've fiddle the code here http://jsfiddle.net/HMFLf/.
This is what I've done to change marker :
vectorLayer.events.on({
featureselected: function (event) {
var fixer = confirm("Are you want to change clolor this marker");
if (fixer == true) {
size = new OpenLayers.Size(21, 25);
event.feature.style = { externalGraphic: "http://www.openlayers.org/dev/img/marker.png", graphicHeight: 25, graphicWidth: 21, graphicXOffset: -((size.w / 2) - 2), graphicYOffset: -(size.h - 2) };
}
}
});
Thanks in advance.