paint map areas of real map and make distinction
Hi,
I want to make an area of a map from a JPG (see url for example):
http://www.meccg.net/netherlands/meccg/downloads/promomap.jpg
Now, I want the application I am building to be able to unravel in regions and break down the map regions into separate parts.
The application needs to know when the mouse is pointed on a region which region it is etc.
How can this be accomplished ?
Thanks,
Coen
[443 byte] By [
Coenosiaa] at [2007-10-3 1:36:13]

Ho Coenosia,
I think you have two options.
1. Break the map up into pre-prepared sections, say 100 units x 100 units, and assign a mouse listener to each section, so when the mouse moves into a section (it could highlight itself?) and the user clicks in it, it opens.
2. Draw a square around the cursor so the cursor is in the centre and moves with the mouse. This is the more flexible option. The user could perhaps make the square smaller or bigger by using the mouse scroll wheel. Anyway, the user selects a map area and the exact size he wants and clicks.
Hope this has been helpful to you,
Hasman.
just do it how you would in HTML: use polygons.
write up a quick "tracing" program that displays that image and remembers the "points" you plot on the screen with your mouse. save these points somewhere for later use.
in your real program, load those points, create an individual polygon for each area, and check if the mouse is in the area with Polygon.contains() or Polygon.intersects()