From: Edwin C. <com...@gm...> - 2010-02-05 10:14:46
|
ESRI also has a proxy.jsp for download: http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/gmaps/help/google_start.htm#topics/ags_proxy.html Amazing that al these people use a jsp for the proxying. Possible, because it does not have to be configured in web.xml like a servlet. To my mind a servlet would seem more logical. Any thoughts anyone? Greetings, Edwin On 5 February 2010 10:36, Edwin Commandeur <com...@gm...> wrote: > Hi Robert, > > Great you found that piece of proxy code. I will put the code in and > try to find out who I should attribute or I will include a ref to: > http://trac.openlayers.org/browser/sandbox/august/openlayers/2.8%2B/lib/OpenLayers/Util/openlayers-proxy.jsp > > That is the code which I would like to take as a starting point. > > The code is very useful and we can slash out the couple of jsp only > lines and start adding functionality so you can add a white list of > servers as in the Python proxy (even though in practice I think there > are more use cases for connecting to arbitrary WFS servers). > > Greetings, > Edwin > > On 5 February 2010 07:31, Robert Light <rob...@ve...> wrote: >> The proxy code originally came from the openlayers jsp proxy example. I >> can't be sure...but here is clearly where most of the code started from: >> >> http://trac.openlayers.org/changeset/8099/sandbox?format=diff&new=8099 >> >> - Bob >> >> Edwin Commandeur wrote: >> >> Hi Bob, >> >> I wrongly presumed that Dave added code for the WFS Layer, but it was >> for the WFSProtocol. I found out when making a start on adding a WFS >> example. >> >> It seems to me then that the WFS implementation is yours. Would you >> feel comfortable adding that to the codebase? If so, then I will add >> you as a developer. Alternatively, you can send me the files and I >> will make sure they make it into the codebase promptly. >> >> Coming monday I hope to have a bit of time to see what needs to be >> done to get a new GWT-OL release out shortly and it would be nice if >> the WFS stuff can be in it. >> >> Greetings, >> Edwin >> >> >> On 5 February 2010 01:14, Edwin Commandeur <com...@gm...> >> wrote: >> >> >> Hi Bob, >> >> That's great that you have already have some proxy code. Would you >> mind if I merge that into GWT-OL? It looks just fine for our purposes. >> >> I would really have to dive into the WFS stuff to see what's going on. >> >> I will make it high priority to add a WFS example, so I can try to >> reproduce what's going on. Sorry that I cannot help you on a shorter >> notice. >> >> Greetings, >> Edwin >> >> On 4 February 2010 19:33, Robert Light <rob...@ve...> wrote: >> >> >> To proxy, I just used the servlet (see attached) which worked just fine for >> me. >> >> - Bob >> >> Edwin Commandeur wrote: >> >> Hi Robert, >> >> The WFS functionality is a recent contribution by Dave, maybe he >> recognizes the problem easily. I still need to get working on a Java >> port of the Open Proxy that is necessary for the WFS functionality and >> that is included in the OpenLayers examples. >> >> How are you running your code? Is the Python Open Proxy implementation up? >> >> The dev list is not publicly visible as far as I am aware, but I have >> cc'd this reply to the devl list. >> >> Greetings, >> Edwin >> >> >> On 4 February 2010 16:54, Robert Light <rob...@ve...> wrote: >> >> >> Edwin, >> >> I think I've found a bug either in openlayers or in gwt-openlayers code. >> >> if I create a WFS layer: >> WFSParams wfsParams = new WFSParams(); >> wfsParams.setTypename("topp:states"); >> WFSOptions wfsLayerOptions = new WFSOptions(); >> wfsLayerOptions.setTransitionEffect(TransitionEffect.RESIZE); >> wfsLayerOptions.setExtractAttributes(true); >> >> WFS wfsLayer = new WFS( >> "states", >> "http://192.168.1.167:8080/geoserver/wfs", >> wfsParams, >> wfsLayerOptions); >> >> and then I want to get selection events so I do: >> >> wfsLayer.addVectorFeatureSelectedListener( new >> VectorFeatureSelectedListener() { >> >> public void onFeatureSelected(FeatureSelectedEvent >> eventObject) { >> JSONObject map = new >> JSONObject(eventObject.getVectorFeature().getJSObject().getProperty("attributes")); >> System.out.println("Feature.id = >> "+eventObject.getVectorFeature().getId()); >> for( String key : map.keySet()) { >> System.out.println(key+"="+map.get(key)); >> } >> } >> }); >> >> This does not work... my VectorFeatureSelectListener never get's called. >> >> To make this work, I had to add the following: >> SelectFeatureOptions selectFeatureOptions = new >> SelectFeatureOptions(); >> selectFeatureOptions.onSelect( new >> SelectFeature.SelectFeatureListener() { >> >> public void onFeatureSelected(VectorFeature vectorFeature) { >> JSONObject map = new >> JSONObject(vectorFeature.getJSObject().getProperty("attributes")); >> for( String key : map.keySet()) { >> System.out.println(key+"="+map.get(key)); >> } >> } >> }); >> >> SelectFeature selfeature = new SelectFeature(wfsLayer, >> selectFeatureOptions); >> map.getMap().addControl(selfeature); >> selfeature.activate(); >> >> >> And now BOTH my VectureFeatureSelectListener AND my SelectFeatureListener >> get called when I select a feature. >> >> To put another wrinkle in the puzzle....instead of adding the SelectFeature >> Control as above, I do just the following: >> >> SelectFeature selfeature = new SelectFeature(wfsLayer); >> map.getMap().addControl(selfeature); >> selfeature.activate(); >> >> My VectorFeatureSelectListener does NOT get called. >> >> Any ideas? Is there a developer's list I should post this query to? >> >> Note, I'm working off the latest set of sources that I downloaded via >> mercurial. >> >> many thanks. >> >> - Bob Light >> >> >> >> >> >> >> >> > |