0

I have a mapfile where the symbol color is set to blue. In my html I have a hover event that brings a popup when the user puts their cursor over the symbol. Working as intended.

Now on that same hover, I'd like to change that blue to another color.

This seems tricky as the color is set in the mapfile.

I added a class to my html tag, but can only modify content within the popup div...or so it seems.

map_body.html. Apologies for the lack of formatting but I tried to format it nicely within vim and got an unexpected token error, so I guess it has to be like this.

<! -- MapServer Template -->
<area shape="circle" class="map_circle" coords="[shpxy precision=0 proj=image yf=",7"    
xf=","]" title="" alt="" onmouseover='displayCityInfoHover("<table><tr><td>[Name],</td>
<td><td>[ICAO]</td></tr></table>", [shpxy precision=0 proj=image yf=",7" xf=","], 
[shpxy precision=0 proj=image yf=",7" xf=","])' onmouseout="hideCityInfoHover()" 
onclick='displayCityInfo("<table><tr><td>Name:</td><td><a 
href=\"/customer_airports2.php?lat=[LAT]&long=[LONG]\">[Name]</a></td></tr><tr>
<td>Airport Code:</td><td>[ICAO]</td></tr><tr><td>Lat:</td><td>[LAT]</td></tr><tr>
<td>Long:</td><td>[LONG]</td></tr></table>")' ">
2

You can send a new request with parameters that override the symbol color. See here Changing map file parameters via a form or a URL

You can also highlight one ore more features. See here SLD based selection on WMS layers

1

You would have to send a new request to Mapserver. See http://mapserver.org/cgi/runsub.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.