The ability to determine relevant information strongly depends on what
you know about the information you are displaying to the user. I'm
assuming you know about the information you are presenting to the user
and so it should be possible to map the coordinate system that the user
interacts with, to a global coordinate system for which you have
information about given aspects of the map. If you don't already have a
relationship between the graphics you are working with and the relevant
information, then this is probably your starting point. For instance if
it were a map of a city that occupied a rectangle of space on the
graphics (this is simplified since it could be any polygon), you would
probably have two coordinates that indicate a bounding box for that city
on the global map.

0,0
.---------------------------------------------------------------.
|                                                               |
|                                                               |
|                                                               |
|                         * Ottawa                              |
|                         [1024,718 to 1035,726]                |
|                                                               |
|                                                               |
`---------------------------------------------------------------'
                                                             2500,1500

Thus a coordinate where the following holds:

    (x >= 1024 && x <= 1035 && y >= 718 && y <= 726)

would correspond to the city of Ottawa. These coordinates could easily
be stored in a database for easy lookup by your PHP application.

Anyways I hope I'm understanding your problem correctly.

Cheers,
Rob.


On Thu, 2003-08-07 at 11:59, Yao, Minghua wrote:
> Robert and skate,
> 
> Thank you for your reponses. The problem is there are thousands of spots on
> the plot.
> The locations are random. 
>  
> -MY
> -----Original Message-----
> From: Robert Cummings [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 11:00 AM
> To: skate
> Cc: Yao, Minghua; [EMAIL PROTECTED]
> Subject: Re: [PHP] How to point at a spot and get relevant information?
> 
> 
> ou should be able to use an image map form input widget to get the
> coordinates that the user selects from some image you display to them.
> Then the determination of relevant information can occur server side via
> PHP. I don't have experience with this, but it appears to be how
> mapquest works:
> 
> <input type=image name=mqmap border=0 src="http://mq-mapgen ...
> 
> HTH,
> Rob.
> 
> 
> On Thu, 2003-08-07 at 11:52, skate wrote:
> > 
> > 
> > >
> > > > Dear all,
> > > >
> > > > Anybody knows how to write a graphic plotting code such that when
> users
> > > > point
> > > > at that spot, they can get the information relevant to that spot?
> Thanks
> > > > in advance.
> > > >
> > 
> > 
> > that'd be pretty intense. to do this feasbly with PHP, you'd have to
> analyse
> > the picture first with the GD library. but to allow the user to interact
> > with this, your gonna have to store all values into JavaScript. the users
> > interaction can't be done with PHP, as that's all client side.
> > 
> > this would result in possibly huge amounts of code to download, and fairly
> > high processing time. i don't know if there's a javascript alternative, or
> > maybe some other technology someone's made. this wouldn't be so hard in
> > flash tho...
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> -- 
> .---------------------------------------------.
> | Worlds of Carnage - http://www.wocmud.org   |
> :---------------------------------------------:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.    |
> `---------------------------------------------'
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org   |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.    |
`---------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to