You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
(17) |
Apr
|
May
|
Jun
(6) |
Jul
(10) |
Aug
(16) |
Sep
(4) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(5) |
Feb
(28) |
Mar
(35) |
Apr
(20) |
May
(13) |
Jun
(24) |
Jul
(14) |
Aug
(8) |
Sep
(19) |
Oct
(13) |
Nov
(16) |
Dec
(8) |
2011 |
Jan
(18) |
Feb
(10) |
Mar
(16) |
Apr
(14) |
May
(21) |
Jun
(20) |
Jul
(12) |
Aug
(18) |
Sep
(11) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2012 |
Jan
(1) |
Feb
(2) |
Mar
(6) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Edwin C. <com...@gm...> - 2011-01-05 15:51:22
|
Hi John, Have a look at the ModifyFeature control. >From ModifyFeatureImpl: public static native JSObject createOnModificationStartCallback(OnModificationStartListener listener)/*-{ var callback = function(obj){ var vectorFeatureObj = @org.gwtopenmaps.openlayers.client.feature.VectorFeature::narrowToVectorFeature(Lorg/gwtopenmaps/openlayers/client/util/JSObject;)(obj); listener.@org.gwtopenmaps.openlayers.client.control.ModifyFeature.OnModificationStartListener::onModificationStart(Lorg/gwtopenmaps/openlayers/client/feature/VectorFeature;)(vectorFeatureObj); } return callback; }-*/; >From ModifyFeatureOptions: public void onModificationStart(OnModificationStartListener listener) { JSObject callback = ModifyFeatureImpl.createOnModificationStartCallback(listener); getJSObject().setProperty("onModificationStart", callback); } >From ModifyFeature: public interface OnModificationStartListener { void onModificationStart(VectorFeature vectorFeature); } Greetings, Edwin On 2 January 2011 23:48, John Preston <byh...@gm...> wrote: > Hi, I'm new to gwt-openlayers but I I have been using straight > openlayers javscript for a few years and I think that port is quit > good and useful. > > I'm looking for a little help to get started to add a few of the > missing functionality that I use in my code. I need the > Openlayers.loadURL function to access some xml code on the same server > as the maps that I'm viewing. > > I can add the main function quiet easily but can anyone give me a few > lines that shows me how to add the callbacks that I need to pass to > the Openlayers.loadURL function. > > John > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: Edwin C. <com...@gm...> - 2011-01-05 15:18:30
|
Hi Fatzopilot, You might have figured this one out already, but for OSM you indeed need to include the following extra script: http://www.openstreetmap.org/openlayers/OpenStreetMap.js When you look at the source for http://www.openstreetmap.org/index.html you can deduce that. There are several ways to include OSM data. These are mentioned on: http://wiki.openstreetmap.org/wiki/Deploying_your_own_Slippy_Map An alternative that is not mentioned is serving the data as WMS, or find a hoster that does :) Greetings, Edwin On 2 January 2011 03:05, fatzopilot <fat...@gm...> wrote: > Hi list, > > there seems to be something wrong with my attempts to get gwt-openlayers > displaying mapnik generated tiles. > The showcase runs just fine, I slightly changed it to use a Mapnik backend > instead of the WMS backend. > I did pretty much the same as here: > http://code.google.com/p/dantwining/source/browse/trunk/gwitmap/src/com/dantwining/gwitmap/client/GwitMap.java > However, I get a "com.google.gwt.core.client.JavaScriptException: > (TypeError): $wnd.OpenLayers.Layer.OSM.Mapnik" is not a constructor" in > dev-mode. > Did I forget to include some JS somewhere or is there another problem? > > Thanks > fatzopilot > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: John P. <byh...@gm...> - 2011-01-02 22:48:32
|
Hi, I'm new to gwt-openlayers but I I have been using straight openlayers javscript for a few years and I think that port is quit good and useful. I'm looking for a little help to get started to add a few of the missing functionality that I use in my code. I need the Openlayers.loadURL function to access some xml code on the same server as the maps that I'm viewing. I can add the main function quiet easily but can anyone give me a few lines that shows me how to add the callbacks that I need to pass to the Openlayers.loadURL function. John |
From: fatzopilot <fat...@gm...> - 2011-01-02 02:06:04
|
Hi list, there seems to be something wrong with my attempts to get gwt-openlayers displaying mapnik generated tiles. The showcase runs just fine, I slightly changed it to use a Mapnik backend instead of the WMS backend. I did pretty much the same as here: http://code.google.com/p/dantwining/source/browse/trunk/gwitmap/src/com/dantwining/gwitmap/client/GwitMap.java However, I get a "com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.OpenLayers.Layer.OSM.Mapnik" is not a constructor" in dev-mode. Did I forget to include some JS somewhere or is there another problem? Thanks fatzopilot |
From: Alexander S. <aso...@gm...> - 2010-12-21 10:15:48
|
Hello, developers! I've been starting to use GWT recently and used raw OpenLayers during a long period. Unfortunately, a simple "Hello, world" with gwt-openlayers doesn't work. Here is the code: MapWidget mw = new MapWidget("350px", "350px"); mapWidget.getMap(); RootLayoutPanel.get().add(mapWidget); After the page is loaded the following error output is show: Exception while loading module my.app.client.App. See Development Mode for details. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:636) Caused by: com.google.gwt.core.client.JavaScriptException: (NOT_FOUND_ERR): NOT_FOUND_ERR: DOM Exception 8 code: 8 __gwt_ObjectId: 18 INDEX_SIZE_ERR: 1 DOMSTRING_SIZE_ERR: 2 HIERARCHY_REQUEST_ERR: 3 WRONG_DOCUMENT_ERR: 4 INVALID_CHARACTER_ERR: 5 NO_DATA_ALLOWED_ERR: 6 NO_MODIFICATION_ALLOWED_ERR: 7 NOT_FOUND_ERR: 8 NOT_SUPPORTED_ERR: 9 INUSE_ATTRIBUTE_ERR: 10 INVALID_STATE_ERR: 11 SYNTAX_ERR: 12 INVALID_MODIFICATION_ERR: 13 NAMESPACE_ERR: 14 INVALID_ACCESS_ERR: 15 VALIDATION_ERR: 16 TYPE_MISMATCH_ERR: 17 SECURITY_ERR: 18 NETWORK_ERR: 19 ABORT_ERR: 20 URL_MISMATCH_ERR: 21 QUOTA_EXCEEDED_ERR: 22 at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.dom.client.Node$.appendChild$(Node.java) at com.google.gwt.layout.client.LayoutImpl.attachChild(LayoutImpl.java:72) at com.google.gwt.layout.client.Layout.attachChild(Layout.java:420) at com.google.gwt.layout.client.Layout.attachChild(Layout.java:402) at com.google.gwt.user.client.ui.LayoutPanel.insert(LayoutPanel.java:191) at com.google.gwt.user.client.ui.LayoutPanel.add(LayoutPanel.java:134) at my.app.client.App.onModuleLoad(App.java:36) ... 9 more GWT version is 2.1.0 IDE is Eclipse 3.5 with GWT plugin for Eclipse gwt-openlayers-client-0.5.jar is referenced in project options: Project -> Properties -> Java Build Path -> Libraries gwt.xml has "inherits" entry "org.gwtopenmaps.openlayers.OpenLayers" OpenLayers sources is included via remote script in <head> section -- Regards, Alexander |
From: Piotr T. <pi...@cg...> - 2010-12-10 19:53:27
|
Hi Edwin, Yes I tried but that doesnt work at all (to be honest things are more worse when 100% is used). So far the only one solution is to use really hard-coded part like this one in OnModuleLoad, which sets some of nested SmartGwt's divs: Element divElement = DOM.getElementById("isc_B"); Style divStyle = divElement.getStyle(); divStyle.setHeight(100, Unit.PCT); divStyle.setWidth(100, Unit.PCT); divElement = DOM.getElementById("isc_C"); divStyle = divElement.getStyle(); divStyle.setHeight(100, Unit.PCT); divStyle.setWidth(100, Unit.PCT); but one must remember, that all id are generated dynamically by SmartGWT. Resize problem doesn't happen on IE and Chrome. So far I'm not able to make it run on Opera at all. I'm fighting with this problem maybe some solution will be found... I havent seen any working example of any map (no matter OL or GoogleMaps) in SmartGWT showcase (that might means something...). /Piotr W dniu 2010-12-10 17:39, Edwin Commandeur pisze: > Hi Piotr, > > Have you tried initiating the MapWidget like this: > > mapWidget = new MapWidget("100%", "100%", mapOptions); > > I haven't checked the SmartGWT forums, but I'd be happy to know if a > SmartGWT user has a fix for this particular problem. When you use > SmartGWT then SmartGWT will be in charge of resizing, as not all > browsers throw resize events for div's. For GWT-OL it is better not to > know about SmartGWT's resizing, but to get told the new size upon a > SmartGWT event that triggers a resize. > > Greetings, > Edwin > > On 8 December 2010 19:22, Piotr Tracz<pi...@cg...> wrote: >> Hello, >> >> I recently changed QxWT to SmartGWT and started to play with it. >> Unfortunately there is pretty big problem with rescaling OL-GWT widget >> in SmartGWT layout's. Problem seems to be nothing really new as some >> people are complain about that on SmartGWT's forum (unfortunately it >> seems to be ignored). >> >> >> Some code snippets: >> >> public class OLMapWidget extends Layout >> { >> final public MapWidget mapWidget; >> final MapOptions mapOptions; >> final WMSParams mapWMSParams; >> >> public OLMapWidget() >> { >> >> mapWMSParams = new WMSParams(); >> mapOptions = new MapOptions(); >> mapOptions.setNumZoomLevels(16); >> mapOptions.setProjection("EPSG:4326"); >> mapWidget = new MapWidget("1600", "1080", mapOptions); >> >> mapWMSParams.setFormat("image/png"); >> mapWMSParams.setLayers("basic"); >> mapWMSParams.setStyles(""); >> >> WMSOptions wmsLayerParams = new WMSOptions(); >> wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE); >> >> WMS wmsLayer; >> >> wmsLayer = new WMS( >> "Basic WMS", >> "http://labs.metacarta.com/wms/vmap0", >> mapWMSParams, >> wmsLayerParams); >> >> mapWidget.getMap().addLayers(new Layer[] {wmsLayer}); >> mapWidget.getMap().setCenter(new LonLat(0, 0), 5); >> >> >> setWidth100(); >> setHeight100(); >> setAlign(Alignment.CENTER); >> setOverflow(Overflow.HIDDEN); >> setShowResizeBar(true); >> >> >> this.addChild(mapWidget); >> >> Scheduler.get().scheduleDeferred(new Command() >> { >> @Override >> public void execute() >> { >> /* >> String mapHeight = getParentElement().getHeightAsString(); >> String mapWidth = getParentElement().getWidthAsString(); >> >> mapWidget.setHeight(mapHeight); >> mapWidget.setWidth(mapWidth); >> */ >> >> mapWidget.setHeight(getHeightAsString()); >> mapWidget.setWidth(getWidthAsString()); >> >> mapWidget.getMap().updateSize(); >> } >> }); >> >> >> this.addResizedHandler( new ResizedHandler() >> { >> public void onResized( ResizedEvent event ) >> { >> //mapWidget.setHeight(Integer.toString(getInnerHeight())); >> //mapWidget.setWidth(Integer.toString(getInnerWidth())); >> mapWidget.setWidth(getWidthAsString()); >> mapWidget.setHeight(getHeightAsString()); >> mapWidget.getMap().updateSize(); >> } >> } ) ; >> } >> } >> >> public class Application implements EntryPoint { >> >> public void onModuleLoad() { >> >> >> VLayout mainLayout = new VLayout(); >> mainLayout.setWidth100(); >> mainLayout.setHeight100(); >> mainLayout.addMember(ViewHelper.createToolBar()); >> >> HLayout layout1 = new HLayout(); >> layout1.setWidth100(); >> layout1.addMember(ViewHelper.createLayerPanel()); >> final VLayout layout2 = new VLayout(); >> layout2.setHeight100(); >> layout2.setOverflow(Overflow.HIDDEN); >> layout2.addMember (new OLMapWidget()); >> >> >> >> >> >> >> layout2.addMember(ViewHelper.createTablePanel()); >> layout1.addMember(layout2); >> mainLayout.addMember(layout1); >> // >> mainLayout.addMember(ViewHelper.createStatusBar()); >> mainLayout.draw(); >> } >> >> >> } >> >> All is working ok unless browser windows is started as small and then >> expanded to bigger size - in that case OL-GWT widget size is always the >> same small. >> I guess its SmartGWT problem and the easiest way is saying bye bye to >> SmartGWT but maybe someone have some hack to override this problem (I >> know I can use ugly hack to manually change size of DIV but that doesnt >> look like good solution). >> >> /Peter >> >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF Dev2Dev email is sponsored by: >> >> WikiLeaks The End of the Free Internet >> http://p.sf.net/sfu/therealnews-com >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > |
From: Jon B. <jon...@go...> - 2010-12-10 19:22:32
|
I've got this same issue. I get 100% width, but it only allows me.to set a fixed height, otherwise it ends up 0 pixels. Jon On 10 Dec 2010 16:39, "Edwin Commandeur" <com...@gm...> wrote: > Hi Piotr, > > Have you tried initiating the MapWidget like this: > > mapWidget = new MapWidget("100%", "100%", mapOptions); > > I haven't checked the SmartGWT forums, but I'd be happy to know if a > SmartGWT user has a fix for this particular problem. When you use > SmartGWT then SmartGWT will be in charge of resizing, as not all > browsers throw resize events for div's. For GWT-OL it is better not to > know about SmartGWT's resizing, but to get told the new size upon a > SmartGWT event that triggers a resize. > > Greetings, > Edwin > > On 8 December 2010 19:22, Piotr Tracz <pi...@cg...> wrote: >> Hello, >> >> I recently changed QxWT to SmartGWT and started to play with it. >> Unfortunately there is pretty big problem with rescaling OL-GWT widget >> in SmartGWT layout's. Problem seems to be nothing really new as some >> people are complain about that on SmartGWT's forum (unfortunately it >> seems to be ignored). >> >> >> Some code snippets: >> >> public class OLMapWidget extends Layout >> { >> final public MapWidget mapWidget; >> final MapOptions mapOptions; >> final WMSParams mapWMSParams; >> >> public OLMapWidget() >> { >> >> mapWMSParams = new WMSParams(); >> mapOptions = new MapOptions(); >> mapOptions.setNumZoomLevels(16); >> mapOptions.setProjection("EPSG:4326"); >> mapWidget = new MapWidget("1600", "1080", mapOptions); >> >> mapWMSParams.setFormat("image/png"); >> mapWMSParams.setLayers("basic"); >> mapWMSParams.setStyles(""); >> >> WMSOptions wmsLayerParams = new WMSOptions(); >> wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE); >> >> WMS wmsLayer; >> >> wmsLayer = new WMS( >> "Basic WMS", >> "http://labs.metacarta.com/wms/vmap0", >> mapWMSParams, >> wmsLayerParams); >> >> mapWidget.getMap().addLayers(new Layer[] {wmsLayer}); >> mapWidget.getMap().setCenter(new LonLat(0, 0), 5); >> >> >> setWidth100(); >> setHeight100(); >> setAlign(Alignment.CENTER); >> setOverflow(Overflow.HIDDEN); >> setShowResizeBar(true); >> >> >> this.addChild(mapWidget); >> >> Scheduler.get().scheduleDeferred(new Command() >> { >> @Override >> public void execute() >> { >> /* >> String mapHeight = getParentElement().getHeightAsString(); >> String mapWidth = getParentElement().getWidthAsString(); >> >> mapWidget.setHeight(mapHeight); >> mapWidget.setWidth(mapWidth); >> */ >> >> mapWidget.setHeight(getHeightAsString()); >> mapWidget.setWidth(getWidthAsString()); >> >> mapWidget.getMap().updateSize(); >> } >> }); >> >> >> this.addResizedHandler( new ResizedHandler() >> { >> public void onResized( ResizedEvent event ) >> { >> //mapWidget.setHeight(Integer.toString(getInnerHeight())); >> //mapWidget.setWidth(Integer.toString(getInnerWidth())); >> mapWidget.setWidth(getWidthAsString()); >> mapWidget.setHeight(getHeightAsString()); >> mapWidget.getMap().updateSize(); >> } >> } ) ; >> } >> } >> >> public class Application implements EntryPoint { >> >> public void onModuleLoad() { >> >> >> VLayout mainLayout = new VLayout(); >> mainLayout.setWidth100(); >> mainLayout.setHeight100(); >> mainLayout.addMember(ViewHelper.createToolBar()); >> >> HLayout layout1 = new HLayout(); >> layout1.setWidth100(); >> layout1.addMember(ViewHelper.createLayerPanel()); >> final VLayout layout2 = new VLayout(); >> layout2.setHeight100(); >> layout2.setOverflow(Overflow.HIDDEN); >> layout2.addMember (new OLMapWidget()); >> >> >> >> >> >> >> layout2.addMember(ViewHelper.createTablePanel()); >> layout1.addMember(layout2); >> mainLayout.addMember(layout1); >> // >> mainLayout.addMember(ViewHelper.createStatusBar()); >> mainLayout.draw(); >> } >> >> >> } >> >> All is working ok unless browser windows is started as small and then >> expanded to bigger size - in that case OL-GWT widget size is always the >> same small. >> I guess its SmartGWT problem and the easiest way is saying bye bye to >> SmartGWT but maybe someone have some hack to override this problem (I >> know I can use ugly hack to manually change size of DIV but that doesnt >> look like good solution). >> >> /Peter >> >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF Dev2Dev email is sponsored by: >> >> WikiLeaks The End of the Free Internet >> http://p.sf.net/sfu/therealnews-com >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > > ------------------------------------------------------------------------------ > Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, > new data types, scalar functions, improved concurrency, built-in packages, > OCI, SQL*Plus, data movement tools, best practices and more. > http://p.sf.net/sfu/oracle-sfdev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users |
From: Edwin C. <com...@gm...> - 2010-12-10 16:39:49
|
Hi Piotr, Have you tried initiating the MapWidget like this: mapWidget = new MapWidget("100%", "100%", mapOptions); I haven't checked the SmartGWT forums, but I'd be happy to know if a SmartGWT user has a fix for this particular problem. When you use SmartGWT then SmartGWT will be in charge of resizing, as not all browsers throw resize events for div's. For GWT-OL it is better not to know about SmartGWT's resizing, but to get told the new size upon a SmartGWT event that triggers a resize. Greetings, Edwin On 8 December 2010 19:22, Piotr Tracz <pi...@cg...> wrote: > Hello, > > I recently changed QxWT to SmartGWT and started to play with it. > Unfortunately there is pretty big problem with rescaling OL-GWT widget > in SmartGWT layout's. Problem seems to be nothing really new as some > people are complain about that on SmartGWT's forum (unfortunately it > seems to be ignored). > > > Some code snippets: > > public class OLMapWidget extends Layout > { > final public MapWidget mapWidget; > final MapOptions mapOptions; > final WMSParams mapWMSParams; > > public OLMapWidget() > { > > mapWMSParams = new WMSParams(); > mapOptions = new MapOptions(); > mapOptions.setNumZoomLevels(16); > mapOptions.setProjection("EPSG:4326"); > mapWidget = new MapWidget("1600", "1080", mapOptions); > > mapWMSParams.setFormat("image/png"); > mapWMSParams.setLayers("basic"); > mapWMSParams.setStyles(""); > > WMSOptions wmsLayerParams = new WMSOptions(); > wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE); > > WMS wmsLayer; > > wmsLayer = new WMS( > "Basic WMS", > "http://labs.metacarta.com/wms/vmap0", > mapWMSParams, > wmsLayerParams); > > mapWidget.getMap().addLayers(new Layer[] {wmsLayer}); > mapWidget.getMap().setCenter(new LonLat(0, 0), 5); > > > setWidth100(); > setHeight100(); > setAlign(Alignment.CENTER); > setOverflow(Overflow.HIDDEN); > setShowResizeBar(true); > > > this.addChild(mapWidget); > > Scheduler.get().scheduleDeferred(new Command() > { > @Override > public void execute() > { > /* > String mapHeight = getParentElement().getHeightAsString(); > String mapWidth = getParentElement().getWidthAsString(); > > mapWidget.setHeight(mapHeight); > mapWidget.setWidth(mapWidth); > */ > > mapWidget.setHeight(getHeightAsString()); > mapWidget.setWidth(getWidthAsString()); > > mapWidget.getMap().updateSize(); > } > }); > > > this.addResizedHandler( new ResizedHandler() > { > public void onResized( ResizedEvent event ) > { > //mapWidget.setHeight(Integer.toString(getInnerHeight())); > //mapWidget.setWidth(Integer.toString(getInnerWidth())); > mapWidget.setWidth(getWidthAsString()); > mapWidget.setHeight(getHeightAsString()); > mapWidget.getMap().updateSize(); > } > } ) ; > } > } > > public class Application implements EntryPoint { > > public void onModuleLoad() { > > > VLayout mainLayout = new VLayout(); > mainLayout.setWidth100(); > mainLayout.setHeight100(); > mainLayout.addMember(ViewHelper.createToolBar()); > > HLayout layout1 = new HLayout(); > layout1.setWidth100(); > layout1.addMember(ViewHelper.createLayerPanel()); > final VLayout layout2 = new VLayout(); > layout2.setHeight100(); > layout2.setOverflow(Overflow.HIDDEN); > layout2.addMember (new OLMapWidget()); > > > > > > > layout2.addMember(ViewHelper.createTablePanel()); > layout1.addMember(layout2); > mainLayout.addMember(layout1); > // > mainLayout.addMember(ViewHelper.createStatusBar()); > mainLayout.draw(); > } > > > } > > All is working ok unless browser windows is started as small and then > expanded to bigger size - in that case OL-GWT widget size is always the > same small. > I guess its SmartGWT problem and the easiest way is saying bye bye to > SmartGWT but maybe someone have some hack to override this problem (I > know I can use ugly hack to manually change size of DIV but that doesnt > look like good solution). > > /Peter > > > > > > ------------------------------------------------------------------------------ > This SF Dev2Dev email is sponsored by: > > WikiLeaks The End of the Free Internet > http://p.sf.net/sfu/therealnews-com > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: Piotr T. <pi...@cg...> - 2010-12-08 18:49:33
|
Hello, I recently changed QxWT to SmartGWT and started to play with it. Unfortunately there is pretty big problem with rescaling OL-GWT widget in SmartGWT layout's. Problem seems to be nothing really new as some people are complain about that on SmartGWT's forum (unfortunately it seems to be ignored). Some code snippets: public class OLMapWidget extends Layout { final public MapWidget mapWidget; final MapOptions mapOptions; final WMSParams mapWMSParams; public OLMapWidget() { mapWMSParams = new WMSParams(); mapOptions = new MapOptions(); mapOptions.setNumZoomLevels(16); mapOptions.setProjection("EPSG:4326"); mapWidget = new MapWidget("1600", "1080", mapOptions); mapWMSParams.setFormat("image/png"); mapWMSParams.setLayers("basic"); mapWMSParams.setStyles(""); WMSOptions wmsLayerParams = new WMSOptions(); wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE); WMS wmsLayer; wmsLayer = new WMS( "Basic WMS", "http://labs.metacarta.com/wms/vmap0", mapWMSParams, wmsLayerParams); mapWidget.getMap().addLayers(new Layer[] {wmsLayer}); mapWidget.getMap().setCenter(new LonLat(0, 0), 5); setWidth100(); setHeight100(); setAlign(Alignment.CENTER); setOverflow(Overflow.HIDDEN); setShowResizeBar(true); this.addChild(mapWidget); Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { /* String mapHeight = getParentElement().getHeightAsString(); String mapWidth = getParentElement().getWidthAsString(); mapWidget.setHeight(mapHeight); mapWidget.setWidth(mapWidth); */ mapWidget.setHeight(getHeightAsString()); mapWidget.setWidth(getWidthAsString()); mapWidget.getMap().updateSize(); } }); this.addResizedHandler( new ResizedHandler() { public void onResized( ResizedEvent event ) { //mapWidget.setHeight(Integer.toString(getInnerHeight())); //mapWidget.setWidth(Integer.toString(getInnerWidth())); mapWidget.setWidth(getWidthAsString()); mapWidget.setHeight(getHeightAsString()); mapWidget.getMap().updateSize(); } } ) ; } } public class Application implements EntryPoint { public void onModuleLoad() { VLayout mainLayout = new VLayout(); mainLayout.setWidth100(); mainLayout.setHeight100(); mainLayout.addMember(ViewHelper.createToolBar()); HLayout layout1 = new HLayout(); layout1.setWidth100(); layout1.addMember(ViewHelper.createLayerPanel()); final VLayout layout2 = new VLayout(); layout2.setHeight100(); layout2.setOverflow(Overflow.HIDDEN); layout2.addMember (new OLMapWidget()); layout2.addMember(ViewHelper.createTablePanel()); layout1.addMember(layout2); mainLayout.addMember(layout1); // mainLayout.addMember(ViewHelper.createStatusBar()); mainLayout.draw(); } } All is working ok unless browser windows is started as small and then expanded to bigger size - in that case OL-GWT widget size is always the same small. I guess its SmartGWT problem and the easiest way is saying bye bye to SmartGWT but maybe someone have some hack to override this problem (I know I can use ugly hack to manually change size of DIV but that doesnt look like good solution). /Peter |
From: Hutchins, M. C. <cha...@nr...> - 2010-12-08 17:52:59
|
Andrew, PNG with IE versions 7 and 8. Thanks, Chad From: Andrew Hughes [mailto:ahh...@gm...] Sent: Tuesday, December 07, 2010 6:45 PM To: gwt...@li... Subject: Re: [Gwt-openlayers-users] OpenLayers, MapServer, and IE What image format are you using and what version of IE are you running? IE6 doesn't support transparent png. On Tue, Nov 30, 2010 at 9:30 AM, Hutchins, Mr. Chad <cha...@nr...> wrote: I am constantly experiencing pink tiles in Internet Explorer (no problems with Firefox or Chrome) using OpenLayers-GWT and MapServer. Has anyone else experienced these issues? Were you able to solve the issue and how? Thanks, Chad Hutchins Meteorologist Naval Research Laboratory Marine Meteorology Division ---------------------------------------------------------------------------- -- Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Gwt-openlayers-users mailing list Gwt...@li... https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users |
From: Andrew H. <ahh...@gm...> - 2010-12-08 02:45:36
|
What image format are you using and what version of IE are you running? IE6 doesn't support transparent png. On Tue, Nov 30, 2010 at 9:30 AM, Hutchins, Mr. Chad < cha...@nr...> wrote: > I am constantly experiencing pink tiles in Internet Explorer (no problems > with Firefox or Chrome) using OpenLayers-GWT and MapServer. Has anyone else > experienced these issues? Were you able to solve the issue and how? > > > > Thanks, > > > > Chad Hutchins > > Meteorologist > > Naval Research Laboratory > > Marine Meteorology Division > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Johannes B. <joh...@gm...> - 2010-12-02 10:03:03
|
Hi, I am new to GWT and gwt-openlayers, and facing the same problem described here: http://sourceforge.net/mailarchive/message.php?msg_id=4864d1ca0907061447m1b86e3agf25ed67541e02f9%40mail.gmail.com Is there any news to this? Is there a workaround? Thank you, Johannes -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail |
From: Hutchins, M. C. <cha...@nr...> - 2010-11-29 23:15:00
|
I am constantly experiencing pink tiles in Internet Explorer (no problems with Firefox or Chrome) using OpenLayers-GWT and MapServer. Has anyone else experienced these issues? Were you able to solve the issue and how? Thanks, Chad Hutchins Meteorologist Naval Research Laboratory Marine Meteorology Division |
From: Jon B. <jon...@go...> - 2010-11-29 14:28:57
|
Hi Edwin, You're right, I've added the proxy and now it works fine. Thanks for the help. Jon On 29 November 2010 10:56, Edwin Commandeur <com...@gm...>wrote: > Hi Jon, > > I think the essential line is: > Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin > > Are you setting the OpenLayers proxyHost to use the proxy servlet from > GWT-OL server? The example in the showcase application should be > working and shows how to set the proxyHost. > > What I don't get is that the request is sent to the server, because I > would expect the browser to not send any cross-domain requests if > these are not allowed from the application. > > Greetings, > Edwin > > > On 29 November 2010 10:54, Jon Britton <jon...@go...> wrote: > > Sorry if I wasn't clear in my previous email, but the server is actually > > receiving and dealing with the request. I've tried another remote server > > and I get the same problem. I've debugged the website with Chrome, and > it > > just hangs when making the request - it says "pending" under Status. > > However, the Chrome debugging console shows the following errors: > > XMLHttpRequest cannot load > > > http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Atasmania_state_boundaries&QUERY_LAYERS=topp%3Atasmania_state_boundaries&STYLES=&BBOX=140.328735%2C-44.906872%2C151.98523%2C-38.315075&FEATURE_COUNT=10&HEIGHT=600&WIDTH=1061&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=592&Y=322 > . > > Origin http://127.0.0.1:8888 is not allowed by > Access-Control-Allow-Origin. > > > > Uncaught java.lang.IllegalArgumentException: Something other than a Java > > object was returned from JSNI method > > > '@org.gwtopenmaps.openlayers.client.util.JSObjectHelper::getProperty(Lorg/gwtopenmaps/openlayers/client/util/JSObject;Ljava/lang/String;)': > > JS value of type int, expected java.lang.Object > > > > wmsFailed to load resource > > Following the link loads the correct result. > > Jon > > On 29 November 2010 08:42, Lukas Johansson <luk...@de...> > > wrote: > >> > >> Have you checked with firebug if any request are actually sent? Probably > >> they aren’t as you get a JS error and you don’t see anything in the log > at > >> the server. > >> > >> By just “dry reading” your code I don’t see anything that pops out. > >> > >> You do get a “String cannot be cast to JSObject” exception and the only > >> row I can guess cases this is: > >> > >> options.setLayers(getWMSMapLayers().toArray(new WMS[0])); > >> > >> > >> > >> What does getWMSMapLayers() return? Which toArray method is called?.... > >> > >> /Lukas > >> > >> > >> > >> > >> > >> Från: man...@go... > >> [mailto:man...@go...] För Jon Britton > >> > >> Skickat: den 26 november 2010 18:49 > >> Till: Lukas Johansson > >> Kopia: gwt-openlayers-users > >> Ämne: Re: [Gwt-openlayers-users] MapClickListener support > >> > >> > >> > >> Hi Lukas, > >> > >> > >> > >> I've added a WMSGetFeatureInfo control to my map, but when I make a > >> request (by clicking on the map) the map freezes. I've checked by WMS > >> server logs and it did receive a GetFeatureInfo request and seems to > have > >> returned a result. > >> > >> > >> > >> I was originally testing in Google Chrome, but I tried Firefox and get > the > >> same problem - however I also get a JavaScript exception: > >> > >> > >> > >> Uncaught JavaScript exception [uncaught exception: > >> java.lang.ClassCastException: java.lang.String cannot be cast to > >> org.gwtopenmaps.openlayers.client.util.JSObject] in , line 0 > >> > >> > >> > >> Any idea what could be causing this? My code is shown below. > >> > >> > >> > >> Thanks, > >> > >> > >> > >> Jon > >> > >> > >> > >> public void resetWMSSelectControl() { > >> > >> if (wmsSelectControl != null) > >> > >> > >> SmartWPS.getSmartWPS().getMap().removeControl(wmsSelectControl); > >> > >> WMSGetFeatureInfoOptions options = new > >> WMSGetFeatureInfoOptions(); > >> > >> options.setLayers(getWMSMapLayers().toArray(new > >> WMS[0])); > >> > >> options.setDrillDown(true); > >> > >> options.setQueryVisible(true); > >> > >> options.setInfoFormat("application/vnd.ogc.gml"); > >> > >> > >> > >> wmsSelectControl = new WMSGetFeatureInfo(options); > >> > >> wmsSelectControl.addGetFeatureListener(new > >> GetFeatureInfoListener() { > >> > >> > >> > >> @Override > >> > >> public void > onGetFeatureInfo( > >> > >> > >> > >> > org.gwtopenmaps.openlayers.client.event.GetFeatureInfoListener.GetFeatureInfoEvent > >> eventObject) { > >> > >> > >> VectorFeature[] features = eventObject.getFeatures(); > >> > >> > >> System.out.println("FeatureInfo: " + eventObject.getText()); > >> > >> } > >> > >> }); > >> > >> > >> > >> > >> SmartWPS.getSmartWPS().getMap().addControl(wmsSelectControl); > >> > >> wmsSelectControl.activate(); > >> > >> } > >> > >> > >> > >> On 24 November 2010 16:01, Lukas Johansson <luk...@de...> > >> wrote: > >> > >> I’ve commited a version that make the control a more complete and which > >> uses the drilldown parameter introduced in OL 2.9[1] which can be used > to > >> access multiple servers. > >> > >> In october we realized that my patch hadn’t been commited so this was > >> taken care of, however I do not think that its in the current stable > build. > >> Instead you need to checkout your own version. > >> > >> > >> > >> [1] > >> > http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown > >> > >> > >> > >> You add the controller to the map, if you do not use drilldown only to > top > >> layer is queried. Most settings are set in WmsGetFeatureInfoOptions and > not > >> on the control itself. > >> > >> > >> > >> Usage is something along this path (copied from our working code, but > you > >> get the idea): > >> > >> WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); > >> > >> options.setLayers(arrayOfLayersToQuery)); > >> //allows you to tell what layers that > should > >> be queried > >> > >> options.setDrillDown(true); > >> > >> options.setQueryVisible(true); > >> > >> options.setInfoFormat("application/vnd.ogc.gml"); > >> //return result as gml > >> > >> > >> > >> > >> > >> > >> > >> wmsSelectControl = new WMSGetFeatureInfo(options); > >> > >> wmsSelectControl.addGetFeatureListener(new > >> GetFeatureInfoListener(){ > >> > >> public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { > >> > >> VectorFeature[] features = eventObject.getFeatures(); > >> > >> > >> String html = "foo"; > >> > >> FrameCloud popup = new FramedCloud("MapFeaturePopup", > >> features[0].getCenterLonLat(), new Size(300, 400), html); > >> > >> } > >> > >> } > >> > >> map.addControl(wmsSelectControl); > >> > >> > >> > >> /Lukas > >> > >> > >> > >> Från: man...@go... > >> [mailto:man...@go...] För Jon Britton > >> Skickat: den 24 november 2010 16:42 > >> Till: Lukas Johansson > >> Kopia: gwt-openlayers-users > >> Ämne: Re: [Gwt-openlayers-users] MapClickListener support > >> > >> > >> > >> Hi Lukas, > >> > >> > >> > >> You haven't misunderstood, I wasn't aware there was a map control for > >> this. My client application is for displaying many WMS layers, possibly > >> from different servers. The user can add/remove WMS layers as they see > fit > >> by using their own WMS URLs. What I want to do is display the feature > info > >> for every layer currently visible on my map, but I'm struggling to > figure > >> out how WMSGetFeatureInfo can be used for this as each control > corresponds > >> to only one WMS URL. Would I need to make a new control for each map > layer? > >> > >> > >> > >> Another problem is that the GWT-Openlayers WMGetFeatureInfo control > seems > >> to be incomplete as I can't access many of it's properties directly > (such as > >> url, title, layers...). > >> > >> > >> > >> Thanks, > >> > >> > >> > >> Jon > >> > >> > >> > >> On 24 November 2010 15:37, Lukas Johansson <luk...@de...> > >> wrote: > >> > >> You want the x/y of the mouseclick in order to construct a > >> WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control > to > >> begin with? This will handle the events, the request to the server and > you > >> can get it to produce a parsable result in GML from witch you can create > >> features. > >> > >> > >> > >> Or have I misunderstood your usecase? > >> > >> /Lukas > >> > >> > >> > >> > >> > >> Från: Jon Britton [mailto:jon...@go...] > >> Skickat: den 24 november 2010 15:20 > >> Till: gwt-openlayers-users > >> Ämne: [Gwt-openlayers-users] MapClickListener support > >> > >> > >> > >> Hi > >> > >> > >> > >> I'm trying to register a MapClickListener so that I can generate a > >> GetFeatureInfo request using the mouse x and y coordinates. Here is > what > >> I've got so far: > >> > >> > >> > >> mw.getMap().getListeners().add(new MapClickListener() { > >> > >> @Override > >> > >> public void onClick(MapClickEvent e) { > >> > >> SC.say("Map click at " + e.getLonLat()); > >> > >> } > >> > >> }); > >> > >> > >> > >> However, getListeners() isn't supported as far as I can tell (I get an > >> UnsupportedOperationException on the first line above). Are there any > plans > >> to implement this soon? Alternatively, is there any other way to access > the > >> map coordinates of the mouse cursor? > >> > >> > >> > >> Thanks, > >> > >> > >> > >> Jon > >> > >> > >> > ------------------------------------------------------------------------------ > >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > >> Tap into the largest installed PC base & get more eyes on your game by > >> optimizing for Intel(R) Graphics Technology. Get started today with the > >> Intel(R) Software Partner Program. Five $500 cash prizes are up for > grabs. > >> http://p.sf.net/sfu/intelisp-dev2dev > >> _______________________________________________ > >> Gwt-openlayers-users mailing list > >> Gwt...@li... > >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > >> Tap into the largest installed PC base & get more eyes on your game by > >> optimizing for Intel(R) Graphics Technology. Get started today with the > >> Intel(R) Software Partner Program. Five $500 cash prizes are up for > grabs. > >> http://p.sf.net/sfu/intelisp-dev2dev > >> _______________________________________________ > >> Gwt-openlayers-users mailing list > >> Gwt...@li... > >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > >> Tap into the largest installed PC base & get more eyes on your game by > >> optimizing for Intel(R) Graphics Technology. Get started today with the > >> Intel(R) Software Partner Program. Five $500 cash prizes are up for > grabs. > >> http://p.sf.net/sfu/intelisp-dev2dev > >> _______________________________________________ > >> Gwt-openlayers-users mailing list > >> Gwt...@li... > >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > >> > > > > > > > ------------------------------------------------------------------------------ > > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > > Tap into the largest installed PC base & get more eyes on your game by > > optimizing for Intel(R) Graphics Technology. Get started today with the > > Intel(R) Software Partner Program. Five $500 cash prizes are up for > grabs. > > http://p.sf.net/sfu/intelisp-dev2dev > > _______________________________________________ > > Gwt-openlayers-users mailing list > > Gwt...@li... > > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: Edwin C. <com...@gm...> - 2010-11-29 10:56:23
|
Hi Jon, I think the essential line is: Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin Are you setting the OpenLayers proxyHost to use the proxy servlet from GWT-OL server? The example in the showcase application should be working and shows how to set the proxyHost. What I don't get is that the request is sent to the server, because I would expect the browser to not send any cross-domain requests if these are not allowed from the application. Greetings, Edwin On 29 November 2010 10:54, Jon Britton <jon...@go...> wrote: > Sorry if I wasn't clear in my previous email, but the server is actually > receiving and dealing with the request. I've tried another remote server > and I get the same problem. I've debugged the website with Chrome, and it > just hangs when making the request - it says "pending" under Status. > However, the Chrome debugging console shows the following errors: > XMLHttpRequest cannot load > http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Atasmania_state_boundaries&QUERY_LAYERS=topp%3Atasmania_state_boundaries&STYLES=&BBOX=140.328735%2C-44.906872%2C151.98523%2C-38.315075&FEATURE_COUNT=10&HEIGHT=600&WIDTH=1061&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=592&Y=322. > Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin. > > Uncaught java.lang.IllegalArgumentException: Something other than a Java > object was returned from JSNI method > '@org.gwtopenmaps.openlayers.client.util.JSObjectHelper::getProperty(Lorg/gwtopenmaps/openlayers/client/util/JSObject;Ljava/lang/String;)': > JS value of type int, expected java.lang.Object > > wmsFailed to load resource > Following the link loads the correct result. > Jon > On 29 November 2010 08:42, Lukas Johansson <luk...@de...> > wrote: >> >> Have you checked with firebug if any request are actually sent? Probably >> they aren’t as you get a JS error and you don’t see anything in the log at >> the server. >> >> By just “dry reading” your code I don’t see anything that pops out. >> >> You do get a “String cannot be cast to JSObject” exception and the only >> row I can guess cases this is: >> >> options.setLayers(getWMSMapLayers().toArray(new WMS[0])); >> >> >> >> What does getWMSMapLayers() return? Which toArray method is called?.... >> >> /Lukas >> >> >> >> >> >> Från: man...@go... >> [mailto:man...@go...] För Jon Britton >> >> Skickat: den 26 november 2010 18:49 >> Till: Lukas Johansson >> Kopia: gwt-openlayers-users >> Ämne: Re: [Gwt-openlayers-users] MapClickListener support >> >> >> >> Hi Lukas, >> >> >> >> I've added a WMSGetFeatureInfo control to my map, but when I make a >> request (by clicking on the map) the map freezes. I've checked by WMS >> server logs and it did receive a GetFeatureInfo request and seems to have >> returned a result. >> >> >> >> I was originally testing in Google Chrome, but I tried Firefox and get the >> same problem - however I also get a JavaScript exception: >> >> >> >> Uncaught JavaScript exception [uncaught exception: >> java.lang.ClassCastException: java.lang.String cannot be cast to >> org.gwtopenmaps.openlayers.client.util.JSObject] in , line 0 >> >> >> >> Any idea what could be causing this? My code is shown below. >> >> >> >> Thanks, >> >> >> >> Jon >> >> >> >> public void resetWMSSelectControl() { >> >> if (wmsSelectControl != null) >> >> >> SmartWPS.getSmartWPS().getMap().removeControl(wmsSelectControl); >> >> WMSGetFeatureInfoOptions options = new >> WMSGetFeatureInfoOptions(); >> >> options.setLayers(getWMSMapLayers().toArray(new >> WMS[0])); >> >> options.setDrillDown(true); >> >> options.setQueryVisible(true); >> >> options.setInfoFormat("application/vnd.ogc.gml"); >> >> >> >> wmsSelectControl = new WMSGetFeatureInfo(options); >> >> wmsSelectControl.addGetFeatureListener(new >> GetFeatureInfoListener() { >> >> >> >> @Override >> >> public void onGetFeatureInfo( >> >> >> >> org.gwtopenmaps.openlayers.client.event.GetFeatureInfoListener.GetFeatureInfoEvent >> eventObject) { >> >> >> VectorFeature[] features = eventObject.getFeatures(); >> >> >> System.out.println("FeatureInfo: " + eventObject.getText()); >> >> } >> >> }); >> >> >> >> >> SmartWPS.getSmartWPS().getMap().addControl(wmsSelectControl); >> >> wmsSelectControl.activate(); >> >> } >> >> >> >> On 24 November 2010 16:01, Lukas Johansson <luk...@de...> >> wrote: >> >> I’ve commited a version that make the control a more complete and which >> uses the drilldown parameter introduced in OL 2.9[1] which can be used to >> access multiple servers. >> >> In october we realized that my patch hadn’t been commited so this was >> taken care of, however I do not think that its in the current stable build. >> Instead you need to checkout your own version. >> >> >> >> [1] >> http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown >> >> >> >> You add the controller to the map, if you do not use drilldown only to top >> layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not >> on the control itself. >> >> >> >> Usage is something along this path (copied from our working code, but you >> get the idea): >> >> WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); >> >> options.setLayers(arrayOfLayersToQuery)); >> //allows you to tell what layers that should >> be queried >> >> options.setDrillDown(true); >> >> options.setQueryVisible(true); >> >> options.setInfoFormat("application/vnd.ogc.gml"); >> //return result as gml >> >> >> >> >> >> >> >> wmsSelectControl = new WMSGetFeatureInfo(options); >> >> wmsSelectControl.addGetFeatureListener(new >> GetFeatureInfoListener(){ >> >> public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { >> >> VectorFeature[] features = eventObject.getFeatures(); >> >> >> String html = "foo"; >> >> FrameCloud popup = new FramedCloud("MapFeaturePopup", >> features[0].getCenterLonLat(), new Size(300, 400), html); >> >> } >> >> } >> >> map.addControl(wmsSelectControl); >> >> >> >> /Lukas >> >> >> >> Från: man...@go... >> [mailto:man...@go...] För Jon Britton >> Skickat: den 24 november 2010 16:42 >> Till: Lukas Johansson >> Kopia: gwt-openlayers-users >> Ämne: Re: [Gwt-openlayers-users] MapClickListener support >> >> >> >> Hi Lukas, >> >> >> >> You haven't misunderstood, I wasn't aware there was a map control for >> this. My client application is for displaying many WMS layers, possibly >> from different servers. The user can add/remove WMS layers as they see fit >> by using their own WMS URLs. What I want to do is display the feature info >> for every layer currently visible on my map, but I'm struggling to figure >> out how WMSGetFeatureInfo can be used for this as each control corresponds >> to only one WMS URL. Would I need to make a new control for each map layer? >> >> >> >> Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems >> to be incomplete as I can't access many of it's properties directly (such as >> url, title, layers...). >> >> >> >> Thanks, >> >> >> >> Jon >> >> >> >> On 24 November 2010 15:37, Lukas Johansson <luk...@de...> >> wrote: >> >> You want the x/y of the mouseclick in order to construct a >> WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to >> begin with? This will handle the events, the request to the server and you >> can get it to produce a parsable result in GML from witch you can create >> features. >> >> >> >> Or have I misunderstood your usecase? >> >> /Lukas >> >> >> >> >> >> Från: Jon Britton [mailto:jon...@go...] >> Skickat: den 24 november 2010 15:20 >> Till: gwt-openlayers-users >> Ämne: [Gwt-openlayers-users] MapClickListener support >> >> >> >> Hi >> >> >> >> I'm trying to register a MapClickListener so that I can generate a >> GetFeatureInfo request using the mouse x and y coordinates. Here is what >> I've got so far: >> >> >> >> mw.getMap().getListeners().add(new MapClickListener() { >> >> @Override >> >> public void onClick(MapClickEvent e) { >> >> SC.say("Map click at " + e.getLonLat()); >> >> } >> >> }); >> >> >> >> However, getListeners() isn't supported as far as I can tell (I get an >> UnsupportedOperationException on the first line above). Are there any plans >> to implement this soon? Alternatively, is there any other way to access the >> map coordinates of the mouse cursor? >> >> >> >> Thanks, >> >> >> >> Jon >> >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! >> Tap into the largest installed PC base & get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! >> Tap into the largest installed PC base & get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! >> Tap into the largest installed PC base & get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Jon B. <jon...@go...> - 2010-11-29 10:01:11
|
Sorry if I wasn't clear in my previous email, but the server is actually receiving and dealing with the request. I've tried another remote server and I get the same problem. I've debugged the website with Chrome, and it just hangs when making the request - it says "pending" under Status. However, the Chrome debugging console shows the following errors: XMLHttpRequest cannot load http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Atasmania_state_boundaries&QUERY_LAYERS=topp%3Atasmania_state_boundaries&STYLES=&BBOX=140.328735%2C-44.906872%2C151.98523%2C-38.315075&FEATURE_COUNT=10&HEIGHT=600&WIDTH=1061&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=592&Y=322. Origin http://127.0.0.1:8888 <http://127.0.0.1/> is not allowed by Access-Control-Allow-Origin. 1. Uncaught java.lang.IllegalArgumentException: Something other than a Java object was returned from JSNI method '@org.gwtopenmaps.openlayers.client.util.JSObjectHelper::getProperty(Lorg/gwtopenmaps/openlayers/client/util/JSObject;Ljava/lang/String;)': JS value of type int, expected java.lang.Object wms<http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=topp%3Atasmania_state_boundaries&QUERY_LAYERS=topp%3Atasmania_state_boundaries&STYLES=&BBOX=140.328735%2C-44.906872%2C151.98523%2C-38.315075&FEATURE_COUNT=10&HEIGHT=600&WIDTH=1061&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=592&Y=322>Failed to load resource Following the link loads the correct result. Jon On 29 November 2010 08:42, Lukas Johansson <luk...@de...>wrote: > Have you checked with firebug if any request are actually sent? Probably > they aren’t as you get a JS error and you don’t see anything in the log at > the server. > > By just “dry reading” your code I don’t see anything that pops out. > > You do get a “String cannot be cast to JSObject” exception and the only row > I can guess cases this is: > > options.setLayers(getWMSMapLayers().toArray(new WMS[0])); > > > > What does getWMSMapLayers() return? Which toArray method is called?.... > > /Lukas > > > > > > *Från:* man...@go... [mailto: > man...@go...] *För *Jon Britton > > *Skickat:* den 26 november 2010 18:49 > *Till:* Lukas Johansson > *Kopia:* gwt-openlayers-users > *Ämne:* Re: [Gwt-openlayers-users] MapClickListener support > > > > Hi Lukas, > > > > I've added a WMSGetFeatureInfo control to my map, but when I make a request > (by clicking on the map) the map freezes. I've checked by WMS server logs > and it did receive a GetFeatureInfo request and seems to have returned a > result. > > > > I was originally testing in Google Chrome, but I tried Firefox and get the > same problem - however I also get a JavaScript exception: > > > > Uncaught JavaScript exception [uncaught exception: > java.lang.ClassCastException: java.lang.String cannot be cast to > org.gwtopenmaps.openlayers.client.util.JSObject] in , line 0 > > > > Any idea what could be causing this? My code is shown below. > > > > Thanks, > > > > Jon > > > > public void resetWMSSelectControl() { > > if (wmsSelectControl != null) > > > SmartWPS.getSmartWPS().getMap().removeControl(wmsSelectControl); > > WMSGetFeatureInfoOptions options = new > WMSGetFeatureInfoOptions(); > > options.setLayers(getWMSMapLayers().toArray(new > WMS[0])); > > options.setDrillDown(true); > > options.setQueryVisible(true); > > options.setInfoFormat("application/vnd.ogc.gml"); > > > > wmsSelectControl = new WMSGetFeatureInfo(options); > > wmsSelectControl.addGetFeatureListener(new > GetFeatureInfoListener() { > > > > @Override > > public void onGetFeatureInfo( > > > org.gwtopenmaps.openlayers.client.event.GetFeatureInfoListener.GetFeatureInfoEvent > eventObject) { > > VectorFeature[] > features = eventObject.getFeatures(); > > System.out.println("FeatureInfo: > " + eventObject.getText()); > > } > > }); > > > > > SmartWPS.getSmartWPS().getMap().addControl(wmsSelectControl); > > wmsSelectControl.activate(); > > } > > > > On 24 November 2010 16:01, Lukas Johansson <luk...@de...> > wrote: > > I’ve commited a version that make the control a more complete and which > uses the drilldown parameter introduced in OL 2.9[1] which can be used to > access multiple servers. > > In october we realized that my patch hadn’t been commited so this was > taken care of, however I do not think that its in the current stable build. > Instead you need to checkout your own version. > > > > [1] > http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown > > > > You add the controller to the map, if you do not use drilldown only to top > layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not > on the control itself. > > > > Usage is something along this path (copied from our working code, but you > get the idea): > > WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); > > options.setLayers(arrayOfLayersToQuery)); > //allows you to tell what layers that should > be queried > > options.setDrillDown(true); > > options.setQueryVisible(true); > > options.setInfoFormat("application/vnd.ogc.gml"); > //return result as gml > > > > > > > > wmsSelectControl = new WMSGetFeatureInfo(options); > > wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener(){ > > > public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { > > VectorFeature[] features = eventObject.getFeatures(); > > > String html = "foo"; > > FrameCloud popup = new FramedCloud("MapFeaturePopup", > features[0].getCenterLonLat(), new Size(300, 400), html); > > } > > } > > map.addControl(wmsSelectControl); > > > > /Lukas > > > > *Från:* man...@go... [mailto: > man...@go...] *För *Jon Britton > *Skickat:* den 24 november 2010 16:42 > *Till:* Lukas Johansson > *Kopia:* gwt-openlayers-users > *Ämne:* Re: [Gwt-openlayers-users] MapClickListener support > > > > Hi Lukas, > > > > You haven't misunderstood, I wasn't aware there was a map control for this. > My client application is for displaying many WMS layers, possibly from > different servers. The user can add/remove WMS layers as they see fit by > using their own WMS URLs. What I want to do is display the feature info for > every layer currently visible on my map, but I'm struggling to figure out > how WMSGetFeatureInfo can be used for this as each control corresponds to > only one WMS URL. Would I need to make a new control for each map layer? > > > > Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems > to be incomplete as I can't access many of it's properties directly (such as > url, title, layers...). > > > > Thanks, > > > > Jon > > > > On 24 November 2010 15:37, Lukas Johansson <luk...@de...> > wrote: > > You want the x/y of the mouseclick in order to construct a > WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to > begin with? This will handle the events, the request to the server and you > can get it to produce a parsable result in GML from witch you can create > features. > > > > Or have I misunderstood your usecase? > > /Lukas > > > > > > *Från:* Jon Britton [mailto:jon...@go...] > *Skickat:* den 24 november 2010 15:20 > *Till:* gwt-openlayers-users > *Ämne:* [Gwt-openlayers-users] MapClickListener support > > > > Hi > > > > I'm trying to register a MapClickListener so that I can generate a > GetFeatureInfo request using the mouse x and y coordinates. Here is what > I've got so far: > > > > mw.getMap().getListeners().add(new MapClickListener() { > > @Override > > public void onClick(MapClickEvent e) { > > SC.say("Map click at " + e.getLonLat()); > > } > > }); > > > > However, getListeners() isn't supported as far as I can tell (I get an > UnsupportedOperationException on the first line above). Are there any plans > to implement this soon? Alternatively, is there any other way to access the > map coordinates of the mouse cursor? > > > > Thanks, > > > > Jon > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Lukas J. <luk...@de...> - 2010-11-29 08:40:35
|
Have you checked with firebug if any request are actually sent? Probably they aren't as you get a JS error and you don't see anything in the log at the server. By just "dry reading" your code I don't see anything that pops out. You do get a "String cannot be cast to JSObject" exception and the only row I can guess cases this is: options.setLayers(getWMSMapLayers().toArray(new WMS[0])); What does getWMSMapLayers() return? Which toArray method is called?.... /Lukas Från: man...@go... [mailto:man...@go...] För Jon Britton Skickat: den 26 november 2010 18:49 Till: Lukas Johansson Kopia: gwt-openlayers-users Ämne: Re: [Gwt-openlayers-users] MapClickListener support Hi Lukas, I've added a WMSGetFeatureInfo control to my map, but when I make a request (by clicking on the map) the map freezes. I've checked by WMS server logs and it did receive a GetFeatureInfo request and seems to have returned a result. I was originally testing in Google Chrome, but I tried Firefox and get the same problem - however I also get a JavaScript exception: Uncaught JavaScript exception [uncaught exception: java.lang.ClassCastException: java.lang.String cannot be cast to org.gwtopenmaps.openlayers.client.util.JSObject] in , line 0 Any idea what could be causing this? My code is shown below. Thanks, Jon public void resetWMSSelectControl() { if (wmsSelectControl != null) SmartWPS.getSmartWPS().getMap().removeControl(wmsSelectControl); WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); options.setLayers(getWMSMapLayers().toArray(new WMS[0])); options.setDrillDown(true); options.setQueryVisible(true); options.setInfoFormat("application/vnd.ogc.gml"); wmsSelectControl = new WMSGetFeatureInfo(options); wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener() { @Override public void onGetFeatureInfo( org.gwtopenmaps.openlayers.client.event.GetFeatureInfoListener.GetFeatureInfoEvent eventObject) { VectorFeature[] features = eventObject.getFeatures(); System.out.println("FeatureInfo: " + eventObject.getText()); } }); SmartWPS.getSmartWPS().getMap().addControl(wmsSelectControl); wmsSelectControl.activate(); } On 24 November 2010 16:01, Lukas Johansson <luk...@de...> wrote: I've commited a version that make the control a more complete and which uses the drilldown parameter introduced in OL 2.9[1] which can be used to access multiple servers. In october we realized that my patch hadn't been commited so this was taken care of, however I do not think that its in the current stable build. Instead you need to checkout your own version. [1] http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown You add the controller to the map, if you do not use drilldown only to top layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not on the control itself. Usage is something along this path (copied from our working code, but you get the idea): WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); options.setLayers(arrayOfLayersToQuery)); //allows you to tell what layers that should be queried options.setDrillDown(true); options.setQueryVisible(true); options.setInfoFormat("application/vnd.ogc.gml"); //return result as gml wmsSelectControl = new WMSGetFeatureInfo(options); wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener(){ public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { VectorFeature[] features = eventObject.getFeatures(); String html = "foo"; FrameCloud popup = new FramedCloud("MapFeaturePopup", features[0].getCenterLonLat(), new Size(300, 400), html); } } map.addControl(wmsSelectControl); /Lukas Från: man...@go... [mailto:man...@go...] För Jon Britton Skickat: den 24 november 2010 16:42 Till: Lukas Johansson Kopia: gwt-openlayers-users Ämne: Re: [Gwt-openlayers-users] MapClickListener support Hi Lukas, You haven't misunderstood, I wasn't aware there was a map control for this. My client application is for displaying many WMS layers, possibly from different servers. The user can add/remove WMS layers as they see fit by using their own WMS URLs. What I want to do is display the feature info for every layer currently visible on my map, but I'm struggling to figure out how WMSGetFeatureInfo can be used for this as each control corresponds to only one WMS URL. Would I need to make a new control for each map layer? Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems to be incomplete as I can't access many of it's properties directly (such as url, title, layers...). Thanks, Jon On 24 November 2010 15:37, Lukas Johansson <luk...@de...> wrote: You want the x/y of the mouseclick in order to construct a WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to begin with? This will handle the events, the request to the server and you can get it to produce a parsable result in GML from witch you can create features. Or have I misunderstood your usecase? /Lukas Från: Jon Britton [mailto:jon...@go...] Skickat: den 24 november 2010 15:20 Till: gwt-openlayers-users Ämne: [Gwt-openlayers-users] MapClickListener support Hi I'm trying to register a MapClickListener so that I can generate a GetFeatureInfo request using the mouse x and y coordinates. Here is what I've got so far: mw.getMap().getListeners().add(new MapClickListener() { @Override public void onClick(MapClickEvent e) { SC.say("Map click at " + e.getLonLat()); } }); However, getListeners() isn't supported as far as I can tell (I get an UnsupportedOperationException on the first line above). Are there any plans to implement this soon? Alternatively, is there any other way to access the map coordinates of the mouse cursor? Thanks, Jon ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Gwt-openlayers-users mailing list Gwt...@li... https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Gwt-openlayers-users mailing list Gwt...@li... https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users |
From: Jon B. <jon...@go...> - 2010-11-26 17:49:44
|
Hi Lukas, I've added a WMSGetFeatureInfo control to my map, but when I make a request (by clicking on the map) the map freezes. I've checked by WMS server logs and it did receive a GetFeatureInfo request and seems to have returned a result. I was originally testing in Google Chrome, but I tried Firefox and get the same problem - however I also get a JavaScript exception: Uncaught JavaScript exception [uncaught exception: java.lang.ClassCastException: java.lang.String cannot be cast to org.gwtopenmaps.openlayers.client.util.JSObject] in , line 0 Any idea what could be causing this? My code is shown below. Thanks, Jon public void resetWMSSelectControl() { if (wmsSelectControl != null) SmartWPS.getSmartWPS().getMap().removeControl(wmsSelectControl); WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); options.setLayers(getWMSMapLayers().toArray(new WMS[0])); options.setDrillDown(true); options.setQueryVisible(true); options.setInfoFormat("application/vnd.ogc.gml"); wmsSelectControl = new WMSGetFeatureInfo(options); wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener() { @Override public void onGetFeatureInfo( org.gwtopenmaps.openlayers.client.event.GetFeatureInfoListener.GetFeatureInfoEvent eventObject) { VectorFeature[] features = eventObject.getFeatures(); System.out.println("FeatureInfo: " + eventObject.getText()); } }); SmartWPS.getSmartWPS().getMap().addControl(wmsSelectControl); wmsSelectControl.activate(); } On 24 November 2010 16:01, Lukas Johansson <luk...@de...>wrote: > I’ve commited a version that make the control a more complete and which > uses the drilldown parameter introduced in OL 2.9[1] which can be used to > access multiple servers. > > In october we realized that my patch hadn’t been commited so this was > taken care of, however I do not think that its in the current stable build. > Instead you need to checkout your own version. > > > > [1] > http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown > > > > You add the controller to the map, if you do not use drilldown only to top > layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not > on the control itself. > > > > Usage is something along this path (copied from our working code, but you > get the idea): > > WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); > > options.setLayers(arrayOfLayersToQuery)); > //allows you to tell what layers that should > be queried > > options.setDrillDown(true); > > options.setQueryVisible(true); > > options.setInfoFormat("application/vnd.ogc.gml"); > //return result as gml > > > > > > > > wmsSelectControl = new WMSGetFeatureInfo(options); > > wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener(){ > > > public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { > > VectorFeature[] features = eventObject.getFeatures(); > > > String html = "foo"; > > FrameCloud popup = new FramedCloud("MapFeaturePopup", > features[0].getCenterLonLat(), new Size(300, 400), html); > > } > > } > > map.addControl(wmsSelectControl); > > > > /Lukas > > > > *Från:* man...@go... [mailto: > man...@go...] *För *Jon Britton > *Skickat:* den 24 november 2010 16:42 > *Till:* Lukas Johansson > *Kopia:* gwt-openlayers-users > *Ämne:* Re: [Gwt-openlayers-users] MapClickListener support > > > > Hi Lukas, > > > > You haven't misunderstood, I wasn't aware there was a map control for this. > My client application is for displaying many WMS layers, possibly from > different servers. The user can add/remove WMS layers as they see fit by > using their own WMS URLs. What I want to do is display the feature info for > every layer currently visible on my map, but I'm struggling to figure out > how WMSGetFeatureInfo can be used for this as each control corresponds to > only one WMS URL. Would I need to make a new control for each map layer? > > > > Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems > to be incomplete as I can't access many of it's properties directly (such as > url, title, layers...). > > > > Thanks, > > > > Jon > > > > On 24 November 2010 15:37, Lukas Johansson <luk...@de...> > wrote: > > You want the x/y of the mouseclick in order to construct a > WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to > begin with? This will handle the events, the request to the server and you > can get it to produce a parsable result in GML from witch you can create > features. > > > > Or have I misunderstood your usecase? > > /Lukas > > > > > > *Från:* Jon Britton [mailto:jon...@go...] > *Skickat:* den 24 november 2010 15:20 > *Till:* gwt-openlayers-users > *Ämne:* [Gwt-openlayers-users] MapClickListener support > > > > Hi > > > > I'm trying to register a MapClickListener so that I can generate a > GetFeatureInfo request using the mouse x and y coordinates. Here is what > I've got so far: > > > > mw.getMap().getListeners().add(new MapClickListener() { > > @Override > > public void onClick(MapClickEvent e) { > > SC.say("Map click at " + e.getLonLat()); > > } > > }); > > > > However, getListeners() isn't supported as far as I can tell (I get an > UnsupportedOperationException on the first line above). Are there any plans > to implement this soon? Alternatively, is there any other way to access the > map coordinates of the mouse cursor? > > > > Thanks, > > > > Jon > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Jon B. <jon...@go...> - 2010-11-25 12:00:41
|
Oh, sorry, didn't notice you told me to checkout my own version. On 25 November 2010 11:03, Jon Britton <jon...@go...> wrote: > Hi Lukas, thanks for the help. Could you please tell me where I can get > the latest GWT-OpenLayers build? I can't seem to find it. > > Cheers, > > Jon > > > On 24 November 2010 16:01, Lukas Johansson <luk...@de...>wrote: > >> I’ve commited a version that make the control a more complete and which >> uses the drilldown parameter introduced in OL 2.9[1] which can be used to >> access multiple servers. >> >> In october we realized that my patch hadn’t been commited so this was >> taken care of, however I do not think that its in the current stable build. >> Instead you need to checkout your own version. >> >> >> >> [1] >> http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown >> >> >> >> You add the controller to the map, if you do not use drilldown only to top >> layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not >> on the control itself. >> >> >> >> Usage is something along this path (copied from our working code, but you >> get the idea): >> >> WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); >> >> options.setLayers(arrayOfLayersToQuery)); >> //allows you to tell what layers that should >> be queried >> >> options.setDrillDown(true); >> >> options.setQueryVisible(true); >> >> options.setInfoFormat("application/vnd.ogc.gml"); >> //return result as gml >> >> >> >> >> >> >> >> wmsSelectControl = new WMSGetFeatureInfo(options); >> >> wmsSelectControl.addGetFeatureListener(new >> GetFeatureInfoListener(){ >> >> public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { >> >> VectorFeature[] features = eventObject.getFeatures(); >> >> >> String html = "foo"; >> >> FrameCloud popup = new FramedCloud("MapFeaturePopup", >> features[0].getCenterLonLat(), new Size(300, 400), html); >> >> } >> >> } >> >> map.addControl(wmsSelectControl); >> >> >> >> /Lukas >> >> >> >> *Från:* man...@go... [mailto: >> man...@go...] *För *Jon Britton >> *Skickat:* den 24 november 2010 16:42 >> *Till:* Lukas Johansson >> *Kopia:* gwt-openlayers-users >> *Ämne:* Re: [Gwt-openlayers-users] MapClickListener support >> >> >> >> Hi Lukas, >> >> >> >> You haven't misunderstood, I wasn't aware there was a map control for >> this. My client application is for displaying many WMS layers, possibly >> from different servers. The user can add/remove WMS layers as they see fit >> by using their own WMS URLs. What I want to do is display the feature info >> for every layer currently visible on my map, but I'm struggling to figure >> out how WMSGetFeatureInfo can be used for this as each control corresponds >> to only one WMS URL. Would I need to make a new control for each map layer? >> >> >> >> Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems >> to be incomplete as I can't access many of it's properties directly (such as >> url, title, layers...). >> >> >> >> Thanks, >> >> >> >> Jon >> >> >> >> On 24 November 2010 15:37, Lukas Johansson <luk...@de...> >> wrote: >> >> You want the x/y of the mouseclick in order to construct a >> WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to >> begin with? This will handle the events, the request to the server and you >> can get it to produce a parsable result in GML from witch you can create >> features. >> >> >> >> Or have I misunderstood your usecase? >> >> /Lukas >> >> >> >> >> >> *Från:* Jon Britton [mailto:jon...@go...] >> *Skickat:* den 24 november 2010 15:20 >> *Till:* gwt-openlayers-users >> *Ämne:* [Gwt-openlayers-users] MapClickListener support >> >> >> >> Hi >> >> >> >> I'm trying to register a MapClickListener so that I can generate a >> GetFeatureInfo request using the mouse x and y coordinates. Here is what >> I've got so far: >> >> >> >> mw.getMap().getListeners().add(new MapClickListener() { >> >> @Override >> >> public void onClick(MapClickEvent e) { >> >> SC.say("Map click at " + e.getLonLat()); >> >> } >> >> }); >> >> >> >> However, getListeners() isn't supported as far as I can tell (I get an >> UnsupportedOperationException on the first line above). Are there any plans >> to implement this soon? Alternatively, is there any other way to access the >> map coordinates of the mouse cursor? >> >> >> >> Thanks, >> >> >> >> Jon >> >> >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! >> Tap into the largest installed PC base & get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! >> Tap into the largest installed PC base & get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> > |
From: Jon B. <jon...@go...> - 2010-11-25 11:04:02
|
Hi Lukas, thanks for the help. Could you please tell me where I can get the latest GWT-OpenLayers build? I can't seem to find it. Cheers, Jon On 24 November 2010 16:01, Lukas Johansson <luk...@de...>wrote: > I’ve commited a version that make the control a more complete and which > uses the drilldown parameter introduced in OL 2.9[1] which can be used to > access multiple servers. > > In october we realized that my patch hadn’t been commited so this was > taken care of, however I do not think that its in the current stable build. > Instead you need to checkout your own version. > > > > [1] > http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown > > > > You add the controller to the map, if you do not use drilldown only to top > layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not > on the control itself. > > > > Usage is something along this path (copied from our working code, but you > get the idea): > > WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); > > options.setLayers(arrayOfLayersToQuery)); > //allows you to tell what layers that should > be queried > > options.setDrillDown(true); > > options.setQueryVisible(true); > > options.setInfoFormat("application/vnd.ogc.gml"); > //return result as gml > > > > > > > > wmsSelectControl = new WMSGetFeatureInfo(options); > > wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener(){ > > > public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { > > VectorFeature[] features = eventObject.getFeatures(); > > > String html = "foo"; > > FrameCloud popup = new FramedCloud("MapFeaturePopup", > features[0].getCenterLonLat(), new Size(300, 400), html); > > } > > } > > map.addControl(wmsSelectControl); > > > > /Lukas > > > > *Från:* man...@go... [mailto: > man...@go...] *För *Jon Britton > *Skickat:* den 24 november 2010 16:42 > *Till:* Lukas Johansson > *Kopia:* gwt-openlayers-users > *Ämne:* Re: [Gwt-openlayers-users] MapClickListener support > > > > Hi Lukas, > > > > You haven't misunderstood, I wasn't aware there was a map control for this. > My client application is for displaying many WMS layers, possibly from > different servers. The user can add/remove WMS layers as they see fit by > using their own WMS URLs. What I want to do is display the feature info for > every layer currently visible on my map, but I'm struggling to figure out > how WMSGetFeatureInfo can be used for this as each control corresponds to > only one WMS URL. Would I need to make a new control for each map layer? > > > > Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems > to be incomplete as I can't access many of it's properties directly (such as > url, title, layers...). > > > > Thanks, > > > > Jon > > > > On 24 November 2010 15:37, Lukas Johansson <luk...@de...> > wrote: > > You want the x/y of the mouseclick in order to construct a > WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to > begin with? This will handle the events, the request to the server and you > can get it to produce a parsable result in GML from witch you can create > features. > > > > Or have I misunderstood your usecase? > > /Lukas > > > > > > *Från:* Jon Britton [mailto:jon...@go...] > *Skickat:* den 24 november 2010 15:20 > *Till:* gwt-openlayers-users > *Ämne:* [Gwt-openlayers-users] MapClickListener support > > > > Hi > > > > I'm trying to register a MapClickListener so that I can generate a > GetFeatureInfo request using the mouse x and y coordinates. Here is what > I've got so far: > > > > mw.getMap().getListeners().add(new MapClickListener() { > > @Override > > public void onClick(MapClickEvent e) { > > SC.say("Map click at " + e.getLonLat()); > > } > > }); > > > > However, getListeners() isn't supported as far as I can tell (I get an > UnsupportedOperationException on the first line above). Are there any plans > to implement this soon? Alternatively, is there any other way to access the > map coordinates of the mouse cursor? > > > > Thanks, > > > > Jon > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Lukas J. <luk...@de...> - 2010-11-24 16:02:28
|
I've commited a version that make the control a more complete and which uses the drilldown parameter introduced in OL 2.9[1] which can be used to access multiple servers. In october we realized that my patch hadn't been commited so this was taken care of, however I do not think that its in the current stable build. Instead you need to checkout your own version. [1] http://dev.openlayers.org/releases/OpenLayers-2.9.1/doc/apidocs/files/OpenLayers/Control/WMSGetFeatureInfo-js.html#OpenLayers.Control.WMSGetFeatureInfo.drillDown You add the controller to the map, if you do not use drilldown only to top layer is queried. Most settings are set in WmsGetFeatureInfoOptions and not on the control itself. Usage is something along this path (copied from our working code, but you get the idea): WMSGetFeatureInfoOptions options = new WMSGetFeatureInfoOptions(); options.setLayers(arrayOfLayersToQuery)); //allows you to tell what layers that should be queried options.setDrillDown(true); options.setQueryVisible(true); options.setInfoFormat("application/vnd.ogc.gml"); //return result as gml wmsSelectControl = new WMSGetFeatureInfo(options); wmsSelectControl.addGetFeatureListener(new GetFeatureInfoListener(){ public void onGetFeatureInfo(GetFeatureInfoEvent eventObject) { VectorFeature[] features = eventObject.getFeatures(); String html = "foo"; FrameCloud popup = new FramedCloud("MapFeaturePopup", features[0].getCenterLonLat(), new Size(300, 400), html); } } map.addControl(wmsSelectControl); /Lukas Från: man...@go... [mailto:man...@go...] För Jon Britton Skickat: den 24 november 2010 16:42 Till: Lukas Johansson Kopia: gwt-openlayers-users Ämne: Re: [Gwt-openlayers-users] MapClickListener support Hi Lukas, You haven't misunderstood, I wasn't aware there was a map control for this. My client application is for displaying many WMS layers, possibly from different servers. The user can add/remove WMS layers as they see fit by using their own WMS URLs. What I want to do is display the feature info for every layer currently visible on my map, but I'm struggling to figure out how WMSGetFeatureInfo can be used for this as each control corresponds to only one WMS URL. Would I need to make a new control for each map layer? Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems to be incomplete as I can't access many of it's properties directly (such as url, title, layers...). Thanks, Jon On 24 November 2010 15:37, Lukas Johansson <luk...@de...> wrote: You want the x/y of the mouseclick in order to construct a WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to begin with? This will handle the events, the request to the server and you can get it to produce a parsable result in GML from witch you can create features. Or have I misunderstood your usecase? /Lukas Från: Jon Britton [mailto:jon...@go...] Skickat: den 24 november 2010 15:20 Till: gwt-openlayers-users Ämne: [Gwt-openlayers-users] MapClickListener support Hi I'm trying to register a MapClickListener so that I can generate a GetFeatureInfo request using the mouse x and y coordinates. Here is what I've got so far: mw.getMap().getListeners().add(new MapClickListener() { @Override public void onClick(MapClickEvent e) { SC.say("Map click at " + e.getLonLat()); } }); However, getListeners() isn't supported as far as I can tell (I get an UnsupportedOperationException on the first line above). Are there any plans to implement this soon? Alternatively, is there any other way to access the map coordinates of the mouse cursor? Thanks, Jon ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Gwt-openlayers-users mailing list Gwt...@li... https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users |
From: Jon B. <jon...@go...> - 2010-11-24 15:42:58
|
Hi Lukas, You haven't misunderstood, I wasn't aware there was a map control for this. My client application is for displaying many WMS layers, possibly from different servers. The user can add/remove WMS layers as they see fit by using their own WMS URLs. What I want to do is display the feature info for every layer currently visible on my map, but I'm struggling to figure out how WMSGetFeatureInfo can be used for this as each control corresponds to only one WMS URL. Would I need to make a new control for each map layer? Another problem is that the GWT-Openlayers WMGetFeatureInfo control seems to be incomplete as I can't access many of it's properties directly (such as url, title, layers...). Thanks, Jon On 24 November 2010 15:37, Lukas Johansson <luk...@de...>wrote: > You want the x/y of the mouseclick in order to construct a > WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to > begin with? This will handle the events, the request to the server and you > can get it to produce a parsable result in GML from witch you can create > features. > > > > Or have I misunderstood your usecase? > > /Lukas > > > > > > *Från:* Jon Britton [mailto:jon...@go...] > *Skickat:* den 24 november 2010 15:20 > *Till:* gwt-openlayers-users > *Ämne:* [Gwt-openlayers-users] MapClickListener support > > > > Hi > > > > I'm trying to register a MapClickListener so that I can generate a > GetFeatureInfo request using the mouse x and y coordinates. Here is what > I've got so far: > > > > mw.getMap().getListeners().add(new MapClickListener() { > > @Override > > public void onClick(MapClickEvent e) { > > SC.say("Map click at " + e.getLonLat()); > > } > > }); > > > > However, getListeners() isn't supported as far as I can tell (I get an > UnsupportedOperationException on the first line above). Are there any plans > to implement this soon? Alternatively, is there any other way to access the > map coordinates of the mouse cursor? > > > > Thanks, > > > > Jon > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Lukas J. <luk...@de...> - 2010-11-24 15:35:23
|
You want the x/y of the mouseclick in order to construct a WMSGetFeautureInfo? Why not use the existing WMSGetFeatureInfo control to begin with? This will handle the events, the request to the server and you can get it to produce a parsable result in GML from witch you can create features. Or have I misunderstood your usecase? /Lukas Från: Jon Britton [mailto:jon...@go...] Skickat: den 24 november 2010 15:20 Till: gwt-openlayers-users Ämne: [Gwt-openlayers-users] MapClickListener support Hi I'm trying to register a MapClickListener so that I can generate a GetFeatureInfo request using the mouse x and y coordinates. Here is what I've got so far: mw.getMap().getListeners().add(new MapClickListener() { @Override public void onClick(MapClickEvent e) { SC.say("Map click at " + e.getLonLat()); } }); However, getListeners() isn't supported as far as I can tell (I get an UnsupportedOperationException on the first line above). Are there any plans to implement this soon? Alternatively, is there any other way to access the map coordinates of the mouse cursor? Thanks, Jon |
From: Jon B. <jon...@go...> - 2010-11-24 14:20:20
|
Hi I'm trying to register a MapClickListener so that I can generate a GetFeatureInfo request using the mouse x and y coordinates. Here is what I've got so far: mw.getMap().getListeners().add(new MapClickListener() { @Override public void onClick(MapClickEvent e) { SC.say("Map click at " + e.getLonLat()); } }); However, getListeners() isn't supported as far as I can tell (I get an UnsupportedOperationException on the first line above). Are there any plans to implement this soon? Alternatively, is there any other way to access the map coordinates of the mouse cursor? Thanks, Jon |
From: Edwin C. <com...@gm...> - 2010-11-04 19:49:50
|
Hi Andrew, Every place where you refer to an object that has been placed on the window you need $wnd , so that is everywhere where you reference OpenLayers.something it should be $wnd.OpenLayers.something. Greetings, Edwin On 4 November 2010 00:22, Andrew Hughes <ahh...@gm...> wrote: > Getting close but not yet, I think my native javascript is fundementally > flawed... says "OpenLayers is undefined".... perhaps I am missing some > $wnd.* somewhere :'( Any idea's? Sorry to bug people... > ------------------------------------------------------------------------------------ > public class HoverControl extends Control { > public interface HoverControlListener { > void onPause(JSObject evt); > void onMove(JSObject evt); > } > protected HoverControl(JSObject element) { > super(element); > } > public HoverControl(HoverControlListener listener) { > this(HoverControlImpl.create(listener)); > } > public static HoverControl narrowToHoverControl(JSObject element) { > return (element == null) ? null: new HoverControl(element); > } > } > ------------------------------------------------------------------------------------ > class HoverControlImpl { > public static native JSObject create(HoverControl.HoverControlListener > callback) /*-{ > OpenLayers.Control.Hover = OpenLayers.Class(OpenLayers.Control, { > > defaultHandlerOptions: { > 'delay': 500, > 'pixelTolerance': null, > 'stopMove': false > }, > > initialize: function(options) { > this.handlerOptions = OpenLayers.Util.extend( > {}, this.defaultHandlerOptions > ); > OpenLayers.Control.prototype.initialize.apply( > this, arguments > ); > this.handler = new OpenLayers.Handler.Hover( > this, > {'pause': this.onPause, 'move': this.onMove}, > this.handlerOptions > ); > }, > > onPause: function(evt) { > > callback.@com.acme.client.hover.HoverControl.HoverControlListener::onPause(Lorg/gwtopenmaps/openlayers/client/util/JSObject;)(evt); > }, > > onMove: function(evt) { > > callback.@com.acme.client.hover.HoverControl.HoverControlListener::onPause(Lorg/gwtopenmaps/openlayers/client/util/JSObject;)(evt); > } > }); > return new $wnd.OpenLayers.Control.Hover(); > }-*/; > > } > ------------------------------------------------------------------------------------ > > > On Wed, Nov 3, 2010 at 6:08 AM, Edwin Commandeur > <com...@gm...> wrote: >> >> Hi Andrew, >> >> The example you send works nicely, so I wonder what you are confused >> about in native JavaScript. Seems a perfectly fine example of a custom >> Handler. >> >> A way to incorporate this handler in GWT-OL is by adding the code for >> the Hover control in a javascript file and distribute that with GWT-OL >> and wrap the native javascript like we wrap other Controls. >> >> There are already some javascript utility functions which are in: >> >> gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/public/js/gwt-openlayers/utils.js >> >> Maybe we could put a ol-extensions.js file in there, and also make >> clear in the GWT wrapper class namespace that it uses stuff in this >> extensions file. >> >> Another way would be to distribute the handler code with >> GWT-OpenLayers and explain in the wrapper Javadoc that the js file >> needs to be loaded in the page to use that specific wrapper class. >> >> A combination of Javascript and GWT wrapper seems the way to go, since >> I don't see a way to provide a Control in native GWT (you would always >> need JSNI to add functions to the Control as fas as I can see). >> >> Greetings, >> Edwin >> >> On 2 November 2010 13:45, Andrew Hughes <ahh...@gm...> wrote: >> > Hi Everyone, >> > We have a requirement that we need to register a hover handler on a map. >> > GWT-OpenLayers can't do this yet and the native javascript has me a >> > little >> > confused... I have a simple javascript example working below. This seems >> > like it would be complex to wrap, advice would be most appreciated. >> > >> > >> > <html xmlns="http://www.w3.org/1999/xhtml"> >> > <head> >> > <link rel="stylesheet" >> > href="http://openlayers.org/dev/theme/default/style.css" type="text/css" >> > /> >> > <link rel="stylesheet" >> > href="http://openlayers.org/dev/examples/style.css" type="text/css" /> >> > >> > <style type="text/css"> >> > #map { >> > width: 640px; >> > height: 480px; >> > } >> > </style> >> > <script >> > src="http://openlayers.org/dev/lib/Firebug/firebug.js"></script> >> > <script src="http://openlayers.org/dev/OpenLayers.js"></script> >> > <script type="text/javascript"> >> > >> > OpenLayers.Control.Hover = >> > OpenLayers.Class(OpenLayers.Control, >> > { >> > defaultHandlerOptions: { >> > 'delay': 500, >> > 'pixelTolerance': null, >> > 'stopMove': false >> > }, >> > >> > initialize: function(options) { >> > this.handlerOptions = OpenLayers.Util.extend( >> > {}, this.defaultHandlerOptions >> > ); >> > OpenLayers.Control.prototype.initialize.apply( >> > this, arguments >> > ); >> > this.handler = new OpenLayers.Handler.Hover( >> > this, >> > {'pause': this.onPause, 'move': this.onMove}, >> > this.handlerOptions >> > ); >> > }, >> > >> > onPause: function(evt) { >> > var output = document.getElementById('output'); >> > var msg = 'pause ' + evt.xy; >> > output.value = output.value + msg + "\r\n"; >> > }, >> > >> > onMove: function(evt) { >> > // do something... like cancel >> > } >> > }); >> > >> > var map; >> > >> > function init(){ >> > map = new OpenLayers.Map('map'); >> > var layer = new OpenLayers.Layer.WMS('OpenLayers >> > WMS','http://vmap0.tiles.osgeo.org/wms/vmap0',{layers: 'basic'}); >> > map.addLayers([layer]); >> > var hoverControl = new OpenLayers.Control.Hover({ >> > handlerOptions: { >> > 'delay': 500 >> > } >> > }); >> > map.addControl(hoverControl); >> > map.zoomToMaxExtent(); >> > hoverControl.activate(); >> > } >> > >> > </script> >> > </head> >> > <body onload="init()"> >> > <div id="map" class="smallmap"></div> >> > <textarea class="output" id="output"></textarea></td> >> > </body> >> > </html> >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Nokia and AT&T present the 2010 Calling All Innovators-North America >> > contest >> > Create new apps & games for the Nokia N8 for consumers in U.S. and >> > Canada >> > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in >> > marketing >> > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store >> > http://p.sf.net/sfu/nokia-dev2dev >> > _______________________________________________ >> > Gwt-openlayers-users mailing list >> > Gwt...@li... >> > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> > >> > > > |