NewSignature / us-map

An interactive map of the United States using Raphaël
BSD 2-Clause "Simplified" License
279 stars 184 forks source link

On State hover, how to show some description text about the state? #71

Open ramsabarish opened 6 years ago

ramsabarish commented 6 years ago

I want show some description about the State on mousehover. So far i could not find any option to do this. Kindly help me out.

ramsabarish commented 6 years ago

map

kjrhody commented 6 years ago

Since the state name comes from data.name you could create a list of items to get for each state depending on that abbreviation (e.g.:

let informationList = {
"AL" : "Some information",
"AK" : Some information",
}

$('#tooltip').text(informationList[data.name]).show();