|
From: Edwin C. <com...@gm...> - 2009-08-20 09:10:55
|
Hi Vitor,
Thanks for sending me the files. I also saw you nicely documented the
methods. I have been looking at the code and thinking about a way to avoid
having to change OpenLayers Markers.js. I noticed a small error in setLonLat
in MarkerImpl: you have to pass the Marker JSObject to the method as well,
to set/invoke stuff on it.
Any real change to OpenLayers code itself means that we would have to
maintain our own branch of OpenLayers or force users to build a custom
OpenLayers with our patches, so that would be a problem for maintenance.
I guess OpenLayers is not keen on adding the change, since they seem to
approach the problem differently. If I look at the markerResize example then
I see that they keep a reference to icon and change the properties of the
icon.
The way I see it now is that it would be less invasive to add a getIcon()
method to Marker in GWT-OL, that uses JSNI to get the icon property of the
Marker. On that Icon you can then change it's URL and it's size: Is that
sufficient for your purposes? I wonder if we can put sth into icon to also
be able to change the offset.
I see in your solution you create a new Icon and copy it's properties to the
icon of the Marker. I think that would not be necessary if we provide a way
to get at the icon and change it's properties directly.
Also for the setLonLat I would propose to set the lonlat via JSNI in GWT-OL
and not add anything to OpenLayers Markers.js (in order to avoid also having
to maintain OL code vs the way we use OL for our purposes). I think it
should be as simple as changing getIcon and setLonLat in MarkerImpl to:
public static native JSObject getIcon(JSObject self)/*-{
return self.icon;
}-*/;
public static native JSObject setLonLat(JSObject self, JSObject
lonlat)/*-{
self.lonlat = lonlat;
}-*/;
I am interested to know what you think. If we do stuff with "private"
variables in GWT-OL than it is up to us to maintain it, which I think is ok,
as long as people can just drop in a regular OpenLayers build and we don't
need a customized OpenLayers for GWT-OL to work.
If you are still interested I would be happy to add you to the team of
developers. There is a lot of stuff in OpenLayers we do not yet wrap and
every help on getting GWT-OL to wrap OL as completely as possible is
appreciated. Also, convenience stuff like making it able to do things with
the Icon of Markers is where GWT-OL can add value in addition to providing
type safety :-)...
Greetings,
Edwin
2009/8/19 Michel vitor <mic...@gm...>
> Dear Edwin,
>
> I am sending you an attachment with the two classes that also the modified
> form's javascript file Openlayers with the two new functions.
> As they leave that changed the sources did it for personal use.
> If you have any suggestions on how to do this in anything but I am
> available.
>
> --
> Michel Vitor A Rodrigues
> 6° Periodo de Computação
> Grupo Intec,Viçosa MG
>
>
|