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: Farrukh N. <fa...@we...> - 2009-03-20 15:56:18
|
I am using MapWidget inside another GWT toolkit. I find that sometime when the container for MapWidget is repainted the MapWidget does not get repainted. Is there a way to force repaint of MapWidget (Sorry if this may be a generic GWT question). Thanks. -- Regards, Farrukh Web: http://www.wellfleetsoftware.com |
From: Edwin C. <com...@gm...> - 2009-03-18 20:10:06
|
Hi Farrukh, Setting a timeout on a WMS server from the client doesn't sound to me like something that will work. It is certainly not a standard WMS parameter. Outside that, the WMS call could be routed over a proxy that sets it's own time-outs, so even if the WMS server would allow setting time-outs, a proxy could still intervene IMHO. As far as I can tell, the second option would be more interesting to look at. I know that you can pass an array of url's to optimize tile loading: http://trac.openlayers.org/wiki/OpenLayersOptimization I don't know if OL will use the urls that work if others fail. In principle this is possible because all layers are html img elements at their core and img elements fire an onload event when the image is downloaded. http://www.htmlcodetutorial.com/images/_IMG_onLoad.html Therefore it is possible to track the time from the request to the onload event, and when it exceeds a certain time limit another url could be tried for the same picture. Greetings, Edwin 2009/3/18 Farrukh Najmi <fa...@we...> > > I just spent a few hours tracking down a problem that turned out to be > an unresponsive WMS server at <http://labs.metacarta.com/wms-c/Basic.py>. > > I was wondering if there is a way to set a timeout on WMS server > connection when doing a "new WMS(...)" call. > Also is there a way to set a set of alternate WMS servers if the primary > WMS server fails to respond within a set timeout? > > Thanks for any advice. > > -- > Regards, > Farrukh > > Web: http://www.wellfleetsoftware.com > > > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |
From: Farrukh N. <fa...@we...> - 2009-03-18 13:45:48
|
I just spent a few hours tracking down a problem that turned out to be an unresponsive WMS server at <http://labs.metacarta.com/wms-c/Basic.py>. I was wondering if there is a way to set a timeout on WMS server connection when doing a "new WMS(...)" call. Also is there a way to set a set of alternate WMS servers if the primary WMS server fails to respond within a set timeout? Thanks for any advice. -- Regards, Farrukh Web: http://www.wellfleetsoftware.com |
From: Edwin C. <com...@gm...> - 2009-03-10 07:21:16
|
Hi Brendan, The read methods are a bit trickier than the write methods of Format. I hadn't looked into how to implement them. What I see if I again look at the vector-formats example is that the GML takest the gmlOptions with featureType and featureNS for reading and writing, so that could be the heart of the problem. As far as I can see, a difficulty with implementing read methods for VectorFormat is that when you have for example 3 different polygons these can be 3 different features, or 1 feature with a composite geometry. I am not sure how the different formats solve this and if they solve this uniformly, but I think that GWT-OpenLayers should solve this uniformly. Yesterday, I finally got round to making a start with writing test cases for GWT-OpenLayers (2 and a suite to run them both :-)), which should make it possible to work on the Formats test driven. Greetings, Edwin P.S. I still need to see how the get the test cases and showcase under version control. For the test cases I created a separate module, because (a) GWT-OpenLayers still compiles against GWT 1.4 and running a test suite requires GWT 1.5 (b) that separate module could than point at the OpenLayers script in the module xml, which is necessary for running the tests. 2009/3/9 Brendan Grady <bre...@gm...> > Thanks Edwin - I added that to the impl, and it started working - pretty > strange that the openlayers api claims that options is not required in the > constructor, yet there are two properties, featureType and featureNS, that > are marked as required. > ( > http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Format/GML/v3-js.html) > > Any ideas about how to implement the read method in VectorFeature? I > uncommented what you had so that the body of the method now looks something > like this: > > return VectorFeature.narrowToVectorFeature( > FormatImpl.read(getJSObject(), input) ); > > No errors, but the feature failed to plot when I added it via > Vector.addFeature() > > I then saw that the openlayers api says that GML.read() is returning an > Array of Vectors, so I tried to convert the JSObject that comes back from > FormatImpl.read() into a JSObject[]. See snippets below. > > In VectorFormat.read(): > > JSObject arrayObject = FormatImpl.read(getJSObject(), input); > > JSObject[] array = ElementHelper.toArray(arrayObject); > VectorFeature[] features = new VectorFeature[array.length]; > for( int i = 0; i < array.length ; i++){ > features[i] = VectorFeature.narrowToVectorFeature(array[i]); > } > > In ElementHelper: > > public static JSObject[] toArray(JSObject array) { > int length = getArraySize(array); > JSObject[] recs = new JSObject[length]; > for (int i = 0; i < length; i++) { > recs[i] = getValueFromJavaScriptObjectArray(array, i); > } > return recs; > } > > public static native JSObject getValueFromJavaScriptObjectArray( > JSObject elem, int i) /*-{ > return elem[i]; > }-*/; > > > Again, no errors, but the feature failed to plot. > > Again, thanks for any tips, > Brendan > > > > On Fri, Mar 6, 2009 at 4:39 AM, Edwin Commandeur < > com...@gm...> wrote: > >> Hi Brendan, >> >> As far as I can see the problem is with the GML constructor. The >> constructor needs an options object, even if it that options object is >> empty. I added an empty options object to the GMLImpl create method. >> >> Possibly it needs more. If I look at the vector-formats example than it >> might be necessary to change: >> >> public static native JSObject create() >> /*-{ >> return new $wnd.OpenLayers.Format.GML.v3({}); >> }-*/; >> >> to >> >> public static native JSObject create(String type, String namespace) >> /*-{ >> return new $wnd.OpenLayers.Format.GML.v3({ featureType : type, >> featureNS: namespace }); >> }-*/; >> >> >> Greetings, >> >> Edwin >> >> 2009/3/5 Brendan Grady <bre...@gm...> >> >>> Hi Edwin, >>> >>> An updated patch to include the DragFeature Control. >>> >>> I figured out the weirdness with KML, and that one was my fault. It >>> appears when I added the KML to the popup, that it lost everything that had >>> special characters in it. Makes sense because I think the Popup is supposed >>> to be just for HTML. >>> >>> However, I am pretty stumped with GML. Everything in the code looks like >>> it should work, but the call to the empty constructor fails. Looking at the >>> Openlayer api, any options should be optional. >>> >>> Some more debug info: >>> >>> - new GML() fails outright with a an exception in the GWT shell output: >>> >>> GWTShell: >>> [java] Uncaught JavaScript exception >>> [com.google.gwt.core.client.JavaScriptException: (TypeError): Object >>> expected >>> [java] number: -2146823281 >>> [java] description: Object expected >>> [java] at >>> com.eg.gwt.openLayers.client.format.GML2Impl.create(Native Method) >>> [java] at >>> com.eg.gwt.openLayers.client.format.GML2.<init>(GML2.java:21) >>> >>> >>> At the moment, serializing and deserializing in GML is my most pressing >>> feature. Hopefully, I have a breakthough before my prototype demo tomorrow. >>> >>> If you have any insight/ideas into deserialization, I would be happy to >>> try to implement them. >>> >>> Thanks Again, >>> Brendan >>> >>> >>> >>> >>> On Thu, Mar 5, 2009 at 2:35 PM, Edwin Commandeur < >>> com...@gm...> wrote: >>> >>>> Hi Brendan, >>>> >>>> Thanks for the patch. I will take look at it and already commit the css >>>> to the trunk first thing tommorow morning. >>>> >>>> If WKT works, than I'm pretty sure that KML needs some additional >>>> options that can't be specified yet. I added a Tracker on SF to track >>>> Milestone issues, which should list all the issues to be fixed for release >>>> 0.4 and getting the KML Format fully working will definitely be on the list. >>>> >>>> Greetings and thanks for all your efforts, >>>> Edwin >>>> >>>> 2009/3/5 Brendan Grady <bre...@gm...> >>>> >>>> Thanks again for the response. I really appreciate your time. >>>>> >>>>> I'm sure you are swamped with other things, so I put together a patch >>>>> for adding controls to the EditControlPanel. If you think it is ok, feel >>>>> free to add it to the trunk. First time working with JSNI, so if it doesn't >>>>> follow standards, feel free to scrap it. >>>>> >>>>> The following css needs to be added to your applications css: >>>>> >>>>> .olControlEditingToolbar { >>>>> width: 400px!important; >>>>> } >>>>> .olControlEditingToolbar .olControlSelectFeatureItemActive { >>>>> background-image: url("img/select_feature_on.png"); >>>>> background-repeat: no-repeat; >>>>> } >>>>> .olControlEditingToolbar .olControlSelectFeatureItemInactive { >>>>> background-image: url("img/select_feature_off.png"); >>>>> background-repeat: no-repeat; >>>>> } >>>>> .olControlEditingToolbar .olControlModifyFeatureItemActive { >>>>> background-image: url("img/move_vertex_on.png"); >>>>> background-repeat: no-repeat; >>>>> } >>>>> .olControlEditingToolbar .olControlModifyFeatureItemInactive { >>>>> background-image: url("img/move_vertex_off.png"); >>>>> background-repeat: no-repeat; >>>>> } >>>>> .olControlEditingToolbar .olControlDragFeatureItemActive { >>>>> background-image: >>>>> url("openlayers/theme/default/img/move_feature_on.png"); >>>>> background-repeat: no-repeat; >>>>> } >>>>> .olControlEditingToolbar .olControlDragFeatureItemInactive { >>>>> background-image: >>>>> url("openlayers/theme/default/img/move_feature_off.png"); >>>>> background-repeat: no-repeat; >>>>> } >>>>> >>>>> If you can't find the images, I can provide those too. As a zip maybe? >>>>> >>>>> I'm also going to take a look at the GML2,3 / KML >>>>> serializer/deserializer. Those seem to be broken right now, though WKT >>>>> serialize does seem to work, so I'll use that as a guideline. >>>>> >>>>> Brendan >>>>> >>>>> >>>>> >>>>> On Thu, Mar 5, 2009 at 8:53 AM, Brendan Grady <bre...@gm... >>>>> > wrote: >>>>> >>>>>> Hi Edwin - >>>>>> >>>>>> The SelectFeature appears to be working perfectly. Thanks! >>>>>> >>>>>> Implementing the editing features that are in >>>>>> http://crschmidt.net/mapping/wpserverdemo/ would make for a very >>>>>> powerful toolset. I would be happy to test out whatever you have. >>>>>> >>>>>> As an aside, this is how I tested out the Select Feauture: >>>>>> >>>>>> SelectFeatureOptions options = new SelectFeatureOptions(); >>>>>> options.onSelect( new SelectFeature.SelectFeatureListener(){ >>>>>> >>>>>> public void onFeatureSelected(JSObject vectorFeature) { >>>>>> VectorFeature overlay = >>>>>> VectorFeature.narrowToVectorFeature(vectorFeature); >>>>>> popup = new AnchoredBubble("vector-info", >>>>>> new LonLat(0,0), >>>>>> new Size(300, 400), >>>>>> "<p>" + new KML().write(overlay) + "</p>", >>>>>> new Icon("", new Size(0, 0), new Pixel(0, 0)), >>>>>> true); >>>>>> map.addPopup(popup); >>>>>> } >>>>>> >>>>>> }); >>>>>> >>>>>> For some reason though, the info that popped up is not KML. It looks >>>>>> more like this: >>>>>> >>>>>> OpenLayers exportExported on Thu Mar 5 08:49:56 >>>>>> EST2009OpenLayers.Feature.Vector_262No description available-0.0703125, >>>>>> 2.4609375 -0.703125,-20.390625 ... >>>>>> >>>>>> Am I using the KML exporter incorrectly? >>>>>> >>>>>> Thanks again, >>>>>> >>>>>> Brendan >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Mar 5, 2009 at 5:43 AM, Edwin Commandeur < >>>>>> com...@gm...> wrote: >>>>>> >>>>>>> Hi there, >>>>>>> >>>>>>> Selecting features happens with a control in OpenLayers. I saw in the >>>>>>> GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature >>>>>>> control. By default the SelectFeature selects features on click and you can >>>>>>> pass it options to select on hover. >>>>>>> >>>>>>> So: >>>>>>> (1) we need to add support for the select feature control => ADDED 5 >>>>>>> min ago >>>>>>> >>>>>>> I added a wrapper for SelectFeature, but did not thoroughly test >>>>>>> it... Maybe you can try it out. >>>>>>> >>>>>>> One caveat: The onSelect and onUnselect callback methods do not hook >>>>>>> in with the broader OpenLayers event system. By the latter I mean that for >>>>>>> example Vector (a vector layer object) has an Event object to register and >>>>>>> unregister events, while the onSelect and onUnselect are just callback >>>>>>> methods of the Control. This is why I added the Listener interfaces to the >>>>>>> Control itself and this is why the methods onSelectFeature and >>>>>>> onUnselectFeature return a JSObject which is a VectorFeature that you have >>>>>>> to narrow to a VectorFeature yourself inside the method e.g. >>>>>>> new SelectFeatureListener(){ >>>>>>> public void onSelectFeature(JSObject vectorFeature) { >>>>>>> VectorFeature vf = >>>>>>> VectorFeature.narrowToVectorFeature(vectorFeature); >>>>>>> } >>>>>>> >>>>>>> (2) you then need to add a button to activate the SelectFeature >>>>>>> control (and deactivate the other editing controls). >>>>>>> >>>>>>> Point (2) could be realised in two ways: (a) you should create your >>>>>>> own editing toolbar using GWT (b) we could support adding controls to the >>>>>>> Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very >>>>>>> difficult to support this in GWT-OpenLayers. I guess that most people want >>>>>>> an editing toolbar like this one: >>>>>>> >>>>>>> http://crschmidt.net/mapping/wpserverdemo/ >>>>>>> >>>>>>> I will look into point 2b shortly, but cannot promise to have >>>>>>> anything ready overnight. >>>>>>> >>>>>>> Greetings, >>>>>>> Edwin >>>>>>> >>>>>>> 2009/3/4 Brendan Grady <bre...@gm...> >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> >>>>>>>> New user to gwt-openlayers. >>>>>>>> >>>>>>>> Does anyone have an example of adding a "select" listener to a >>>>>>>> Vector layer? I am adding vectors using the Editing Toolbar. >>>>>>>> >>>>>>>> In openlayers, I would add something like the following: >>>>>>>> >>>>>>>> selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, >>>>>>>> {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); >>>>>>>> >>>>>>>> >>>>>>>> I tried the following, but I think I need to add something else to >>>>>>>> the map to make the layer "selectable" as it does not seem to register that >>>>>>>> I am over a selectable vector: >>>>>>>> >>>>>>>> <snip> >>>>>>>> Vector overlayLayer = new Vector("Overlay Creation Layer"); >>>>>>>> map.addLayer(overlayLayer); >>>>>>>> map.addControl(new EditingToolbar(overlayLayer)); >>>>>>>> >>>>>>>> overlayLayer.addVectorFeatureSelectedListener( new >>>>>>>> VectorFeatureSelectedListener(){ >>>>>>>> >>>>>>>> public void onFeatureSelected(Vector source, >>>>>>>> FeatureSelectedEvent eventObject) { >>>>>>>> VectorFeature overlay = eventObject.getFeature(); >>>>>>>> popup = new AnchoredBubble("vector-info", >>>>>>>> new LonLat(0,0), >>>>>>>> new Size(300, 400), >>>>>>>> "<p>" + new KML().write(overlay) + "</p>", >>>>>>>> new Icon("", new Size(0, 0), new Pixel(0, >>>>>>>> 0)), >>>>>>>> true); >>>>>>>> map.addPopup(popup); >>>>>>>> } >>>>>>>> >>>>>>>> }); >>>>>>>> </snip> >>>>>>>> >>>>>>>> Any suggestions? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Brendan >>>>>>>> >>>>>>>> >>>>>>>> ------------------------------------------------------------------------------ >>>>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>>>>>> Francisco, CA >>>>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>>>>>> Enterprise >>>>>>>> -Strategies to boost innovation and cut costs with open source >>>>>>>> participation >>>>>>>> -Receive a $600 discount off the registration fee with the source >>>>>>>> code: SFAD >>>>>>>> http://p.sf.net/sfu/XcvMzF8H >>>>>>>> _______________________________________________ >>>>>>>> Gwt-openlayers-users mailing list >>>>>>>> Gwt...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>>>>> Francisco, CA >>>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>>>>> Enterprise >>>>>>> -Strategies to boost innovation and cut costs with open source >>>>>>> participation >>>>>>> -Receive a $600 discount off the registration fee with the source >>>>>>> code: SFAD >>>>>>> http://p.sf.net/sfu/XcvMzF8H >>>>>>> _______________________________________________ >>>>>>> Gwt-openlayers-users mailing list >>>>>>> Gwt...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > |
From: Brendan G. <bre...@gm...> - 2009-03-09 20:51:12
|
Thanks Edwin - I added that to the impl, and it started working - pretty strange that the openlayers api claims that options is not required in the constructor, yet there are two properties, featureType and featureNS, that are marked as required. ( http://dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Format/GML/v3-js.html) Any ideas about how to implement the read method in VectorFeature? I uncommented what you had so that the body of the method now looks something like this: return VectorFeature.narrowToVectorFeature( FormatImpl.read(getJSObject(), input) ); No errors, but the feature failed to plot when I added it via Vector.addFeature() I then saw that the openlayers api says that GML.read() is returning an Array of Vectors, so I tried to convert the JSObject that comes back from FormatImpl.read() into a JSObject[]. See snippets below. In VectorFormat.read(): JSObject arrayObject = FormatImpl.read(getJSObject(), input); JSObject[] array = ElementHelper.toArray(arrayObject); VectorFeature[] features = new VectorFeature[array.length]; for( int i = 0; i < array.length ; i++){ features[i] = VectorFeature.narrowToVectorFeature(array[i]); } In ElementHelper: public static JSObject[] toArray(JSObject array) { int length = getArraySize(array); JSObject[] recs = new JSObject[length]; for (int i = 0; i < length; i++) { recs[i] = getValueFromJavaScriptObjectArray(array, i); } return recs; } public static native JSObject getValueFromJavaScriptObjectArray( JSObject elem, int i) /*-{ return elem[i]; }-*/; Again, no errors, but the feature failed to plot. Again, thanks for any tips, Brendan On Fri, Mar 6, 2009 at 4:39 AM, Edwin Commandeur <com...@gm... > wrote: > Hi Brendan, > > As far as I can see the problem is with the GML constructor. The > constructor needs an options object, even if it that options object is > empty. I added an empty options object to the GMLImpl create method. > > Possibly it needs more. If I look at the vector-formats example than it > might be necessary to change: > > public static native JSObject create() > /*-{ > return new $wnd.OpenLayers.Format.GML.v3({}); > }-*/; > > to > > public static native JSObject create(String type, String namespace) > /*-{ > return new $wnd.OpenLayers.Format.GML.v3({ featureType : type, > featureNS: namespace }); > }-*/; > > > Greetings, > > Edwin > > 2009/3/5 Brendan Grady <bre...@gm...> > >> Hi Edwin, >> >> An updated patch to include the DragFeature Control. >> >> I figured out the weirdness with KML, and that one was my fault. It >> appears when I added the KML to the popup, that it lost everything that had >> special characters in it. Makes sense because I think the Popup is supposed >> to be just for HTML. >> >> However, I am pretty stumped with GML. Everything in the code looks like >> it should work, but the call to the empty constructor fails. Looking at the >> Openlayer api, any options should be optional. >> >> Some more debug info: >> >> - new GML() fails outright with a an exception in the GWT shell output: >> >> GWTShell: >> [java] Uncaught JavaScript exception >> [com.google.gwt.core.client.JavaScriptException: (TypeError): Object >> expected >> [java] number: -2146823281 >> [java] description: Object expected >> [java] at >> com.eg.gwt.openLayers.client.format.GML2Impl.create(Native Method) >> [java] at >> com.eg.gwt.openLayers.client.format.GML2.<init>(GML2.java:21) >> >> >> At the moment, serializing and deserializing in GML is my most pressing >> feature. Hopefully, I have a breakthough before my prototype demo tomorrow. >> >> If you have any insight/ideas into deserialization, I would be happy to >> try to implement them. >> >> Thanks Again, >> Brendan >> >> >> >> >> On Thu, Mar 5, 2009 at 2:35 PM, Edwin Commandeur < >> com...@gm...> wrote: >> >>> Hi Brendan, >>> >>> Thanks for the patch. I will take look at it and already commit the css >>> to the trunk first thing tommorow morning. >>> >>> If WKT works, than I'm pretty sure that KML needs some additional options >>> that can't be specified yet. I added a Tracker on SF to track Milestone >>> issues, which should list all the issues to be fixed for release 0.4 and >>> getting the KML Format fully working will definitely be on the list. >>> >>> Greetings and thanks for all your efforts, >>> Edwin >>> >>> 2009/3/5 Brendan Grady <bre...@gm...> >>> >>> Thanks again for the response. I really appreciate your time. >>>> >>>> I'm sure you are swamped with other things, so I put together a patch >>>> for adding controls to the EditControlPanel. If you think it is ok, feel >>>> free to add it to the trunk. First time working with JSNI, so if it doesn't >>>> follow standards, feel free to scrap it. >>>> >>>> The following css needs to be added to your applications css: >>>> >>>> .olControlEditingToolbar { >>>> width: 400px!important; >>>> } >>>> .olControlEditingToolbar .olControlSelectFeatureItemActive { >>>> background-image: url("img/select_feature_on.png"); >>>> background-repeat: no-repeat; >>>> } >>>> .olControlEditingToolbar .olControlSelectFeatureItemInactive { >>>> background-image: url("img/select_feature_off.png"); >>>> background-repeat: no-repeat; >>>> } >>>> .olControlEditingToolbar .olControlModifyFeatureItemActive { >>>> background-image: url("img/move_vertex_on.png"); >>>> background-repeat: no-repeat; >>>> } >>>> .olControlEditingToolbar .olControlModifyFeatureItemInactive { >>>> background-image: url("img/move_vertex_off.png"); >>>> background-repeat: no-repeat; >>>> } >>>> .olControlEditingToolbar .olControlDragFeatureItemActive { >>>> background-image: >>>> url("openlayers/theme/default/img/move_feature_on.png"); >>>> background-repeat: no-repeat; >>>> } >>>> .olControlEditingToolbar .olControlDragFeatureItemInactive { >>>> background-image: >>>> url("openlayers/theme/default/img/move_feature_off.png"); >>>> background-repeat: no-repeat; >>>> } >>>> >>>> If you can't find the images, I can provide those too. As a zip maybe? >>>> >>>> I'm also going to take a look at the GML2,3 / KML >>>> serializer/deserializer. Those seem to be broken right now, though WKT >>>> serialize does seem to work, so I'll use that as a guideline. >>>> >>>> Brendan >>>> >>>> >>>> >>>> On Thu, Mar 5, 2009 at 8:53 AM, Brendan Grady <bre...@gm...>wrote: >>>> >>>>> Hi Edwin - >>>>> >>>>> The SelectFeature appears to be working perfectly. Thanks! >>>>> >>>>> Implementing the editing features that are in >>>>> http://crschmidt.net/mapping/wpserverdemo/ would make for a very >>>>> powerful toolset. I would be happy to test out whatever you have. >>>>> >>>>> As an aside, this is how I tested out the Select Feauture: >>>>> >>>>> SelectFeatureOptions options = new SelectFeatureOptions(); >>>>> options.onSelect( new SelectFeature.SelectFeatureListener(){ >>>>> >>>>> public void onFeatureSelected(JSObject vectorFeature) { >>>>> VectorFeature overlay = >>>>> VectorFeature.narrowToVectorFeature(vectorFeature); >>>>> popup = new AnchoredBubble("vector-info", >>>>> new LonLat(0,0), >>>>> new Size(300, 400), >>>>> "<p>" + new KML().write(overlay) + "</p>", >>>>> new Icon("", new Size(0, 0), new Pixel(0, 0)), >>>>> true); >>>>> map.addPopup(popup); >>>>> } >>>>> >>>>> }); >>>>> >>>>> For some reason though, the info that popped up is not KML. It looks >>>>> more like this: >>>>> >>>>> OpenLayers exportExported on Thu Mar 5 08:49:56 >>>>> EST2009OpenLayers.Feature.Vector_262No description available-0.0703125, >>>>> 2.4609375 -0.703125,-20.390625 ... >>>>> >>>>> Am I using the KML exporter incorrectly? >>>>> >>>>> Thanks again, >>>>> >>>>> Brendan >>>>> >>>>> >>>>> >>>>> On Thu, Mar 5, 2009 at 5:43 AM, Edwin Commandeur < >>>>> com...@gm...> wrote: >>>>> >>>>>> Hi there, >>>>>> >>>>>> Selecting features happens with a control in OpenLayers. I saw in the >>>>>> GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature >>>>>> control. By default the SelectFeature selects features on click and you can >>>>>> pass it options to select on hover. >>>>>> >>>>>> So: >>>>>> (1) we need to add support for the select feature control => ADDED 5 >>>>>> min ago >>>>>> >>>>>> I added a wrapper for SelectFeature, but did not thoroughly test it... >>>>>> Maybe you can try it out. >>>>>> >>>>>> One caveat: The onSelect and onUnselect callback methods do not hook >>>>>> in with the broader OpenLayers event system. By the latter I mean that for >>>>>> example Vector (a vector layer object) has an Event object to register and >>>>>> unregister events, while the onSelect and onUnselect are just callback >>>>>> methods of the Control. This is why I added the Listener interfaces to the >>>>>> Control itself and this is why the methods onSelectFeature and >>>>>> onUnselectFeature return a JSObject which is a VectorFeature that you have >>>>>> to narrow to a VectorFeature yourself inside the method e.g. >>>>>> new SelectFeatureListener(){ >>>>>> public void onSelectFeature(JSObject vectorFeature) { >>>>>> VectorFeature vf = >>>>>> VectorFeature.narrowToVectorFeature(vectorFeature); >>>>>> } >>>>>> >>>>>> (2) you then need to add a button to activate the SelectFeature >>>>>> control (and deactivate the other editing controls). >>>>>> >>>>>> Point (2) could be realised in two ways: (a) you should create your >>>>>> own editing toolbar using GWT (b) we could support adding controls to the >>>>>> Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very >>>>>> difficult to support this in GWT-OpenLayers. I guess that most people want >>>>>> an editing toolbar like this one: >>>>>> >>>>>> http://crschmidt.net/mapping/wpserverdemo/ >>>>>> >>>>>> I will look into point 2b shortly, but cannot promise to have anything >>>>>> ready overnight. >>>>>> >>>>>> Greetings, >>>>>> Edwin >>>>>> >>>>>> 2009/3/4 Brendan Grady <bre...@gm...> >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> >>>>>>> New user to gwt-openlayers. >>>>>>> >>>>>>> Does anyone have an example of adding a "select" listener to a Vector >>>>>>> layer? I am adding vectors using the Editing Toolbar. >>>>>>> >>>>>>> In openlayers, I would add something like the following: >>>>>>> >>>>>>> selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, >>>>>>> {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); >>>>>>> >>>>>>> >>>>>>> I tried the following, but I think I need to add something else to >>>>>>> the map to make the layer "selectable" as it does not seem to register that >>>>>>> I am over a selectable vector: >>>>>>> >>>>>>> <snip> >>>>>>> Vector overlayLayer = new Vector("Overlay Creation Layer"); >>>>>>> map.addLayer(overlayLayer); >>>>>>> map.addControl(new EditingToolbar(overlayLayer)); >>>>>>> >>>>>>> overlayLayer.addVectorFeatureSelectedListener( new >>>>>>> VectorFeatureSelectedListener(){ >>>>>>> >>>>>>> public void onFeatureSelected(Vector source, >>>>>>> FeatureSelectedEvent eventObject) { >>>>>>> VectorFeature overlay = eventObject.getFeature(); >>>>>>> popup = new AnchoredBubble("vector-info", >>>>>>> new LonLat(0,0), >>>>>>> new Size(300, 400), >>>>>>> "<p>" + new KML().write(overlay) + "</p>", >>>>>>> new Icon("", new Size(0, 0), new Pixel(0, >>>>>>> 0)), >>>>>>> true); >>>>>>> map.addPopup(popup); >>>>>>> } >>>>>>> >>>>>>> }); >>>>>>> </snip> >>>>>>> >>>>>>> Any suggestions? >>>>>>> >>>>>>> Thanks, >>>>>>> Brendan >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>>>>> Francisco, CA >>>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>>>>> Enterprise >>>>>>> -Strategies to boost innovation and cut costs with open source >>>>>>> participation >>>>>>> -Receive a $600 discount off the registration fee with the source >>>>>>> code: SFAD >>>>>>> http://p.sf.net/sfu/XcvMzF8H >>>>>>> _______________________________________________ >>>>>>> Gwt-openlayers-users mailing list >>>>>>> Gwt...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>>>> Francisco, CA >>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>>>> Enterprise >>>>>> -Strategies to boost innovation and cut costs with open source >>>>>> participation >>>>>> -Receive a $600 discount off the registration fee with the source >>>>>> code: SFAD >>>>>> http://p.sf.net/sfu/XcvMzF8H >>>>>> _______________________________________________ >>>>>> Gwt-openlayers-users mailing list >>>>>> Gwt...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>>>> >>>>>> >>>>> >>>> >>> >> > |
From: Edwin C. <com...@gm...> - 2009-03-06 08:39:14
|
Hi Brendan, As far as I can see the problem is with the GML constructor. The constructor needs an options object, even if it that options object is empty. I added an empty options object to the GMLImpl create method. Possibly it needs more. If I look at the vector-formats example than it might be necessary to change: public static native JSObject create() /*-{ return new $wnd.OpenLayers.Format.GML.v3({}); }-*/; to public static native JSObject create(String type, String namespace) /*-{ return new $wnd.OpenLayers.Format.GML.v3({ featureType : type, featureNS: namespace }); }-*/; Greetings, Edwin 2009/3/5 Brendan Grady <bre...@gm...> > Hi Edwin, > > An updated patch to include the DragFeature Control. > > I figured out the weirdness with KML, and that one was my fault. It > appears when I added the KML to the popup, that it lost everything that had > special characters in it. Makes sense because I think the Popup is supposed > to be just for HTML. > > However, I am pretty stumped with GML. Everything in the code looks like > it should work, but the call to the empty constructor fails. Looking at the > Openlayer api, any options should be optional. > > Some more debug info: > > - new GML() fails outright with a an exception in the GWT shell output: > > GWTShell: > [java] Uncaught JavaScript exception > [com.google.gwt.core.client.JavaScriptException: (TypeError): Object > expected > [java] number: -2146823281 > [java] description: Object expected > [java] at > com.eg.gwt.openLayers.client.format.GML2Impl.create(Native Method) > [java] at > com.eg.gwt.openLayers.client.format.GML2.<init>(GML2.java:21) > > > At the moment, serializing and deserializing in GML is my most pressing > feature. Hopefully, I have a breakthough before my prototype demo tomorrow. > > If you have any insight/ideas into deserialization, I would be happy to try > to implement them. > > Thanks Again, > Brendan > > > > > On Thu, Mar 5, 2009 at 2:35 PM, Edwin Commandeur < > com...@gm...> wrote: > >> Hi Brendan, >> >> Thanks for the patch. I will take look at it and already commit the css to >> the trunk first thing tommorow morning. >> >> If WKT works, than I'm pretty sure that KML needs some additional options >> that can't be specified yet. I added a Tracker on SF to track Milestone >> issues, which should list all the issues to be fixed for release 0.4 and >> getting the KML Format fully working will definitely be on the list. >> >> Greetings and thanks for all your efforts, >> Edwin >> >> 2009/3/5 Brendan Grady <bre...@gm...> >> >> Thanks again for the response. I really appreciate your time. >>> >>> I'm sure you are swamped with other things, so I put together a patch for >>> adding controls to the EditControlPanel. If you think it is ok, feel free >>> to add it to the trunk. First time working with JSNI, so if it doesn't >>> follow standards, feel free to scrap it. >>> >>> The following css needs to be added to your applications css: >>> >>> .olControlEditingToolbar { >>> width: 400px!important; >>> } >>> .olControlEditingToolbar .olControlSelectFeatureItemActive { >>> background-image: url("img/select_feature_on.png"); >>> background-repeat: no-repeat; >>> } >>> .olControlEditingToolbar .olControlSelectFeatureItemInactive { >>> background-image: url("img/select_feature_off.png"); >>> background-repeat: no-repeat; >>> } >>> .olControlEditingToolbar .olControlModifyFeatureItemActive { >>> background-image: url("img/move_vertex_on.png"); >>> background-repeat: no-repeat; >>> } >>> .olControlEditingToolbar .olControlModifyFeatureItemInactive { >>> background-image: url("img/move_vertex_off.png"); >>> background-repeat: no-repeat; >>> } >>> .olControlEditingToolbar .olControlDragFeatureItemActive { >>> background-image: >>> url("openlayers/theme/default/img/move_feature_on.png"); >>> background-repeat: no-repeat; >>> } >>> .olControlEditingToolbar .olControlDragFeatureItemInactive { >>> background-image: >>> url("openlayers/theme/default/img/move_feature_off.png"); >>> background-repeat: no-repeat; >>> } >>> >>> If you can't find the images, I can provide those too. As a zip maybe? >>> >>> I'm also going to take a look at the GML2,3 / KML >>> serializer/deserializer. Those seem to be broken right now, though WKT >>> serialize does seem to work, so I'll use that as a guideline. >>> >>> Brendan >>> >>> >>> >>> On Thu, Mar 5, 2009 at 8:53 AM, Brendan Grady <bre...@gm...>wrote: >>> >>>> Hi Edwin - >>>> >>>> The SelectFeature appears to be working perfectly. Thanks! >>>> >>>> Implementing the editing features that are in >>>> http://crschmidt.net/mapping/wpserverdemo/ would make for a very >>>> powerful toolset. I would be happy to test out whatever you have. >>>> >>>> As an aside, this is how I tested out the Select Feauture: >>>> >>>> SelectFeatureOptions options = new SelectFeatureOptions(); >>>> options.onSelect( new SelectFeature.SelectFeatureListener(){ >>>> >>>> public void onFeatureSelected(JSObject vectorFeature) { >>>> VectorFeature overlay = >>>> VectorFeature.narrowToVectorFeature(vectorFeature); >>>> popup = new AnchoredBubble("vector-info", >>>> new LonLat(0,0), >>>> new Size(300, 400), >>>> "<p>" + new KML().write(overlay) + "</p>", >>>> new Icon("", new Size(0, 0), new Pixel(0, 0)), >>>> true); >>>> map.addPopup(popup); >>>> } >>>> >>>> }); >>>> >>>> For some reason though, the info that popped up is not KML. It looks >>>> more like this: >>>> >>>> OpenLayers exportExported on Thu Mar 5 08:49:56 >>>> EST2009OpenLayers.Feature.Vector_262No description available-0.0703125, >>>> 2.4609375 -0.703125,-20.390625 ... >>>> >>>> Am I using the KML exporter incorrectly? >>>> >>>> Thanks again, >>>> >>>> Brendan >>>> >>>> >>>> >>>> On Thu, Mar 5, 2009 at 5:43 AM, Edwin Commandeur < >>>> com...@gm...> wrote: >>>> >>>>> Hi there, >>>>> >>>>> Selecting features happens with a control in OpenLayers. I saw in the >>>>> GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature >>>>> control. By default the SelectFeature selects features on click and you can >>>>> pass it options to select on hover. >>>>> >>>>> So: >>>>> (1) we need to add support for the select feature control => ADDED 5 >>>>> min ago >>>>> >>>>> I added a wrapper for SelectFeature, but did not thoroughly test it... >>>>> Maybe you can try it out. >>>>> >>>>> One caveat: The onSelect and onUnselect callback methods do not hook in >>>>> with the broader OpenLayers event system. By the latter I mean that for >>>>> example Vector (a vector layer object) has an Event object to register and >>>>> unregister events, while the onSelect and onUnselect are just callback >>>>> methods of the Control. This is why I added the Listener interfaces to the >>>>> Control itself and this is why the methods onSelectFeature and >>>>> onUnselectFeature return a JSObject which is a VectorFeature that you have >>>>> to narrow to a VectorFeature yourself inside the method e.g. >>>>> new SelectFeatureListener(){ >>>>> public void onSelectFeature(JSObject vectorFeature) { >>>>> VectorFeature vf = >>>>> VectorFeature.narrowToVectorFeature(vectorFeature); >>>>> } >>>>> >>>>> (2) you then need to add a button to activate the SelectFeature control >>>>> (and deactivate the other editing controls). >>>>> >>>>> Point (2) could be realised in two ways: (a) you should create your own >>>>> editing toolbar using GWT (b) we could support adding controls to the >>>>> Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very >>>>> difficult to support this in GWT-OpenLayers. I guess that most people want >>>>> an editing toolbar like this one: >>>>> >>>>> http://crschmidt.net/mapping/wpserverdemo/ >>>>> >>>>> I will look into point 2b shortly, but cannot promise to have anything >>>>> ready overnight. >>>>> >>>>> Greetings, >>>>> Edwin >>>>> >>>>> 2009/3/4 Brendan Grady <bre...@gm...> >>>>> >>>>>> Hello, >>>>>> >>>>>> >>>>>> New user to gwt-openlayers. >>>>>> >>>>>> Does anyone have an example of adding a "select" listener to a Vector >>>>>> layer? I am adding vectors using the Editing Toolbar. >>>>>> >>>>>> In openlayers, I would add something like the following: >>>>>> >>>>>> selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, >>>>>> {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); >>>>>> >>>>>> >>>>>> I tried the following, but I think I need to add something else to the >>>>>> map to make the layer "selectable" as it does not seem to register that I am >>>>>> over a selectable vector: >>>>>> >>>>>> <snip> >>>>>> Vector overlayLayer = new Vector("Overlay Creation Layer"); >>>>>> map.addLayer(overlayLayer); >>>>>> map.addControl(new EditingToolbar(overlayLayer)); >>>>>> >>>>>> overlayLayer.addVectorFeatureSelectedListener( new >>>>>> VectorFeatureSelectedListener(){ >>>>>> >>>>>> public void onFeatureSelected(Vector source, >>>>>> FeatureSelectedEvent eventObject) { >>>>>> VectorFeature overlay = eventObject.getFeature(); >>>>>> popup = new AnchoredBubble("vector-info", >>>>>> new LonLat(0,0), >>>>>> new Size(300, 400), >>>>>> "<p>" + new KML().write(overlay) + "</p>", >>>>>> new Icon("", new Size(0, 0), new Pixel(0, 0)), >>>>>> true); >>>>>> map.addPopup(popup); >>>>>> } >>>>>> >>>>>> }); >>>>>> </snip> >>>>>> >>>>>> Any suggestions? >>>>>> >>>>>> Thanks, >>>>>> Brendan >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>>>> Francisco, CA >>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>>>> Enterprise >>>>>> -Strategies to boost innovation and cut costs with open source >>>>>> participation >>>>>> -Receive a $600 discount off the registration fee with the source >>>>>> code: SFAD >>>>>> http://p.sf.net/sfu/XcvMzF8H >>>>>> _______________________________________________ >>>>>> Gwt-openlayers-users mailing list >>>>>> Gwt...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>>>> >>>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>>> Francisco, CA >>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>>> Enterprise >>>>> -Strategies to boost innovation and cut costs with open source >>>>> participation >>>>> -Receive a $600 discount off the registration fee with the source code: >>>>> SFAD >>>>> http://p.sf.net/sfu/XcvMzF8H >>>>> _______________________________________________ >>>>> Gwt-openlayers-users mailing list >>>>> Gwt...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>>> >>>>> >>>> >>> >> > |
From: Edwin C. <com...@gm...> - 2009-03-05 19:36:09
|
Hi Brendan, Thanks for the patch. I will take look at it and already commit the css to the trunk first thing tommorow morning. If WKT works, than I'm pretty sure that KML needs some additional options that can't be specified yet. I added a Tracker on SF to track Milestone issues, which should list all the issues to be fixed for release 0.4 and getting the KML Format fully working will definitely be on the list. Greetings and thanks for all your efforts, Edwin 2009/3/5 Brendan Grady <bre...@gm...> > Thanks again for the response. I really appreciate your time. > > I'm sure you are swamped with other things, so I put together a patch for > adding controls to the EditControlPanel. If you think it is ok, feel free > to add it to the trunk. First time working with JSNI, so if it doesn't > follow standards, feel free to scrap it. > > The following css needs to be added to your applications css: > > .olControlEditingToolbar { > width: 400px!important; > } > .olControlEditingToolbar .olControlSelectFeatureItemActive { > background-image: url("img/select_feature_on.png"); > background-repeat: no-repeat; > } > .olControlEditingToolbar .olControlSelectFeatureItemInactive { > background-image: url("img/select_feature_off.png"); > background-repeat: no-repeat; > } > .olControlEditingToolbar .olControlModifyFeatureItemActive { > background-image: url("img/move_vertex_on.png"); > background-repeat: no-repeat; > } > .olControlEditingToolbar .olControlModifyFeatureItemInactive { > background-image: url("img/move_vertex_off.png"); > background-repeat: no-repeat; > } > .olControlEditingToolbar .olControlDragFeatureItemActive { > background-image: > url("openlayers/theme/default/img/move_feature_on.png"); > background-repeat: no-repeat; > } > .olControlEditingToolbar .olControlDragFeatureItemInactive { > background-image: > url("openlayers/theme/default/img/move_feature_off.png"); > background-repeat: no-repeat; > } > > If you can't find the images, I can provide those too. As a zip maybe? > > I'm also going to take a look at the GML2,3 / KML serializer/deserializer. > Those seem to be broken right now, though WKT serialize does seem to work, > so I'll use that as a guideline. > > Brendan > > > > On Thu, Mar 5, 2009 at 8:53 AM, Brendan Grady <bre...@gm...>wrote: > >> Hi Edwin - >> >> The SelectFeature appears to be working perfectly. Thanks! >> >> Implementing the editing features that are in >> http://crschmidt.net/mapping/wpserverdemo/ would make for a very >> powerful toolset. I would be happy to test out whatever you have. >> >> As an aside, this is how I tested out the Select Feauture: >> >> SelectFeatureOptions options = new SelectFeatureOptions(); >> options.onSelect( new SelectFeature.SelectFeatureListener(){ >> >> public void onFeatureSelected(JSObject vectorFeature) { >> VectorFeature overlay = >> VectorFeature.narrowToVectorFeature(vectorFeature); >> popup = new AnchoredBubble("vector-info", >> new LonLat(0,0), >> new Size(300, 400), >> "<p>" + new KML().write(overlay) + "</p>", >> new Icon("", new Size(0, 0), new Pixel(0, 0)), >> true); >> map.addPopup(popup); >> } >> >> }); >> >> For some reason though, the info that popped up is not KML. It looks more >> like this: >> >> OpenLayers exportExported on Thu Mar 5 08:49:56 >> EST2009OpenLayers.Feature.Vector_262No description available-0.0703125, >> 2.4609375 -0.703125,-20.390625 ... >> >> Am I using the KML exporter incorrectly? >> >> Thanks again, >> >> Brendan >> >> >> >> On Thu, Mar 5, 2009 at 5:43 AM, Edwin Commandeur < >> com...@gm...> wrote: >> >>> Hi there, >>> >>> Selecting features happens with a control in OpenLayers. I saw in the >>> GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature >>> control. By default the SelectFeature selects features on click and you can >>> pass it options to select on hover. >>> >>> So: >>> (1) we need to add support for the select feature control => ADDED 5 min >>> ago >>> >>> I added a wrapper for SelectFeature, but did not thoroughly test it... >>> Maybe you can try it out. >>> >>> One caveat: The onSelect and onUnselect callback methods do not hook in >>> with the broader OpenLayers event system. By the latter I mean that for >>> example Vector (a vector layer object) has an Event object to register and >>> unregister events, while the onSelect and onUnselect are just callback >>> methods of the Control. This is why I added the Listener interfaces to the >>> Control itself and this is why the methods onSelectFeature and >>> onUnselectFeature return a JSObject which is a VectorFeature that you have >>> to narrow to a VectorFeature yourself inside the method e.g. >>> new SelectFeatureListener(){ >>> public void onSelectFeature(JSObject vectorFeature) { >>> VectorFeature vf = >>> VectorFeature.narrowToVectorFeature(vectorFeature); >>> } >>> >>> (2) you then need to add a button to activate the SelectFeature control >>> (and deactivate the other editing controls). >>> >>> Point (2) could be realised in two ways: (a) you should create your own >>> editing toolbar using GWT (b) we could support adding controls to the >>> Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very >>> difficult to support this in GWT-OpenLayers. I guess that most people want >>> an editing toolbar like this one: >>> >>> http://crschmidt.net/mapping/wpserverdemo/ >>> >>> I will look into point 2b shortly, but cannot promise to have anything >>> ready overnight. >>> >>> Greetings, >>> Edwin >>> >>> 2009/3/4 Brendan Grady <bre...@gm...> >>> >>>> Hello, >>>> >>>> >>>> New user to gwt-openlayers. >>>> >>>> Does anyone have an example of adding a "select" listener to a Vector >>>> layer? I am adding vectors using the Editing Toolbar. >>>> >>>> In openlayers, I would add something like the following: >>>> >>>> selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, >>>> {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); >>>> >>>> >>>> I tried the following, but I think I need to add something else to the >>>> map to make the layer "selectable" as it does not seem to register that I am >>>> over a selectable vector: >>>> >>>> <snip> >>>> Vector overlayLayer = new Vector("Overlay Creation Layer"); >>>> map.addLayer(overlayLayer); >>>> map.addControl(new EditingToolbar(overlayLayer)); >>>> >>>> overlayLayer.addVectorFeatureSelectedListener( new >>>> VectorFeatureSelectedListener(){ >>>> >>>> public void onFeatureSelected(Vector source, >>>> FeatureSelectedEvent eventObject) { >>>> VectorFeature overlay = eventObject.getFeature(); >>>> popup = new AnchoredBubble("vector-info", >>>> new LonLat(0,0), >>>> new Size(300, 400), >>>> "<p>" + new KML().write(overlay) + "</p>", >>>> new Icon("", new Size(0, 0), new Pixel(0, 0)), >>>> true); >>>> map.addPopup(popup); >>>> } >>>> >>>> }); >>>> </snip> >>>> >>>> Any suggestions? >>>> >>>> Thanks, >>>> Brendan >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>>> Francisco, CA >>>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>>> Enterprise >>>> -Strategies to boost innovation and cut costs with open source >>>> participation >>>> -Receive a $600 discount off the registration fee with the source code: >>>> SFAD >>>> http://p.sf.net/sfu/XcvMzF8H >>>> _______________________________________________ >>>> Gwt-openlayers-users mailing list >>>> Gwt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >>> CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation >>> -Receive a $600 discount off the registration fee with the source code: >>> SFAD >>> http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> Gwt-openlayers-users mailing list >>> Gwt...@li... >>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>> >>> >> > |
From: Edwin C. <com...@gm...> - 2009-03-05 15:16:54
|
Hi Brendan, Great that SelectFeature works fine. The problem with the KML format I will have to look into. Currently the Format support in GWT-OpenLayers is still limited. KML inherits it's write functionality from VectorFormat, but perhaps it's necessary to specify write options for KML that I was unaware of to. WKT should work. If that gives strange output to than sth else is going on. Greetings, Edwin 2009/3/5 Brendan Grady <bre...@gm...> > Hi Edwin - > > The SelectFeature appears to be working perfectly. Thanks! > > Implementing the editing features that are in > http://crschmidt.net/mapping/wpserverdemo/ would make for a very powerful > toolset. I would be happy to test out whatever you have. > > As an aside, this is how I tested out the Select Feauture: > > SelectFeatureOptions options = new SelectFeatureOptions(); > options.onSelect( new SelectFeature.SelectFeatureListener(){ > > public void onFeatureSelected(JSObject vectorFeature) { > VectorFeature overlay = > VectorFeature.narrowToVectorFeature(vectorFeature); > popup = new AnchoredBubble("vector-info", > new LonLat(0,0), > new Size(300, 400), > "<p>" + new KML().write(overlay) + "</p>", > new Icon("", new Size(0, 0), new Pixel(0, 0)), > true); > map.addPopup(popup); > } > > }); > > For some reason though, the info that popped up is not KML. It looks more > like this: > > OpenLayers exportExported on Thu Mar 5 08:49:56 > EST2009OpenLayers.Feature.Vector_262No description available-0.0703125, > 2.4609375 -0.703125,-20.390625 ... > > Am I using the KML exporter incorrectly? > > Thanks again, > > Brendan > > > > On Thu, Mar 5, 2009 at 5:43 AM, Edwin Commandeur < > com...@gm...> wrote: > >> Hi there, >> >> Selecting features happens with a control in OpenLayers. I saw in the >> GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature >> control. By default the SelectFeature selects features on click and you can >> pass it options to select on hover. >> >> So: >> (1) we need to add support for the select feature control => ADDED 5 min >> ago >> >> I added a wrapper for SelectFeature, but did not thoroughly test it... >> Maybe you can try it out. >> >> One caveat: The onSelect and onUnselect callback methods do not hook in >> with the broader OpenLayers event system. By the latter I mean that for >> example Vector (a vector layer object) has an Event object to register and >> unregister events, while the onSelect and onUnselect are just callback >> methods of the Control. This is why I added the Listener interfaces to the >> Control itself and this is why the methods onSelectFeature and >> onUnselectFeature return a JSObject which is a VectorFeature that you have >> to narrow to a VectorFeature yourself inside the method e.g. >> new SelectFeatureListener(){ >> public void onSelectFeature(JSObject vectorFeature) { >> VectorFeature vf = >> VectorFeature.narrowToVectorFeature(vectorFeature); >> } >> >> (2) you then need to add a button to activate the SelectFeature control >> (and deactivate the other editing controls). >> >> Point (2) could be realised in two ways: (a) you should create your own >> editing toolbar using GWT (b) we could support adding controls to the >> Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very >> difficult to support this in GWT-OpenLayers. I guess that most people want >> an editing toolbar like this one: >> >> http://crschmidt.net/mapping/wpserverdemo/ >> >> I will look into point 2b shortly, but cannot promise to have anything >> ready overnight. >> >> Greetings, >> Edwin >> >> 2009/3/4 Brendan Grady <bre...@gm...> >> >>> Hello, >>> >>> >>> New user to gwt-openlayers. >>> >>> Does anyone have an example of adding a "select" listener to a Vector >>> layer? I am adding vectors using the Editing Toolbar. >>> >>> In openlayers, I would add something like the following: >>> >>> selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, >>> {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); >>> >>> >>> I tried the following, but I think I need to add something else to the >>> map to make the layer "selectable" as it does not seem to register that I am >>> over a selectable vector: >>> >>> <snip> >>> Vector overlayLayer = new Vector("Overlay Creation Layer"); >>> map.addLayer(overlayLayer); >>> map.addControl(new EditingToolbar(overlayLayer)); >>> >>> overlayLayer.addVectorFeatureSelectedListener( new >>> VectorFeatureSelectedListener(){ >>> >>> public void onFeatureSelected(Vector source, >>> FeatureSelectedEvent eventObject) { >>> VectorFeature overlay = eventObject.getFeature(); >>> popup = new AnchoredBubble("vector-info", >>> new LonLat(0,0), >>> new Size(300, 400), >>> "<p>" + new KML().write(overlay) + "</p>", >>> new Icon("", new Size(0, 0), new Pixel(0, 0)), >>> true); >>> map.addPopup(popup); >>> } >>> >>> }); >>> </snip> >>> >>> Any suggestions? >>> >>> Thanks, >>> Brendan >>> >>> >>> ------------------------------------------------------------------------------ >>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >>> CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation >>> -Receive a $600 discount off the registration fee with the source code: >>> SFAD >>> http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> Gwt-openlayers-users mailing list >>> Gwt...@li... >>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> > |
From: Brendan G. <bre...@gm...> - 2009-03-05 13:54:03
|
Hi Edwin - The SelectFeature appears to be working perfectly. Thanks! Implementing the editing features that are in http://crschmidt.net/mapping/wpserverdemo/ would make for a very powerful toolset. I would be happy to test out whatever you have. As an aside, this is how I tested out the Select Feauture: SelectFeatureOptions options = new SelectFeatureOptions(); options.onSelect( new SelectFeature.SelectFeatureListener(){ public void onFeatureSelected(JSObject vectorFeature) { VectorFeature overlay = VectorFeature.narrowToVectorFeature(vectorFeature); popup = new AnchoredBubble("vector-info", new LonLat(0,0), new Size(300, 400), "<p>" + new KML().write(overlay) + "</p>", new Icon("", new Size(0, 0), new Pixel(0, 0)), true); map.addPopup(popup); } }); For some reason though, the info that popped up is not KML. It looks more like this: OpenLayers exportExported on Thu Mar 5 08:49:56 EST2009OpenLayers.Feature.Vector_262No description available-0.0703125, 2.4609375 -0.703125,-20.390625 ... Am I using the KML exporter incorrectly? Thanks again, Brendan On Thu, Mar 5, 2009 at 5:43 AM, Edwin Commandeur <com...@gm... > wrote: > Hi there, > > Selecting features happens with a control in OpenLayers. I saw in the > GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature > control. By default the SelectFeature selects features on click and you can > pass it options to select on hover. > > So: > (1) we need to add support for the select feature control => ADDED 5 min > ago > > I added a wrapper for SelectFeature, but did not thoroughly test it... > Maybe you can try it out. > > One caveat: The onSelect and onUnselect callback methods do not hook in > with the broader OpenLayers event system. By the latter I mean that for > example Vector (a vector layer object) has an Event object to register and > unregister events, while the onSelect and onUnselect are just callback > methods of the Control. This is why I added the Listener interfaces to the > Control itself and this is why the methods onSelectFeature and > onUnselectFeature return a JSObject which is a VectorFeature that you have > to narrow to a VectorFeature yourself inside the method e.g. > new SelectFeatureListener(){ > public void onSelectFeature(JSObject vectorFeature) { > VectorFeature vf = > VectorFeature.narrowToVectorFeature(vectorFeature); > } > > (2) you then need to add a button to activate the SelectFeature control > (and deactivate the other editing controls). > > Point (2) could be realised in two ways: (a) you should create your own > editing toolbar using GWT (b) we could support adding controls to the > Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very > difficult to support this in GWT-OpenLayers. I guess that most people want > an editing toolbar like this one: > > http://crschmidt.net/mapping/wpserverdemo/ > > I will look into point 2b shortly, but cannot promise to have anything > ready overnight. > > Greetings, > Edwin > > 2009/3/4 Brendan Grady <bre...@gm...> > >> Hello, >> >> >> New user to gwt-openlayers. >> >> Does anyone have an example of adding a "select" listener to a Vector >> layer? I am adding vectors using the Editing Toolbar. >> >> In openlayers, I would add something like the following: >> >> selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, >> {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); >> >> >> I tried the following, but I think I need to add something else to the map >> to make the layer "selectable" as it does not seem to register that I am >> over a selectable vector: >> >> <snip> >> Vector overlayLayer = new Vector("Overlay Creation Layer"); >> map.addLayer(overlayLayer); >> map.addControl(new EditingToolbar(overlayLayer)); >> >> overlayLayer.addVectorFeatureSelectedListener( new >> VectorFeatureSelectedListener(){ >> >> public void onFeatureSelected(Vector source, >> FeatureSelectedEvent eventObject) { >> VectorFeature overlay = eventObject.getFeature(); >> popup = new AnchoredBubble("vector-info", >> new LonLat(0,0), >> new Size(300, 400), >> "<p>" + new KML().write(overlay) + "</p>", >> new Icon("", new Size(0, 0), new Pixel(0, 0)), >> true); >> map.addPopup(popup); >> } >> >> }); >> </snip> >> >> Any suggestions? >> >> Thanks, >> Brendan >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Gwt-openlayers-users mailing list >> Gwt...@li... >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >> >> > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Edwin C. <com...@gm...> - 2009-03-05 10:43:22
|
Hi there, Selecting features happens with a control in OpenLayers. I saw in the GWT-OpenLayers codebase that we are not yet wrapping the SelectFeature control. By default the SelectFeature selects features on click and you can pass it options to select on hover. So: (1) we need to add support for the select feature control => ADDED 5 min ago I added a wrapper for SelectFeature, but did not thoroughly test it... Maybe you can try it out. One caveat: The onSelect and onUnselect callback methods do not hook in with the broader OpenLayers event system. By the latter I mean that for example Vector (a vector layer object) has an Event object to register and unregister events, while the onSelect and onUnselect are just callback methods of the Control. This is why I added the Listener interfaces to the Control itself and this is why the methods onSelectFeature and onUnselectFeature return a JSObject which is a VectorFeature that you have to narrow to a VectorFeature yourself inside the method e.g. new SelectFeatureListener(){ public void onSelectFeature(JSObject vectorFeature) { VectorFeature vf = VectorFeature.narrowToVectorFeature(vectorFeature); } (2) you then need to add a button to activate the SelectFeature control (and deactivate the other editing controls). Point (2) could be realised in two ways: (a) you should create your own editing toolbar using GWT (b) we could support adding controls to the Editing Toolbar. Option 2b is not yet in OpenLayers, but would not be very difficult to support this in GWT-OpenLayers. I guess that most people want an editing toolbar like this one: http://crschmidt.net/mapping/wpserverdemo/ I will look into point 2b shortly, but cannot promise to have anything ready overnight. Greetings, Edwin 2009/3/4 Brendan Grady <bre...@gm...> > Hello, > > New user to gwt-openlayers. > > Does anyone have an example of adding a "select" listener to a Vector > layer? I am adding vectors using the Editing Toolbar. > > In openlayers, I would add something like the following: > > selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, > {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); > > > I tried the following, but I think I need to add something else to the map > to make the layer "selectable" as it does not seem to register that I am > over a selectable vector: > > <snip> > Vector overlayLayer = new Vector("Overlay Creation Layer"); > map.addLayer(overlayLayer); > map.addControl(new EditingToolbar(overlayLayer)); > > overlayLayer.addVectorFeatureSelectedListener( new > VectorFeatureSelectedListener(){ > > public void onFeatureSelected(Vector source, > FeatureSelectedEvent eventObject) { > VectorFeature overlay = eventObject.getFeature(); > popup = new AnchoredBubble("vector-info", > new LonLat(0,0), > new Size(300, 400), > "<p>" + new KML().write(overlay) + "</p>", > new Icon("", new Size(0, 0), new Pixel(0, 0)), > true); > map.addPopup(popup); > } > > }); > </snip> > > Any suggestions? > > Thanks, > Brendan > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
From: Brendan G. <bre...@gm...> - 2009-03-04 16:53:26
|
Hello, New user to gwt-openlayers. Does anyone have an example of adding a "select" listener to a Vector layer? I am adding vectors using the Editing Toolbar. In openlayers, I would add something like the following: selectControl = new OpenLayers.Control.SelectFeature(overlayLayer, {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect}); I tried the following, but I think I need to add something else to the map to make the layer "selectable" as it does not seem to register that I am over a selectable vector: <snip> Vector overlayLayer = new Vector("Overlay Creation Layer"); map.addLayer(overlayLayer); map.addControl(new EditingToolbar(overlayLayer)); overlayLayer.addVectorFeatureSelectedListener( new VectorFeatureSelectedListener(){ public void onFeatureSelected(Vector source, FeatureSelectedEvent eventObject) { VectorFeature overlay = eventObject.getFeature(); popup = new AnchoredBubble("vector-info", new LonLat(0,0), new Size(300, 400), "<p>" + new KML().write(overlay) + "</p>", new Icon("", new Size(0, 0), new Pixel(0, 0)), true); map.addPopup(popup); } }); </snip> Any suggestions? Thanks, Brendan |