Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Crazy idea for link
October 6, 2006, 3:54 pm
rate this thread
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
Thanks for your thoughts,
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu 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
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
(http://www.w3.org/TR/html40/struct/objects.html#h-13.6.2 ). 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.
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de /
Re: Crazy idea for link
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.