Guest Madhumita

Mouse over a link, and highlight the map country

Recommended Posts

Hey all,

 

 

 

I've got a page here with a map of Europe: http://www.canuckabroad.com/travel-guides/travel-europe/

 

 

 

You can see how on the right of the map, I have a list of links with each country. I'd like it so that when I mouse over the links on the right, the approriate country lights up on the map (similar to how when you mouseover the map itself, the country name comes up and the map is highlighted).

 

 

 

I'm sure there's a way to do this with javascript, but I've got no idea where to start...Can anyone help me with this?

Share this post


Link to post
Share on other sites

Hi,

There is no native support for this but you can do this by updating the map XML again and again on mousehover on the links.

STEPS:

1 .When the mouse hovers over a link get the XML from map (store is as backup )

2 .Modify XML to set that entity's color to hover color

3. Set this new XML to the map using setDataXML

4. on mouse out set the backup XML stored to the map to restore the originality of the map

* This might be process hungry.

Share this post


Link to post
Share on other sites

Thanks for the response, but that totally went over my head - All I want is a link and a country to be highlighted. Is there not just a snippet of javascript I can use to do this?

 

 

 

I'm not much of a programmer.

 

 

 

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now