From: Paweł P. <ppa...@gm...> - 2010-03-19 10:04:53
|
Hi! I have made some mistake in my code, and now everything seems to be working great. I add new geometry to the database using savestrategy. I used version 1.1.0 in WFSProtocolOptions. Mikael my code in JS looks like this: var saveStrategy = new OpenLayers.Strategy.Save(); var wfsproba = new OpenLayers.Layer.Vector("Editable Features", { strategies: [new OpenLayers.Strategy.BBOX(),savestrategy], projection: new OpenLayers.Projection("EPSG:4326"), styleMap: wfs_style, protocol: new OpenLayers.Protocol.WFS({ version: "1.1.0", url: "http://localhost:8080/geoserver/wfs", featureNS : "http://www.openplans.org/topp", featureType: "tasmania_roads", }) }); The most important thing is that you add *projection *section in the definition, as I did. Please write to me if it works in your case... BTW I think you should add savestrategy class to the repository, what do you think about that?? Now I am going to figure it out how to delete, and modify feature... Do you know if any of this were implemented in GWT-OL?? I suppose that it was not... Poul W dniu 19 marca 2010 10:25 użytkownik Mikael Couzic < mik...@cl...> napisał: > Hi Poul, > > Did you try to add the version to the WFSProtocolOptions passed as a > parameter to the constructor of WFSProtocol ? > > Mikael > > > > > 2010/3/19 Paweł Pawlak <ppa...@gm...> > >> Hi Hi! >> >> I am using GWT with Openlayers 2.8. My goal is to save, delete and modify >> object from Web Browser. I am using for that Vector layer with WFSProtocol. >> I wrote 'save strategy' class for vector layer, because it has not been >> included into GWT-OL library yet. When I try to save some features to the >> database I got in firebug error: >> * >> <ServiceException> >> java.lang.RuntimeException: Parsing failed for the_geom: >> java.lang.ClassCastException: com.vividsolutions.jts.geom.LineString >> cannot be cast to >> com.vividsolutions.jts.geom.MultiLineString >> Parsing failed for the_geom: java.lang.ClassCastException: >> com.vividsolutions.jts.geom.LineString cannot be cast to >> com.vividsolutions.jts.geom.MultiLineString >> com.vividsolutions.jts.geom.LineString cannot be cast to >> com.vividsolutions.jts.geom.MultiLineString >> </ServiceException></ServiceExceptionReport>* >> >> I was thinking that maybe I have done some mistakes when I create new >> classes but it was not that. >> >> I know why is that. The reason is that I use version of WFS 1.0.0 in >> declaration of wfsProtocolOptions but in this version that kind of error >> happens when you try to add LineString geometry to MultiLineString. This was >> fixed in wfs 1.1.0 but unfortunately when I change the version of >> WFSprotocol to 1.1.0 my *Vector layer does not appear on the map - IT >> DOES NOT WORK*. Why is that?? How come version 1.1.0 of WFS does not work >> in GWT-OL. >> >> I have also checked everything in pure JS. In version 1.0.0 of WFSProtocol >> I got this same error, but when I change the version to 1.1.0 everything >> work just fine. The new geometry was added to the database, and of course I >> can see my vector layer on the map. >> >> Did anyone have this kinds of problems? >> >> Regards, >> Poul >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> > > > -- > Mikael Couzic > Pôle Business Intelligence > Groupe Cliris > |