[Users] Help... Get WFS Feature
Saha Aswina
sahaaswina at yahoo.com
Sun Dec 5 22:44:23 CET 2010
Thanks Matt,
I don't understand about the importance for geometry field before. When I try your suggest I got error layer not found so I change featureType without ms, and it work like a charm.
Here my final code that work to get feature from MapServer WMS:
var store = new GeoExt.data.FeatureStore({
fields: [
{name: "NAMA_KECAM", type: "string"}
],
proxy: new GeoExt.data.ProtocolProxy({
protocol: new OpenLayers.Protocol.WFS({
url: "/cgi-bin/mapserv?MAP=/home/dharmawa/www/map_file/fix.map",
version: "1.1.0",
featureType: "kecamatan",
featureNS: "http://mapserver.gis.umn.edu/mapserver",
geometry: "msGeometry",
srsName: "EPSG:32749"
})
}),
autoLoad: true
});
Regard,
Saha Aswina
--- Pada Ming, 5/12/10, Matt Priour <mpriour at kestrelcomputer.com> menulis:
> Dari: Matt Priour <mpriour at kestrelcomputer.com>
> Judul: Re: [Users] Help... Get WFS Feature
> Kepada: "Saha Aswina" <sahaaswina at yahoo.com>, users at geoext.org
> Tanggal: Minggu, 5 Desember, 2010, 10:47 AM
> Your feature type and feature
> namespace are wrong. You will also need to specify the
> geometry attribute as well.
>
> here are the relevant parts of the WFS GetFeature response,
> that are not getting read by the response format reader:
> <gml:featureMember>
> <ms:kecamatan
> gml:id="kecamatan.1">
> ....
>
> <ms:msGeometry> ...
> </ms:msGeometry>
> ....
> </ms:kecamatan></gml:featureMember>
>
> so your protocol should have the following properties &
> values
>
> featureType:'ms:kecamatan',
> featureNS:'http://mapserver.gis.umn.edu/mapserver',
> geometry:'msGeometry'
>
> This information should allow the GML feature reader
> spawned by the protocol to read your features since they use
> non-default values
>
> Matt Priour
> Kestrel Computer Consulting
>
> --------------------------------------------------
> From: "Saha Aswina" <sahaaswina at yahoo.com>
> Sent: Saturday, December 04, 2010 1:00 PM
> To: <users at geoext.org>
> Subject: [Users] Help... Get WFS Feature
>
> > Dear everybody,
> >
> > I am new to using GeoExt and OpenLayers. I want to get
> list of feature in my layer, I am using example from http://workshops.opengeo.org/geoext/wfs/grid.html But
> it doesn't work to me to get from my MapServer WFS. This is
> my code:
> >
> > var store =
> new GeoExt.data.FeatureStore({
> >
> fields: [
> >
> {name: "nama_kecam", type: "string"}
> >
> ],
> >
> proxy: new GeoExt.data.ProtocolProxy({
> >
> protocol: new OpenLayers.Protocol.WFS({
> >
> url:
> "/cgi-bin/mapserv?MAP=/home/dharmawa/www/map_file/fix.map",
> >
> version: "1.1.0",
> >
> featureType: "kecamatan",
> >
> featureNS: "http://medford.opengeo.org",
> >
> srsName: "EPSG:32749"
> >
> })
> >
> }),
> >
> autoLoad: true
> > });
> >
> > var gridPanel
> = new Ext.grid.GridPanel({
> >
> title: "Feature Table",
> >
> region: "center",
> >
> viewConfig: {forceFit: true},
> >
> store: store,
> >
> cm: new Ext.grid.ColumnModel({
> >
> defaults: {
> >
> sortable: true
> >
> },
> >
> columns: [
> >
> {header: "Name", dataIndex:
> "nama_kecam"}
> >
> ]
> >
> })
> > });
> >
> > but the grid panel is empty, whats wrong?? No error
> displayed in firebug.
> > the page: http://www.dharmawan.web.id/map2.php
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at geoext.org
> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
> >
>
More information about the Users
mailing list