From: Christopher N. <cna...@gm...> - 2010-02-11 16:55:46
|
Hi, I'm trying to read WFS features from a geoserver using gwt-openlayers and I can't seem to figure out where I am going wrong. Using straight OpenLayers/Javascript/HTML I have the following, which works: // Proxy setup to fix XMLHttpRequest domain matching OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; // parameters for getting the WFS layer var params = { typename: "marketmaker:business_cu" }; var options = {}; // WFS Layer creation var layer = new OpenLayers.Layer.WFS( "WFS", "http://mmweb.ncsa.uiuc.edu:8080/geoserver/wfs", params, options ); // add the layer map.addLayer( layer ); My GWT-OpenLayers equivalent is: // parameters for wfs layer WFSParams wfsParams = new WFSParams(); wfsParams.getJSObject().setProperty( "typename", "marketmaker:business_cu" ); // no additional options WFSOptions wfsOptions = new WFSOptions(); // WFS layer creation WFS wfsLayer = new WFS( "wfs", WFS_URL, wfsParams, wfsOptions ); // add the layer map.addLayer( wfsLayer ); Is there some way to inject the value of OpenLayers.ProxyHost using GWT-OpenLayers? I'm not sure if that is the issue. I am new to javascript and perhaps this is wrong, but I tried writing the value of OpenLayers.ProxyHost directly into the compiled javascript file that GWT creates. Any help is appreciated. Regards, Chris |
From: Edwin C. <com...@gm...> - 2010-02-11 22:36:29
|
Hi Christopher, Without a proxy it is not possible for OpenLayers to do WFS requests, because of cross-domain restrictions on Javascript. Before going into ProxyHost: The recommended way to create a WFS layer is via WFSProtocol. We are intending to remove the WFS layer alltogether, as it appears to be the legacy way to talk to a WFS. You can look at the latest OpenLayers examples (http://openlayers.org/dev/examples/). For instance: http://openlayers.org/dev/examples/wfs-states.js For this you need the code that it is in trunk (but see also below about proxy). The easiest way to set the proxyHost is to create a setter for it in JSNI code: public static native void setProxyHost(String host)/*-{ $wnd.OpenLayers.ProxyHost = host; }-*/; and then setProxyHost("myhost/here"); However, the proxyHost should point at a proxy that is running on the same domain as the javascript. There is a python proxy included with the OpenLayers examples. You can try to get that running at the some domain as the app you are working on. Currently, the GWT-OL lacks a java proxy servlet, but that should be added to trunk soon. I can send you a copy of the new build when that hits trunk. Greetings, Edwin On 11 February 2010 17:55, Christopher Navarro <cna...@gm...> wrote: > Hi, > > I'm trying to read WFS features from a geoserver using gwt-openlayers and I > can't seem to figure out where I am going wrong. > > Using straight OpenLayers/Javascript/HTML I have the following, which works: > > // Proxy setup to fix XMLHttpRequest domain matching > OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; > > // parameters for getting the WFS layer > var params = { typename: "marketmaker:business_cu" }; > var options = {}; > > // WFS Layer creation > var layer = new OpenLayers.Layer.WFS( "WFS", > "http://mmweb.ncsa.uiuc.edu:8080/geoserver/wfs", > params, options ); > > // add the layer > map.addLayer( layer ); > > My GWT-OpenLayers equivalent is: > > // parameters for wfs layer > WFSParams wfsParams = new WFSParams(); > wfsParams.getJSObject().setProperty( "typename", "marketmaker:business_cu" > ); > > // no additional options > WFSOptions wfsOptions = new WFSOptions(); > > // WFS layer creation > WFS wfsLayer = new WFS( "wfs", WFS_URL, wfsParams, wfsOptions ); > > // add the layer > map.addLayer( wfsLayer ); > > Is there some way to inject the value of OpenLayers.ProxyHost using > GWT-OpenLayers? I'm not sure if that is the issue. I am new to javascript > and perhaps this is wrong, but I tried writing the value of > OpenLayers.ProxyHost directly into the compiled javascript file that GWT > creates. Any help is appreciated. > > Regards, > Chris > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Christopher N. <cna...@gm...> - 2010-02-12 15:20:20
|
Thanks for your quick reply Edwin. I successfully set the proxy host using the JSNI code you provided and loaded my WFS layer. I will look at what is in trunk because I would prefer to use the WFS protocol. I don't see any of the OpenLayers Strategies such as Cluster, BBOX, etc, is support planned in the near term for these options? I didn't see it among the tickets in Trac. Regards, Chris On Thu, Feb 11, 2010 at 4:36 PM, Edwin Commandeur < com...@gm...> wrote: > Hi Christopher, > > Without a proxy it is not possible for OpenLayers to do WFS requests, > because of cross-domain restrictions on Javascript. > > Before going into ProxyHost: The recommended way to create a WFS layer > is via WFSProtocol. We are intending to remove the WFS layer > alltogether, as it appears to be the legacy way to talk to a WFS. You > can look at the latest OpenLayers examples > (http://openlayers.org/dev/examples/). For instance: > > http://openlayers.org/dev/examples/wfs-states.js > > For this you need the code that it is in trunk (but see also below about > proxy). > > The easiest way to set the proxyHost is to create a setter for it in JSNI > code: > > public static native void setProxyHost(String host)/*-{ > > $wnd.OpenLayers.ProxyHost = host; > > }-*/; > > and then > > setProxyHost("myhost/here"); > > However, the proxyHost should point at a proxy that is running on the > same domain as the javascript. There is a python proxy included with > the OpenLayers examples. You can try to get that running at the some > domain as the app you are working on. > > Currently, the GWT-OL lacks a java proxy servlet, but that should be > added to trunk soon. I can send you a copy of the new build when that > hits trunk. > > Greetings, > Edwin > > On 11 February 2010 17:55, Christopher Navarro <cna...@gm...> > wrote: > > Hi, > > > > I'm trying to read WFS features from a geoserver using gwt-openlayers and > I > > can't seem to figure out where I am going wrong. > > > > Using straight OpenLayers/Javascript/HTML I have the following, which > works: > > > > // Proxy setup to fix XMLHttpRequest domain matching > > OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; > > > > // parameters for getting the WFS layer > > var params = { typename: "marketmaker:business_cu" }; > > var options = {}; > > > > // WFS Layer creation > > var layer = new OpenLayers.Layer.WFS( "WFS", > > "http://mmweb.ncsa.uiuc.edu:8080/geoserver/wfs", > > params, options ); > > > > // add the layer > > map.addLayer( layer ); > > > > My GWT-OpenLayers equivalent is: > > > > // parameters for wfs layer > > WFSParams wfsParams = new WFSParams(); > > wfsParams.getJSObject().setProperty( "typename", > "marketmaker:business_cu" > > ); > > > > // no additional options > > WFSOptions wfsOptions = new WFSOptions(); > > > > // WFS layer creation > > WFS wfsLayer = new WFS( "wfs", WFS_URL, wfsParams, wfsOptions ); > > > > // add the layer > > map.addLayer( wfsLayer ); > > > > Is there some way to inject the value of OpenLayers.ProxyHost using > > GWT-OpenLayers? I'm not sure if that is the issue. I am new to > javascript > > and perhaps this is wrong, but I tried writing the value of > > OpenLayers.ProxyHost directly into the compiled javascript file that GWT > > creates. Any help is appreciated. > > > > Regards, > > Chris > > > > > ------------------------------------------------------------------------------ > > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > > http://p.sf.net/sfu/solaris-dev2dev > > _______________________________________________ > > Gwt-openlayers-users mailing list > > Gwt...@li... > > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > |
From: Edwin C. <com...@gm...> - 2010-02-13 10:36:36
|
Hi Christopher, Great to hear that setting the proxy host worked. You are free to create Trac tickets for these strategies. As anonymous user you may create new tickets (you only cannot assign them etc). Contributions are always welcome. Filling Trac with valid tickets is also valuable. The long term goal is to wrap OL completely, so that includes the strategies :)... Greetings, Edwin On 12 February 2010 16:20, Christopher Navarro <cna...@gm...> wrote: > Thanks for your quick reply Edwin. I successfully set the proxy host using > the JSNI code you provided and loaded my WFS layer. I will look at what is > in trunk because I would prefer to use the WFS protocol. > > I don't see any of the OpenLayers Strategies such as Cluster, BBOX, etc, is > support planned in the near term for these options? I didn't see it among > the tickets in Trac. > > Regards, > Chris > > On Thu, Feb 11, 2010 at 4:36 PM, Edwin Commandeur > <com...@gm...> wrote: >> >> Hi Christopher, >> >> Without a proxy it is not possible for OpenLayers to do WFS requests, >> because of cross-domain restrictions on Javascript. >> >> Before going into ProxyHost: The recommended way to create a WFS layer >> is via WFSProtocol. We are intending to remove the WFS layer >> alltogether, as it appears to be the legacy way to talk to a WFS. You >> can look at the latest OpenLayers examples >> (http://openlayers.org/dev/examples/). For instance: >> >> http://openlayers.org/dev/examples/wfs-states.js >> >> For this you need the code that it is in trunk (but see also below about >> proxy). >> >> The easiest way to set the proxyHost is to create a setter for it in JSNI >> code: >> >> public static native void setProxyHost(String host)/*-{ >> >> $wnd.OpenLayers.ProxyHost = host; >> >> }-*/; >> >> and then >> >> setProxyHost("myhost/here"); >> >> However, the proxyHost should point at a proxy that is running on the >> same domain as the javascript. There is a python proxy included with >> the OpenLayers examples. You can try to get that running at the some >> domain as the app you are working on. >> >> Currently, the GWT-OL lacks a java proxy servlet, but that should be >> added to trunk soon. I can send you a copy of the new build when that >> hits trunk. >> >> Greetings, >> Edwin >> >> On 11 February 2010 17:55, Christopher Navarro <cna...@gm...> >> wrote: >> > Hi, >> > >> > I'm trying to read WFS features from a geoserver using gwt-openlayers >> > and I >> > can't seem to figure out where I am going wrong. >> > >> > Using straight OpenLayers/Javascript/HTML I have the following, which >> > works: >> > >> > // Proxy setup to fix XMLHttpRequest domain matching >> > OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; >> > >> > // parameters for getting the WFS layer >> > var params = { typename: "marketmaker:business_cu" }; >> > var options = {}; >> > >> > // WFS Layer creation >> > var layer = new OpenLayers.Layer.WFS( "WFS", >> > "http://mmweb.ncsa.uiuc.edu:8080/geoserver/wfs", >> > params, options ); >> > >> > // add the layer >> > map.addLayer( layer ); >> > >> > My GWT-OpenLayers equivalent is: >> > >> > // parameters for wfs layer >> > WFSParams wfsParams = new WFSParams(); >> > wfsParams.getJSObject().setProperty( "typename", >> > "marketmaker:business_cu" >> > ); >> > >> > // no additional options >> > WFSOptions wfsOptions = new WFSOptions(); >> > >> > // WFS layer creation >> > WFS wfsLayer = new WFS( "wfs", WFS_URL, wfsParams, wfsOptions ); >> > >> > // add the layer >> > map.addLayer( wfsLayer ); >> > >> > Is there some way to inject the value of OpenLayers.ProxyHost using >> > GWT-OpenLayers? I'm not sure if that is the issue. I am new to >> > javascript >> > and perhaps this is wrong, but I tried writing the value of >> > OpenLayers.ProxyHost directly into the compiled javascript file that GWT >> > creates. Any help is appreciated. >> > >> > Regards, >> > Chris >> > >> > >> > ------------------------------------------------------------------------------ >> > SOLARIS 10 is the OS for Data Centers - provides features such as >> > DTrace, >> > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >> > http://p.sf.net/sfu/solaris-dev2dev >> > _______________________________________________ >> > Gwt-openlayers-users mailing list >> > Gwt...@li... >> > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > >> > > > |
From: Lukas J. <luk...@de...> - 2010-05-24 14:27:54
|
At http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html it is stated that three events exists concerting the movement of the map: # movestart triggered after the start of a drag, pan, or zoom # move triggered after each drag, pan, or zoom # moveend triggered after a drag, pan, or zoom completes As far as I understand only move has been wrapped in gwt-ol. If I were to wrap moveend (the one I need) am I correct in believing that I only need to: * create a interface MapMoveEndListener * add eventType to EventType.java * write a register method in Map.java How do I send the changeset to you? A diff of the project? Best Regards Lukas Johansson |
From: Edwin C. <com...@gm...> - 2010-05-24 19:50:33
|
Hi Lukas, You seem to have it down. The classes you describe are all that are needed and you can just look at the MapMoveListener. Management of the listener happens via de EventListenerCollection on OpenLayersEObjectWrapper :). A diff would be fine. Looking forward to your patch! Greetings, Edwin On 24 May 2010 16:27, Lukas Johansson <luk...@de...> wrote: > At http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html it is > stated that three events exists concerting the movement of the map: > > # movestart triggered after the start of a drag, pan, or zoom > # move triggered after each drag, pan, or zoom > # moveend triggered after a drag, pan, or zoom completes > > As far as I understand only move has been wrapped in gwt-ol. If I were > to wrap moveend (the one I need) am I correct in believing that I only > need to: > * create a interface MapMoveEndListener > * add eventType to EventType.java > * write a register method in Map.java > > How do I send the changeset to you? A diff of the project? > Best Regards > Lukas Johansson > > ------------------------------------------------------------------------------ > > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: Lukas J. <luk...@de...> - 2010-05-25 08:36:18
Attachments:
2010-05-25 - MapMoveEndEvent.patch
|
Ok, here it goes. I'm not 100% sure that the patch file was created correctly as my mercurial didn't honor the .hgignore file. I was therefore forced to edit the patch file to remove changes in .project and .classpath. The patch is more or less just a copy of the existing moveEvent and I tested it in our application where it seems to work. Anything else I should do/know about? /Lukas -----Ursprungligt meddelande----- Från: Edwin Commandeur [mailto:com...@gm...] Skickat: den 24 maj 2010 21:50 Till: Lukas Johansson Kopia: gwt...@li... Ämne: Re: [Gwt-openlayers-users] Event mapmoveend Hi Lukas, You seem to have it down. The classes you describe are all that are needed and you can just look at the MapMoveListener. Management of the listener happens via de EventListenerCollection on OpenLayersEObjectWrapper :). A diff would be fine. Looking forward to your patch! Greetings, Edwin On 24 May 2010 16:27, Lukas Johansson <luk...@de...> wrote: > At http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html it is > stated that three events exists concerting the movement of the map: > > # movestart triggered after the start of a drag, pan, or zoom > # move triggered after each drag, pan, or zoom > # moveend triggered after a drag, pan, or zoom completes > > As far as I understand only move has been wrapped in gwt-ol. If I were > to wrap moveend (the one I need) am I correct in believing that I only > need to: > * create a interface MapMoveEndListener > * add eventType to EventType.java > * write a register method in Map.java > > How do I send the changeset to you? A diff of the project? > Best Regards > Lukas Johansson > > ------------------------------------------------------------------------------ > > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: Edwin C. <com...@gm...> - 2010-05-25 13:30:04
|
Hi Lukas, Thanks for contributing the patch. No additional stuff is needed for providing the MapMoveEnd within GWT-OL. If the MapMoveEnd event object has additional properties (beyond source) then getters can be created on the MapMoveEndEvent inner class, but that is not a necessity and doesn't seem to apply here. I will get the patch in this week (hopefully tonight or otherwise thursday). Greetings, Edwin On 25 May 2010 10:36, Lukas Johansson <luk...@de...> wrote: > Ok, here it goes. I'm not 100% sure that the patch file was created correctly as my mercurial didn't honor the .hgignore file. I was therefore forced to edit the patch file to remove changes in .project and .classpath. > > The patch is more or less just a copy of the existing moveEvent and I tested it in our application where it seems to work. Anything else I should do/know about? > > /Lukas > > -----Ursprungligt meddelande----- > Från: Edwin Commandeur [mailto:com...@gm...] > Skickat: den 24 maj 2010 21:50 > Till: Lukas Johansson > Kopia: gwt...@li... > Ämne: Re: [Gwt-openlayers-users] Event mapmoveend > > Hi Lukas, > > You seem to have it down. The classes you describe are all that are > needed and you can just look at the MapMoveListener. Management of > the listener happens via de EventListenerCollection on > OpenLayersEObjectWrapper :). > > A diff would be fine. Looking forward to your patch! > > Greetings, > Edwin > > On 24 May 2010 16:27, Lukas Johansson <luk...@de...> wrote: >> At http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html it is >> stated that three events exists concerting the movement of the map: >> >> # movestart triggered after the start of a drag, pan, or zoom >> # move triggered after each drag, pan, or zoom >> # moveend triggered after a drag, pan, or zoom completes >> >> As far as I understand only move has been wrapped in gwt-ol. If I were >> to wrap moveend (the one I need) am I correct in believing that I only >> need to: >> * create a interface MapMoveEndListener >> * add eventType to EventType.java >> * write a register method in Map.java >> >> How do I send the changeset to you? A diff of the project? >> Best Regards >> Lukas Johansson >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Edwin C. <com...@gm...> - 2010-05-25 19:52:27
|
Hi Lukas, Just pushed your MapMoveEndListener support to the main repo. Thanks for contributing, Edwin On 25 May 2010 10:36, Lukas Johansson <luk...@de...> wrote: > Ok, here it goes. I'm not 100% sure that the patch file was created correctly as my mercurial didn't honor the .hgignore file. I was therefore forced to edit the patch file to remove changes in .project and .classpath. > > The patch is more or less just a copy of the existing moveEvent and I tested it in our application where it seems to work. Anything else I should do/know about? > > /Lukas > > -----Ursprungligt meddelande----- > Från: Edwin Commandeur [mailto:com...@gm...] > Skickat: den 24 maj 2010 21:50 > Till: Lukas Johansson > Kopia: gwt...@li... > Ämne: Re: [Gwt-openlayers-users] Event mapmoveend > > Hi Lukas, > > You seem to have it down. The classes you describe are all that are > needed and you can just look at the MapMoveListener. Management of > the listener happens via de EventListenerCollection on > OpenLayersEObjectWrapper :). > > A diff would be fine. Looking forward to your patch! > > Greetings, > Edwin > > On 24 May 2010 16:27, Lukas Johansson <luk...@de...> wrote: >> At http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html it is >> stated that three events exists concerting the movement of the map: >> >> # movestart triggered after the start of a drag, pan, or zoom >> # move triggered after each drag, pan, or zoom >> # moveend triggered after a drag, pan, or zoom completes >> >> As far as I understand only move has been wrapped in gwt-ol. If I were >> to wrap moveend (the one I need) am I correct in believing that I only >> need to: >> * create a interface MapMoveEndListener >> * add eventType to EventType.java >> * write a register method in Map.java >> >> How do I send the changeset to you? A diff of the project? >> Best Regards >> Lukas Johansson >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |