[Users] why are my Search form results not georeferenced?

Daniel.Behr at hzg.de Daniel.Behr at hzg.de
Sat Jul 9 17:05:21 CEST 2011


Hi Robert,
have you tried this:

var layer_wea = new OpenLayers.Layer.Vector("Windkraftanlagestandort", {
        styleMap: style_wea,
//        projection: "EPSG:4326", // <--- I think you dont need this 
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.WFS({
            url: "http://maps.zgb.de/geoserver/wfs?",
            version: "1.1.0",
            featureType: "wea_wgs84",
            featureNS: "http://www.zgb.de/postgis",
            srsName: "EPSG:900913" // <--- = your basemap SRS
        }),

cheers
Daniel

-----users-bounces at geoext.org schrieb: -----
An: users at geoext.org
Von: Robert Buckley 
Gesendet von: users-bounces at geoext.org
Datum: 09.07.2011 11:46AM
Betreff: [Users] why are my Search form results not georeferenced?

Hi,

After trying to install a search form into my project, I have had limited success. I can run the search and get correct results. The only problem is that all results are positioned at 0,0 off the coase of Africa and not where they are supposed to be.

I have obviously overlooked something rudimentary here. This type of issue is usually due to the wrong SRS being assigned, but if this were the case, why does the grid work fine before the search is actived?

To understand the problem try it out here.

http://maps.zgb.de/www/eeg/eeg_portal.html


Here is the code for the search. I am using the protocol from the source layer "layer_wea".

//layer_wea
var layer_wea = new OpenLayers.Layer.Vector("Windkraftanlagestandort", {
        styleMap: style_wea,
        projection: "EPSG:4326",
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.WFS({
            url: "http://maps.zgb.de/geoserver/wfs?",
            version: "1.1.0",
            featureType: "wea_wgs84",
            featureNS: "http://www.zgb.de/postgis",
            srsName: "EPSG:4326"
        }),
        eventListeners: {
            featuresadded: function () {
                var extent_wea = layer_wea.getDataExtent();
                mapPanel_wea.map.zoomToExtent(extent_wea);
            }
        }
    });

//search
    // create a GeoExt form panel (configured with an OpenLayers.Protocol
        // instance)
        
        
      var features = new Array();
      var formPanel = new GeoExt.form.FormPanel({
            width: 300,
            height: 200,
            region: "west",
            protocol: layer_wea.protocol,
            items: [{
                xtype: "textfield",
                name: "bez__like",
                value: "WF*",
                fieldLabel: "bez"
            }],
            listeners: {
                actioncomplete: function(form, action) {
                    // this listener triggers when the search request
                    // is complete, the OpenLayers.Protocol.Response
                    // resulting from the request is available
                    // through "action.response"
                   features = action.response.features;
                   store_wea.loadData(features);
                  
                }
            }
        });
        formPanel.addButton({
            text: "search",
            handler: function() {
                this.search();
            },
            scope: formPanel
        });
        
        var searchwin = new Ext.Window({
        title: "wfs search",
        layout: 'fit',
        width: 200,
        x:300,
        collapsible: true,
        height: 100,
        closeAction: 'hide',
        plain: true,
        items: [formPanel]
    });



If anyone has any clues i´d be grateful,

yours,

Rob

_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users


Helmholtz-Zentrum Geesthacht
Zentrum für Material- und Küstenforschung GmbH
Max-Planck-Straße 1
21502 Geesthacht
Deutschland/Germany

Geschäftsführer/Board of Management: Prof. Dr. Wolfgang Kaysser, Dipl.-Ing. Michael Ganß 
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Ministerialrat Wilfried Kraus

Amtsgericht Lübeck  HRB 285 GE (Register Court)
Internet: http://www.hzg.de


ACHTUNG - ATTENTION

Die Helmholtz-Zentrum Geesthacht Zentrum für Material- und Küstenforschung GmbH
hieß bis zum 1. November 2010 GKSS-Forschungszentrum Geesthacht GmbH.

Until 1st November 2010 the Helmholtz-Zentrum Geesthacht Zentrum für Material- und Küstenforschung GmbH was officially called GKSS-Forschungszentrum Geesthacht GmbH.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110709/4b4bd038/attachment-0001.htm 


More information about the Users mailing list