Crazy idea for link

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hello All,

If you look at the map on the page below you will see two plots, one
red, one blue with more colors to come. The map is generated daily using
matlab. Looking for thoughts on how I would go about dynamically making
the different colored lines a link so that they will take the user to
the closeup pages for each drifter unit. I'm not talking about an image
map. Is there a way in php or something like that to key on the color
with a pixel or two overlap and assign a link variable, or am I
dreaming. LOL


Thanks for your thoughts,

Patrick A. Smith           Assistant System Administrator
Ocean Circulation Group USF - College of Marine Science Phone: 727 553-3334

The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld

Re: Crazy idea for link


Patrick wrote:

Quoted text here. Click to load it

The only way to avoid image maps would be javascript, flash or an java
applet - I'd go with an image map. Then there are two possible ways:

a) You create a client-side image map
( )
by converting the lines into a polygon. Perhaps you could do this also with
maplab, which knows the coordinates so you don't have to do the extra step
of analyzing the image.

b) You use a server-side image map
( ). In this case
the complete map will be clickable and your server-side code recieves the
coordinates of the clicked pixel. It should be fairly easy with PHPs
image-processing functions to extract the color of this pixel from the map
and act accordingly.

(a) is a bit more user friendly, because she gets feedback which areas to
click by hovering over it - but it's also more difficult to implement.

In both cases the lines are pretty thin and hard to hit, so you should make
the sensitive area sufficiently larger than the line. For case (a):
algorithms to enlarge a polygon should be easy to find, perhaps some
textbook about vector-graphic stuff. In (b) you should also look in the
neighbourhood of the click-position for a red or blue pill^H^H^H^Hpixel.


Benjamin Niemann
Email: pink at odahoda dot de
WWW: /

Re: Crazy idea for link

Quoted text here. Click to load it

If you can determine the x,y coordinates of the lines at map creation time and
log those to a db you could make the entire image a
form submit button. The x, y coords clicked would be passed to a script (sub_x,
sub_y in php) that would redirect to the appropriate
page. you could use css to control the appearance of the cursor.

Just a thought.


Site Timeline