From: Mikael C. <mik...@cl...> - 2010-03-03 19:18:42
|
Hi all, I'll be working on a project involving GWT-OL in the following weeks, and I could use a little advice on how I am going to proceed. To be quick, I'll be displaying regions on a map, and the color of each region will be dynamically calculated on the fly based on GWT server-side values. To complicate things up, some regions will be groups of regions, also defined on the GWT server. My first idea was to set up a GeoServer and fetch the features with WFS GetFeature requests. From there I could display the features with whatever style I wanted, and I could even make groups using OpenLayers.Geometry.Collection<http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Geometry/Collection-js.html#OpenLayers.Geometry.Collection.OpenLayers.Geometry.Collection> .calculateBounds<http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Geometry/Collection-js.html#OpenLayers.Geometry.Collection.calculateBounds>(or so I hope I could). But then I couldn't find a simple way to get features (and not layers) from WFS, and I could'nt even manage to parse my GML with the corresponding GML3 class. I'm feeling a bit helpless... The way I see it now, if I stay stuck, here's what I'll have to do : Fetch the features with com.google.gwt.http.client<http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/http/client/package-frame.html> Parse the GML with com.google.gwt.xml.client<http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/xml/client/package-frame.html> And from that extract the posList, then generate the points, from that instantiate the LinearRings and then I'll have my features. I feel like I might be reinventing the wheel somewhere. Just to give you the idea, my dream object would be like : List<VectorFeature> features = *MyDreamObject* .getFeaturesFromRemoteGML(WFS_URL);* * Has anyone ever tried something similar ? Do you know anything that could help me ? Any help would be MOST appreciated. Thanks ! -- Mikael |