Link to home
Create AccountLog in
Avatar of dpdmembers
dpdmembersFlag for Barbados

asked on

Change Color in Code Behind for a Map/Area

I am trying to find out how to change the color in code behind for the following area tag:

<img src="Barbados.png" usemap="#Barbados" id="BarbadosMap" alt="Barbados" /></p>
             
<map name="Barbados" id="Barbados">
<area id="StLucy" shape="poly" style="display:none;"
coords="15,70,25,59,29,63,40,62" href="#"  alt="St. Lucy"
data-maphilight= '{"alwaysOn":true,"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.8}'/>
</map>
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

The only colours shown in your code are 0000ff (blue) for strokeColor and ff0000 (red) for the fillColor. These are the hexadecimal values of colours and you can use a colour selector to choose your own - http://www.colorpicker.com/

The code you've shown above won't actually change or set any colours - it looks like they are there to be processed by some other code - probably jQuery.
Avatar of dpdmembers

ASKER

I know that the code would not actually change or set any colours, those are the default colors.  What I would like to do is to change those colors when certain conditions are met.
What conditions! Not sure I follow what you mean
I don't think the conditions matter... what I need to do is change the colors.
Then just change the colours!

<area id="StLucy" shape="poly" style="display:none;"
coords="15,70,25,59,29,63,40,62" href="#"  alt="St. Lucy"
data-maphilight= '{"alwaysOn":true,"strokeColor":"ca00ca","strokeWidth":3,"fillColor":"00cc00","fillOpacity":0.8}'/>

Open in new window

It has to change on the fly in the code behind.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Is that client side jquery?
is there any way to do this from server side even if I  am calling a JQuery function from code behind in vb
Yeah. When you generate your code on the server, just generate different code!

You're being a little vague, so I can't really be specific. If you explain in detail exactly what you're trying to achieve I might be able to help a little more.