NewSignature / us-map

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

how to add links to states #45

Open RawContent opened 9 years ago

RawContent commented 9 years ago

hello, im newbie here, i wonder how can i add link to each state, by clicking it moves to the targeted link and thank you

johnnyr209 commented 9 years ago

Did you figure out how to link each state to a URL?

eweisbrot commented 9 years ago

I used this:

click: function(event, data) { if (data.name == "AL") { window.location = "/surety-bonds/licensed-states/alabama_surety_bond.htm"; }

ghost commented 9 years ago

@eweisbrot thanks for writing that, helped me a ton!

         if (data.name == "UT") {
           $('#ut').toggle();
        }
          else {
            $('#ut').hide();
        }
gbdg commented 8 years ago

We have the logic referenced in the Jan 22 post (above) working successfully. We also have logic to highlight a state, as shown below, from another post. Both of these work fine. 'AL' : { fill: '#950000'},

Might I ask how to implement both the link and the highlighting logic for the Northeastern states?

We have wrapped the highlighting logic and the link logic with IF statements that are only true when at least on dealer is present for a given state. I want to enforce the same logic against the icons for the NE states.

activeiron commented 7 years ago

Hi I am trying to implement on click URL with three other functions. But I am having issues with the click: function. Can please gudie me with my code.