[OpenLayers-Users] Change cursor when mouse goes over wms feature

Jean-François Gigand jf at geonef.fr
Fri Aug 12 11:07:46 EDT 2011


Hi Robert,

Basically, it is not possible, as the client doesn't know about
features, since they are visually part of the WMS layer.

Anyway, the WMSGetFeatures request  (OpenLayers.Control.WMSGetFeature)
would catch user clicks and ask the WMS server to send back any
features on that location.
If you want the mouse cursor to change upon hovering, 2 solutions:

1. trigger WMSGetFeature after every mouse move (for ex, after the
mouse has stopped moving for 500ms).
  For that, the WMS server must be optimized, as it will have to
handle more frequent requests.
  There is still a delay (reactivity vs. server load), but you are
not limited in the number of vectors as a vector layer would.

2. take the approach of Google: business places are clickable,
although still on an image layer.
   I don't know how they do it (JS computation on every mouse move?
or use of image <area>?)

Best regards,

Jean-François Gigand - Geonef
Paris, France - http://geonef.fr/



2011/8/12 Robert Buckley <robertdbuckley at yahoo.com>:
> Hi.
> I have wms points in a map which are selectable. Unlike vector layers, the
> cursor doesn´t change when the mouse goes over the feature, so the user
> doesn´t see that the feature is selectable.
> Is this somehow possible with wms and openlayers?
> thanks,
> RB
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>


More information about the Users mailing list