My task is searching a single house from a layer and then zoom to the center. I did this part but i can't clearly identify this house. I am try to do this by adding a fillcolor to the searched area. but i can't.
var point1 = new OpenLayers.Geometry.Point(mins.x, mins.y);
point1.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
point1.style={fillColor: '#FF0000'};// coloring the point
var point2 = new OpenLayers.Geometry.Point(maxs.x, maxs.y);
point2.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
point2.style={fillColor: '#FF0000'};// coloring the point
var bounds = new OpenLayers.Bounds();
bounds.extend(point1);
bounds.extend(point2);
bounds.toBBOX();
map.zoomToExtent(bounds);
but it can't change the previous color
eg: see this page https://gis.fatih.bel.tr/webgis/default.aspx
Best Answer
What you have done is to define a bounds, and just zoomed to it.
What you need to do, is to create an geometry (either point or polygon), and add it to an empty vector layer. That it will be displayed as a graphic. You can style it according to your needs.
See this jsfiddle