<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I succes to put the searcher in my map as the example, but I don't have OSM. </div><div>
There's any way to modify it to search my own Layers? </div><div><br></div><div>I have layers from Geoserver, </div><div>
I've tried this way but only search Cities names instead of names of the fields of my layers, I don't understand why.</div><div><br></div><div><br></div><div><br></div><div>//the layer that I want to be searchable</div>
<div><br></div><div><div>var Projectes = new OpenLayers.Layer.WMS(</div><div><span style="white-space:pre-wrap">                                        </span>"Projectes",</div><div><span style="white-space:pre-wrap">                                        </span>"<a href="http://localhost:8080/geoserver/AUMA/wms" target="_blank">http://localhost:8080/geoserver/AUMA/wms</a>",</div>
<div><span style="white-space:pre-wrap">                                        </span>{</div><div> layers: 'AUMA:Projectes',</div><div><span style="white-space:pre-wrap">                                        </span> transparent:true,</div>
<div><span style="white-space:pre-wrap">                                        </span> format: 'image/png'},</div><div><span style="white-space:pre-wrap">                                        </span> {</div><div><span style="white-space:pre-wrap">                                        </span> isBaseLayer:false, </div>
<div><span style="white-space:pre-wrap">                                        </span> buffer: 0</div><div><span style="white-space:pre-wrap">                                        </span>});</div></div><div><br></div><div>//the mapPanel with baselayers and the searching code inside the toolbar</div>
<div><br></div><div><div>mapPanel = new GeoExt.MapPanel({</div><div> border: true,</div><div> region: "center",</div><div><span style="white-space:pre-wrap">                </span>map: map,</div>
<div> height: 500,</div><div> width: 800,</div><div><span style="white-space:pre-wrap">                </span>title: 'Estudis i enginyeries',</div><div><span style="white-space:pre-wrap">                </span>zoom: 1,</div>
<div><span style="white-space:pre-wrap">                </span>maxExtent: new OpenLayers.Bounds(-90, -180, 90, 180),</div><div><span style="white-space:pre-wrap">                </span>center: new OpenLayers.LonLat (-3,0),</div>
<div><span style="white-space:pre-wrap">                </span>bbar: [escala,' ',zoomSelector,' ',Projection,' ',cordX,' ',cordY],</div><div><span style="white-space:pre-wrap">                </span></div>
<div><br></div><div><b>tbar:</b> [toolbarItems,<b>{ </b></div><div><b> xtype:"gx_geocodercombo",</b></div><div><b> emptyText: "Search GeoNames",</b></div><div><b><span style="white-space:pre-wrap">                        </span>layer: Projectes,</b></div>
<div><b> width: 200</b></div><div><b> }</b>],</div><div><span style="white-space:pre-wrap">                </span>layers: [</div><div> new OpenLayers.Layer.WMS(</div><div><span style="white-space:pre-wrap">                                </span>"BlueMarble", "<a href="http://www.opengis.uab.es/cgi-bin/world/MiraMon.cgi" target="_blank">http://www.opengis.uab.es/cgi-bin/world/MiraMon.cgi</a>?",</div>
<div><span style="white-space:pre-wrap">                                </span>{</div><div><span style="white-space:pre-wrap">                                </span>layers:['BlueMarble_NG','admin_level1-world']</div><div><span style="white-space:pre-wrap">                                </span>}, {</div>
<div> buffer: 0,</div><div> visibility: false</div><div> }</div><div> ),</div><div><span style="white-space:pre-wrap">                        </span></div><div>
<span style="white-space:pre-wrap">        </span> </div><div><span style="white-space:pre-wrap">                        </span>new OpenLayers.Layer.WMS(</div><div><span style="white-space:pre-wrap">                                </span>"OpenLayers WMS", "<a href="http://vmap0.tiles.osgeo.org/wms/vmap0" target="_blank">http://vmap0.tiles.osgeo.org/wms/vmap0</a>",</div>
<div><span style="white-space:pre-wrap">                                </span>{</div><div><span style="white-space:pre-wrap">                                </span>layers:['basic']</div><div><span style="white-space:pre-wrap">                                </span>},{</div>
<div> buffer: 0,</div><div> visibility: false</div><div> }</div><div><span style="white-space:pre-wrap">                                </span>),</div><div><span style="white-space:pre-wrap">                                        </span> </div>
<div><span style="white-space:pre-wrap">                        </span>Projectes ]</div><div> });</div></div><div><br></div><div>Thanks a lot for your help!</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><a href="http://kikocanas.blogspot.com" target="_blank">http://kikocanas.blogspot.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><a href="http://kikocanas.blogspot.com" target="_blank">http://kikocanas.blogspot.com</a><br>