|
From: Andrew H. <ahh...@gm...> - 2010-06-07 07:02:04
|
Hi Guys, I need to be able to manipulate all the controls on a map, but I can't do anything like... map.getControls(); any ideas? Cheers --AH p.s. I really need to iterate over all controls and remove the ones I don't want. |
|
From: Edwin C. <com...@gm...> - 2010-06-07 20:29:00
|
Hi Andrew, That would be easy to add as a method to the Map, and it seems to make sense. Controls are stored in an array on the map. We need to get the JSObjects, narrow them to controls and return them in a Collection. I guess there is no method for that in OpenLayers because accessing the controls array is so easy in Javascript. Greetings, Edwin On 7 June 2010 09:01, Andrew Hughes <ahh...@gm...> wrote: > Hi Guys, > I need to be able to manipulate all the controls on a map, but I can't do > anything like... map.getControls(); any ideas? > Cheers > --AH > p.s. I really need to iterate over all controls and remove the ones I don't > want. > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > |
|
From: Andrew H. <ahh...@gm...> - 2010-06-09 01:16:16
|
I tried the following (in Map):
/**
* This will fetch all of the controls on the map.
* @return the Controls or an empty array.
*/
public Control[] getControls(){
JSObject[] jsObjects = getJSObject().getPropertyAsArray("controls");
int count = jsObjects.length;
Control[] controls = new Control[count];
for(int i =0; i < count ;i++){
controls[i] = Control.narrowToControl(jsObjects[i]);
}
return controls;
}
But this doesn't work, I'm out of my depth with JSNI...
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
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:178)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:266)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at org.gwtopenmaps.openlayers.client.util.JSObjectHelper.getProperty(JSObjectHelper.java)
at org.gwtopenmaps.openlayers.client.util.JSObject$.getProperty$(JSObject.java:100)
at org.gwtopenmaps.openlayers.client.util.JSObject$.getPropertyAsArray$(JSObject.java:141)
at org.gwtopenmaps.openlayers.client.Map.getControls(Map.java:124)
Any help would be greatly appreciated :)
On Tue, Jun 8, 2010 at 5:58 AM, Edwin Commandeur <com...@gm...
> wrote:
> Hi Andrew,
>
> That would be easy to add as a method to the Map, and it seems to make
> sense. Controls are stored in an array on the map. We need to get the
> JSObjects, narrow them to controls and return them in a Collection. I
> guess there is no method for that in OpenLayers because accessing the
> controls array is so easy in Javascript.
>
> Greetings,
> Edwin
>
> On 7 June 2010 09:01, Andrew Hughes <ahh...@gm...> wrote:
> > Hi Guys,
> > I need to be able to manipulate all the controls on a map, but I can't do
> > anything like... map.getControls(); any ideas?
> > Cheers
> > --AH
> > p.s. I really need to iterate over all controls and remove the ones I
> don't
> > want.
> >
> ------------------------------------------------------------------------------
> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> > lucky parental unit. See the prize list and enter to win:
> > http://p.sf.net/sfu/thinkgeek-promo
> > _______________________________________________
> > Gwt-openlayers-users mailing list
> > Gwt...@li...
> > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
> >
> >
>
|
|
From: Edwin C. <com...@gm...> - 2010-06-09 08:00:31
|
Hi Andrew,
I am not sure what goes wrong, but apparently it happens in the
getPropertyAsArray method. I hope to be able to look at it tomorrow
The VectorFormat read method shows how an array can be retrieved
without the getPropertyAsArray method, so maybe that is an option.
Greetings,
Edwin
On 9 June 2010 02:15, Andrew Hughes <ahh...@gm...> wrote:
> I tried the following (in Map):
> /**
> * This will fetch all of the controls on the map.
> * @return the Controls or an empty array.
> */
> public Control[] getControls(){
> JSObject[] jsObjects = getJSObject().getPropertyAsArray("controls");
> int count = jsObjects.length;
> Control[] controls = new Control[count];
> for(int i =0; i < count ;i++){
> controls[i] = Control.narrowToControl(jsObjects[i]);
> }
> return controls;
> }
> But this doesn't work, I'm out of my depth with JSNI...
>
> 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
>
>
> at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:178)
> at
> com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:266)
> at
> com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
>
>
> at
> org.gwtopenmaps.openlayers.client.util.JSObjectHelper.getProperty(JSObjectHelper.java)
> at
> org.gwtopenmaps.openlayers.client.util.JSObject$.getProperty$(JSObject.java:100)
> at
> org.gwtopenmaps.openlayers.client.util.JSObject$.getPropertyAsArray$(JSObject.java:141)
>
>
> at org.gwtopenmaps.openlayers.client.Map.getControls(Map.java:124)
>
> Any help would be greatly appreciated :)
>
> On Tue, Jun 8, 2010 at 5:58 AM, Edwin Commandeur
> <com...@gm...> wrote:
>>
>> Hi Andrew,
>>
>> That would be easy to add as a method to the Map, and it seems to make
>> sense. Controls are stored in an array on the map. We need to get the
>> JSObjects, narrow them to controls and return them in a Collection. I
>> guess there is no method for that in OpenLayers because accessing the
>> controls array is so easy in Javascript.
>>
>> Greetings,
>> Edwin
>>
>> On 7 June 2010 09:01, Andrew Hughes <ahh...@gm...> wrote:
>> > Hi Guys,
>> > I need to be able to manipulate all the controls on a map, but I can't
>> > do
>> > anything like... map.getControls(); any ideas?
>> > Cheers
>> > --AH
>> > p.s. I really need to iterate over all controls and remove the ones I
>> > don't
>> > want.
>> >
>> > ------------------------------------------------------------------------------
>> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> > lucky parental unit. See the prize list and enter to win:
>> > http://p.sf.net/sfu/thinkgeek-promo
>> > _______________________________________________
>> > Gwt-openlayers-users mailing list
>> > Gwt...@li...
>> > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
>> >
>> >
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Gwt-openlayers-users mailing list
> Gwt...@li...
> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
>
>
|
|
From: Lukas J. <luk...@de...> - 2010-06-09 14:36:03
|
Anyone tested using 2.9 yet? Are there anything broken or does it work seamless? /Lukas |
|
From: Edwin C. <com...@gm...> - 2010-06-10 13:47:10
|
Are you perhaps trying to get the controls when there are no controls
on the map? Or are you sure there are controls? I found the KMLTest to
fail when it did not return any vectorfeatures. Looking at that now.
Greetings,
Edwin
On 9 June 2010 10:00, Edwin Commandeur <com...@gm...> wrote:
> Hi Andrew,
>
> I am not sure what goes wrong, but apparently it happens in the
> getPropertyAsArray method. I hope to be able to look at it tomorrow
>
> The VectorFormat read method shows how an array can be retrieved
> without the getPropertyAsArray method, so maybe that is an option.
>
> Greetings,
> Edwin
>
> On 9 June 2010 02:15, Andrew Hughes <ahh...@gm...> wrote:
>> I tried the following (in Map):
>> /**
>> * This will fetch all of the controls on the map.
>> * @return the Controls or an empty array.
>> */
>> public Control[] getControls(){
>> JSObject[] jsObjects = getJSObject().getPropertyAsArray("controls");
>> int count = jsObjects.length;
>> Control[] controls = new Control[count];
>> for(int i =0; i < count ;i++){
>> controls[i] = Control.narrowToControl(jsObjects[i]);
>> }
>> return controls;
>> }
>> But this doesn't work, I'm out of my depth with JSNI...
>>
>> 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
>>
>>
>> at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:178)
>> at
>> com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:266)
>> at
>> com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
>>
>>
>> at
>> org.gwtopenmaps.openlayers.client.util.JSObjectHelper.getProperty(JSObjectHelper.java)
>> at
>> org.gwtopenmaps.openlayers.client.util.JSObject$.getProperty$(JSObject.java:100)
>> at
>> org.gwtopenmaps.openlayers.client.util.JSObject$.getPropertyAsArray$(JSObject.java:141)
>>
>>
>> at org.gwtopenmaps.openlayers.client.Map.getControls(Map.java:124)
>>
>> Any help would be greatly appreciated :)
>>
>> On Tue, Jun 8, 2010 at 5:58 AM, Edwin Commandeur
>> <com...@gm...> wrote:
>>>
>>> Hi Andrew,
>>>
>>> That would be easy to add as a method to the Map, and it seems to make
>>> sense. Controls are stored in an array on the map. We need to get the
>>> JSObjects, narrow them to controls and return them in a Collection. I
>>> guess there is no method for that in OpenLayers because accessing the
>>> controls array is so easy in Javascript.
>>>
>>> Greetings,
>>> Edwin
>>>
>>> On 7 June 2010 09:01, Andrew Hughes <ahh...@gm...> wrote:
>>> > Hi Guys,
>>> > I need to be able to manipulate all the controls on a map, but I can't
>>> > do
>>> > anything like... map.getControls(); any ideas?
>>> > Cheers
>>> > --AH
>>> > p.s. I really need to iterate over all controls and remove the ones I
>>> > don't
>>> > want.
>>> >
>>> > ------------------------------------------------------------------------------
>>> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> > lucky parental unit. See the prize list and enter to win:
>>> > http://p.sf.net/sfu/thinkgeek-promo
>>> > _______________________________________________
>>> > Gwt-openlayers-users mailing list
>>> > Gwt...@li...
>>> > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
>>> >
>>> >
>>
>>
>> ------------------------------------------------------------------------------
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit. See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> _______________________________________________
>> Gwt-openlayers-users mailing list
>> Gwt...@li...
>> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users
>>
>>
>
|
|
From: Lukas J. <luk...@de...> - 2010-06-28 08:35:58
|
Answering my own question. I upgraded to 2.9.1 in our application which uses multiple baselayers, multiple WFSlayers, editing trough WFS and a whole lot other things. I haven't yet found anything that got broken other than a css class in OL that changed name. /Lukas -----Ursprungligt meddelande----- Från: Lukas Johansson [mailto:luk...@de...] Skickat: den 9 juni 2010 16:36 Till: gwt...@li... Ämne: [Gwt-openlayers-users] Experience using OpenLayers 2.9? Anyone tested using 2.9 yet? Are there anything broken or does it work seamless? /Lukas ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Gwt-openlayers-users mailing list Gwt...@li... https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users |
|
From: Edwin C. <com...@gm...> - 2010-06-28 09:02:45
|
Hi Lukas, Thanks for the feedback on your own question. Great to hear that upgrading worked smoothly. Greetings, Edwin On 28 June 2010 10:35, Lukas Johansson <luk...@de...> wrote: > Answering my own question. I upgraded to 2.9.1 in our application which uses multiple baselayers, multiple WFSlayers, editing trough WFS and a whole lot other things. I haven't yet found anything that got broken other than a css class in OL that changed name. > /Lukas > > -----Ursprungligt meddelande----- > Från: Lukas Johansson [mailto:luk...@de...] > Skickat: den 9 juni 2010 16:36 > Till: gwt...@li... > Ämne: [Gwt-openlayers-users] Experience using OpenLayers 2.9? > > Anyone tested using 2.9 yet? Are there anything broken or does it work > seamless? > /Lukas > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > |