[Users] Geoext search?
Zoran Jankovic
zoran.m.jankovic at gmail.com
Sun Feb 14 18:46:15 CET 2010
On Sun, Feb 14, 2010 at 5:19 PM, Bart van den Eijnden <bartvde at osgis.nl>wrote:
> Hi Zoran,
>
> basically it just uses WFS Web Feature Service under the hood. So you need
> to understand that protocol.
>
>
I have already looked into it.
> If you have your geoserver running, try and do a GetFeature request with
> maxfeatures 10 on your layer/featuretype to ensure things are properly
> working on that side, so e.g.
>
>
> http://foo/geoserver?service=WFS&request=GetFeature&typename=xxx&maxfeatures=10&version=1.1.0
>
>
On my version of Geoserver, and by following their documentation this
request should go like this:
http://192.168.1.150:8080/geoserver/wfs?request=GetFeature&typeName=topp:states&maxfeatures=10&outputFormat=GML2&version=1.1.0
(although maxfeature parameter doesn't seem to have any effect...)
After that configure your OpenLayers protocol which will be used by GeoExt
> search components.
>
Yup, I have reconfigured the code from example to use my local Geoserver, no
problem there.
>
> Also, if you have not already done so, install Firebug to see the request
> response cycle.
>
This was actually my first step. Everyone seems to recommend Firebug, as
soon as you mention "javascript" :-).
I'm still a long way away from searching through my data :-). I find this
quite frustrating. There are some examples with basic functionality, but
anything more complicated than overlaying your data over google Maps... good
luck finding that! I understand that people capable of coding such a
function do not want to "open their cards" completely, and give away for
free their hard earned knowledge, but I find it almost impossible to work
through existing documentation, and as much as I would like to _pay_ someone
to teach me these things, I haven't found anyone to pay to... As I can see,
only OpenGeo is giving commercial support, and this is only "face to face",
no "e-learning" solution...
Best regards and thanks for all your help!
Zoran
On Feb 14, 2010, at 5:13 PM, Zoran Jankovic wrote:
>
>
>
>
> On Sun, Feb 14, 2010 at 4:56 PM, Bart van den Eijnden <bartvde at osgis.nl>wrote:
>
>> Hi Zoran,
>>
>> ok, I see now, indeed you need to use Ext.form.FormPanel, ignore my
>> previous post about that.
>>
>> The other problem you reported (ct is undefined), is because you are
>> running your javascript code before the DOM is ready, and your div is simply
>> not yet there. So use Ext.onReady instead to wrap your code, something like:
>>
>> Ext.onReady(
>> function() {
>> var formPanel = new Ext.form.FormPanel({
>> renderTo: "formpanel",
>> items: [{
>> xtype: "textfield",
>> name: "name__like",
>> value: "mont"
>> }, {
>> xtype: "textfield",
>> name: "elevation__ge",
>> value: "2000"
>> }]
>> });
>>
>> var searchAction = new GeoExt.form.SearchAction(formPanel.getForm(), {
>> protocol: new OpenLayers.Protocol.WFS({
>> url: "http://publicus.opengeo.org/geoserver/wfs",
>> featureType: "tasmania_roads",
>> featureNS: "http://www.openplans.org/topp"
>> }),
>> abortPrevious: true
>> });
>>
>> formPanel.getForm().doAction(searchAction, {
>> callback: function(response) {
>> // response.features includes the features read
>> // from the server through the protocol
>> }
>> });
>>
>> });
>>
>> Best regards,
>> Bart
>>
>>
>> OK, now we are getting somewhere :-). Finally I have something rendered in
> my DIV, although it's just two text fields, now at least I'm making some
> progress...
> Is there _anywhere_ a working example of this Search action? As I in a
> previous post, I have SHP as a layer in Geoserver, and I need to search
> through "names" attribute and display the result...
> I found Geonames example, but it's a definitive overkill for my needs, at
> least for now, and at this stadia of JS knowledge ;-).
>
> BTW, that link "Test it!" under geoext.blogspot.com (UX introduction) is
> also broken:
>
> http://dev.geoext.org/ux/GeoNamesSearchCombo/examples/GeoNamesSearchComboExample.html
>
> Previous link will get you nowhere, you have to start from
> http://dev.geoext.org/ux and work your way through to find this example:
>
> http://dev.geoext.org/ux/geoext.ux/ux/GeoNamesSearchCombo/examples/GeoNamesSearchComboExample.html
>
> BR,
>
>
>
>> ---
>> Zoran Jankovic
>> ZIS-Izrada softvera i savjetovanje / ZIS - Software Development and
>> Consulting
>>
>> http://www.zisis.hr
>>
>> M: 00 385 98 682 902
>> T: 00 385 44 683 374
>>
>> A. Senoe 4
>> 44320 Kutina
>> Croatia
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20100214/d39f6cd3/attachment.htm
More information about the Users
mailing list