[OpenLayers-Users] Vector layer with map.events.register("click")

Brad Spencer bradspencer at ozemail.com.au
Wed Jun 9 19:37:07 EDT 2010


Vito,

 

Sorry I can't help you here. I only use temporary select polygon [i.e.
vectors] in client as all my data polygons remain on the WMS service. I do
drag the select polygon around map to spatially select more WFS data from
the server and once I'm done I delete the search polygon then my click &
doubleclick events are available as  getfeatureinfo request controls.

 

I could suggest that you have a control button on the app that initiates a
drag mode then the user has to go into drag mode and when they are finished
the go out of drag mode which reinstates the click mode?

 

Cheers, Brad.

 

 

From: vitotafuni at gmail.com [mailto:vitotafuni at gmail.com] On Behalf Of Vito
Tafuni
Sent: Tuesday, June 08, 2010 4:24 PM
To: brad at numaps.com.au
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Vector layer with
map.events.register("click")

 

i'm having a similar problem with polygons with ModifyFeature activated over
a simple google layer
i would like to drag the map even if the mouse is over a polygon 

Is there a way to distinguish between "click and drag" and "simple click"
over polygon??

...something like make the polygon pass the "click and drag" event to the
map...

thanks


-Vito-
--
-----------
Tafuni Vito
vito at vitotafuni.com
---------------------------------------------
"Verba volant, scripta manent... data corrupted"



2010/6/8 Brad Spencer <bradspencer at ozemail.com.au>

Stuart,

I think its horses for courses really. A lot of people get hung up about
mouseover interactivity and force programmers to do all sorts of gymnastics
to try to make a loosely coupled web app look like as responsive as a
desktop GIS. This is even worse when you are dealing with polygons -
geometry gets filtered and loaded to the client just to give the mouseover
interactivity which looks awful when you zoom in. Also, the area that a user
decides to apply this approach to maynot be controllable by you and could
lead to excessive and unnecessary geometry download times.

When working with remote data services you may or maynot have access to WFS
in which case you need to use getfeatureinfo requests to get the attributes
on a click. If the data is private to the end user and does not belong to
the WMS data provider at all then uploading geometry into the user's session
from their desktop is the way to go providing the mouseover interactivity.

Of course if you need the geometry in the client for real spatial analysis
purposes then that is a different issue than doing it just for mouseover
interactivity and is typically done on a more selective object basis.

Now to answer your question regarding clicking on the vector layer. I found
that you have to make the vector layer the top layer to avoid these
conflicts. So I manipulate the z-index of the vector layer to make sure its
at the top.

Cheers, Brad....






-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
Behalf Of gingerbbm
Sent: Tuesday, June 08, 2010 2:26 AM
To: users at openlayers.org
Subject: [OpenLayers-Users] Vector layer with map.events.register("click")


Dear all

I retrieve a set of points from GeoServer as a WMS tile. Using
map.events.register('click',...) I attempt to retrieve information about a
specific point when the map is clicked, using a bespoke WFS call.

I am now required to provide some data about each point on mouseover so have
been investigating OpenLayers.Layer.Vector and
OpenLayers.Control.SelectFeature. My initial idea is to keep my original WMS
layer and supplement it with a WFS-driven Vector layer. See this mock-up:

http://v5dev.elgin.gov.uk/sw.html

The idea is to set the opacity of the style of the vector objects to 0.01 to
take advantage of the "selected" behaviour while seemingly not affecting the
map appearance. But using this two-layer method, the map clicks are not
triggering over the vector objects.

So... two questions:

1. Is there a way to make map.events.register('click',...) work when a
vector object is selected?
2. Should I abandon this and simply use the vector layer exclusively
(plotting the relevant images at the appropriate points)?

Would appreciate your advice.

Thanks
Stuart
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Vector-layer-with-map-events-register
<http://osgeo-org.1803224.n2.nabble.com/Vector-layer-with-map-events-registe
r%0A-click-tp5149829p5149829.html> 
-click-tp5149829p5149829.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100610/bf8d58ad/attachment.html


More information about the Users mailing list