Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7445051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:43:36+00:00 2026-05-29T11:43:36+00:00

I am a Raphael newbie and need some help with the following: I am

  • 0

I am a Raphael newbie and need some help with the following:
I am using this raphael demo in order to build a map of Europe
http://playground.mobily.pl/tutorials/building-an-interactive-map-with-raphael/demo.html

Here is my version: – less countries displayed here.
http://jsbin.com/isecus/20

At the moment all the countries of the map have a fill colour of #fff, and when the user hovers the mouse over a country the fill color changes to #1669AD.

What I need to do is by the time the map is loaded, specific countries must have specific colour fills.
For example Poland should have a fill color of red and Spain a fill color of yellow. All other countries should have the default color of white/ #fff.
Any suggestions of how to accomplish this are more than welcomed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:43:36+00:00Added an answer on May 29, 2026 at 11:43 am

    You must add fill attribute to each country like this

    iceland: {
    
            name: 'Iceland',
            path: ...,
            fill: '#eee' //your color
        },
    

    And then in your for cycle you must add that color to fill attribute of your object

    for (var country in paths) {
            var obj = r.path(paths[country].path);
            obj.attr(attributes).attr({fill:paths[country].fill}); //like this
            arr[obj.id] = country;
                   //your other code here
            }
    

    Also, you must do same thinf in after-hover part in your code to bring back fill attribute to paths[country].fill.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Raphael to build a map-like site. when panning and zooming I want
I am using Raphael's JavaScript library (http://raphaeljs.com/) to draw some graphics into my web-application.
I am using Raphael to draw some paths. Each path has an associated rectangle
I'm using the Raphael library to draw some shapes, and then animate them into
i am using Raphael and Elberts FreeTransform Plugin. this is what i tried yet
Raphael example of Australia map has the following script (modified to include names in
I have created Raphael content here .. http://jsfiddle.net/ryWH3/76/ Now I need to move the
I am using raphael to animate a ball and need to find out the
Based on Raphael demo: http://raphaeljs.com/australia.html I have created objects that changes their colour. But
I am using the Raphael library from http://raphaeljs.com/ and work on a chart library.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.