[mapserver-users] Ref: Highlight the selected area onmousemove byOpenLayer

Léveillé, James James.Leveille at mtq.gouv.qc.ca
Thu Jul 3 10:05:50 EDT 2008

We did something like what Steve mentionned with OL.

We added a layer designed to display the hilited polygon (or line).
On a mouse pause (0.5 secs), we send a getFeatureInfo.
With the resulting ID, we call MapServer again (getMap this time) using the
given ID as a filter to a specific MapServer layer.

Works fine, even if two calls to the server are necessary.
There might be a better way ...

Service des systèmes de Mission
Direction des technologies de l'information
Ministère des Transports du Québec
5833, boul. Pierre-Bertrand, 2ième étage
Québec (Québec) G2K 1K7
Téléphone:   (418) 380-2005 poste 227
Télécopieur: (418) 644-6653
james.leveille at mtq.gouv.qc.ca


-----Message d'origine-----
De : mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] De la part de Steve Lime
Envoyé : 3 juillet 2008 09:59
À : prasad.b at iworktech.com; mapserver-users at lists.osgeo.org
Objet : Re: [mapserver-users] Ref: Highlight the selected area onmousemove

I don't know that highlighting on move will work. It will take MapServer too
long to render each map to keep up with the mouse. You might consider doing
so only when the mouse pauses/hovers for a specified amount of time. OL has
a hover control that can help with this. If, for example, you had an OL
layer that was only responsible for the highlight then you could update it
based on the coordinate where the mouse paused. The highlight layer would be
a query map (mode=querymap). I'm not sure how you'd change the mode that the
MapServer OL layer sends to MapServer.

Anyway, you would pass that coordinate in as an option to the MapServer
layer by 
changing the mapext and mapxy params to match the current OL mapext and the
hover coordinate.

An idea anyway, assuming you can alter the mode in the OL layer...


>>> "Prasad B" <prasad.b at iworktech.com> 07/03/08 8:46 AM >>>

i  developing one MAPSERVER Application Using C# MapScript,
i have Successfully implemented the OpenLayer JavaScript with it. Now i want
to add functionality on mouse move  to highlight the area where mouse is
move. so can u help me how i can highlight region by OpenLayer .

waiting for your Usefull reply.

Thanks & Regards,

Prasad A. Bhale
iWork Technologies Pvt. Ltd.
Visit us: www.iworktech.com

mapserver-users mailing list
mapserver-users at lists.osgeo.org

More information about the mapserver-users mailing list