[OpenLayers-Users] Re: How to apply a Search Function

Diego M. oo_O2_oo at hotmail.com
Sat Feb 11 01:05:43 EST 2012


*
yesss I got the idea.
it seems great!
also i will follow your advice "display the layer with WMS" after the search
function completed.

but now when i enter the text to search (id), all features are displayed
again. not just what i searched for.

am not sure what's wrong

*

var vessels = new OpenLayers.Layer.Vector("The Vessels", { 
displayOutsideMaxExtent: true, 
styleMap: new OpenLayers.StyleMap(style),
maxExtent: new OpenLayers.Bounds(-180, -90,
180,90)transform(geographic,mercator), 
sphericalMercator: true,
strategies: [strategy],	//BBOX strategy	   			   
protocol: wfsprotocol
			   });

*and the other parts are exactly as you wrote*

vessels.destroyFeatures();
vessels.addFeatures(request.features); 
map.zoomToExtent(sExt); 




<input type="submit" value="Search" />
<input type="text"  name="Search" id="searchText" value="Enter the id "
style="text-align:right" maxlength="100" />

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-apply-a-Search-Function-tp4364140p4459172.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list