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>???

Member Avatar for diafol

Is this a php-related query?

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?

Member Avatar for diafol

OK.
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:

.skaarg{
  background-color: blue;
  color: yellow;
}

.cimerron{
  background-color: green;
  color: black;
}

Should be quite simple.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.