Openlayers Add-On - get postion of mouseclick

Hi,

I’m new to vaadin an experimenting around. So with the opelayers add-on. I simple want to use it as an input for a position. Is there an event fired if the user just clicks on the map so I get the coordinates of the mouse click? I’m thinking about something like
this
.

Thanks

Daniel

Hi,

That sure is some very basic stuff, but if I don’t remember totally wrong there is still no server side counter part for click listeners. DrawingMode.POINT would do pretty much the same too, but I haven’t implemented that either. For my initial use case I have just drawn some areas over map.

If you fill a ticket to the project page, I’ll be happy to implement it sometimes next week. It should be just a matter of some minutes to implement.

cheers,
matti

Hi,

thanks for the fast answer, it saved me a Sunday of trying around and loose believe in myself :wink: I’ve opened a
ticket
as a reminder.

Cheers

Daniel

Hi,

0.6.0 version is now in Directory. DrawingMode.POINT and VectorDrawnListener should do the trick.

cheers,
matti

Hi,

first had time to test now, it works fine for me!

Thanks

Daniel

Hi

I have a similar problem or question…

There is a map with one ore many poygons on it. Is it possible to mark/select one and then just getting the points of the selected polygon?
I saw the example with the VectorModifiedListener, but is it possible without modifying the vector? Just mark and get the informations?

Thanks a lot.
Greets

Hi,

You are talking about “feature selection” in OpenLayers jargon. I missed this feature just before my summer holiday too. I wrote two stub classes for it, but didn’t complete the task yet.

I guess most apps actually need this more than the editing/drawing feature. Would you add a ticket about this to the project page so this doesn’t get forgotten?

cheers,
matti

Hi Matti,

Thanks for your reply.

Yes, the feature selection in Open Layers is exactly what i mean.
I wrote a ticket:
http://code.google.com/p/vopenlayers/issues/detail?id=25

Would be great if that is possible.

btw: I use the draw and modification feature. It is very usefull for me, but only in combination with a selection feature.

Greets,
Marcel

Hi,

The SVN version (and 0.8.0-SNAPSHOT from google project) now has VectorSelectedListener and VectorUnSelectedListener. From the event object one can check which Vector was chosen. Selection options are still rather primitive, but we can extend them as requirements arise.

cheers,
matti

Dear Matti

I have just started to use the OpenLayers Add-On. I find it very useful so thank you for the efforts you put in it.

Could you tell me how I can have a Vector selected from the server-side? I.e. I have an OpenStreetMapLayer and a VectorLayer with some PointVectors in it and would like to have a PointVector pre-selected when the map is rendered. How can I achieve it?
If it is not possible with the current version then could you give me some hints how I could add such a feature?

Thanks for your answer in advance,
Richie.

Hi,

Currently there is no server side API to change selection on the server side. I think it shouldn’t be too hard to implement, if you know Vaadin, GWT and OpenLayers. Otherwise it might take some time to get started. But still it is by no means impossible. The project has to other active contributors (Giancarlo and Ozgun) and it has also received smaller patches from others.

Depending a bit what you are trying to achieve, you might be able to overcome the limitation, but using setCustomStyle or setRenderIntent methods. With the latter you could probably use “selected” to give the same visual looks as there is for selected vectors.

cheers,
matti

Oh, and those hints…

Here are some notes that might help to get started with the add-on development:
http://code.google.com/p/vopenlayers/wiki/DevelopingAndBuilding

cheers,
matti

Hi

Did you mean “it should NOT be too hard to implement, if you know…” or you really meant that it is a hard task to accomplish even if you know Vaadin, GWT and Openlayers?

Cheers,
Richie.

Typo. NOT word was missing there.

cheers,
matti