I got a table that is made up as followed: region_id,...nation_id the regions are countries, the nations are names users choose.
I want to have a world map showing which nation has which region,
Is this possible?
I'm not sure how to do this, but maybe something with <map> and <area>???

8 Years
Discussion Span
Last Post by diafol

I thought so, because I will need todo a query to get which nation has which region and then I have to color the picture.
The regions can change every minute from nation, so everytime the page is called, the world map will be colored a bit different as before.

you get my point?


you'll probably need map/area as I think GD will not be able to deal with irregular shapes - I may be wrong.
Just use a classname for each nation based on the value in your DB. I suggest that you have a classname (or similar) field in 'regions' that will set the colour of the area. Using an INNER JOIN sql query, you should be able to loop over the records, each with a classname field.

Then in your CSS file, have a unique colour for each classname:

  background-color: blue;
  color: yellow;

  background-color: green;
  color: black;

Should be quite simple.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.