RE: [PHP] How to point at a spot and get relevant information?

From: Date: Thu, 07 Aug 2003 16:55:19 +0000
Subject: RE: [PHP] How to point at a spot and get relevant information?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-158682@lists.php.net to get a copy of this message
Since PHP plots the data according to the information in the database then you know about where the data is located in the image. If PHP works on a single plot coordinate then you need to increase the acceptable clickable region and use this to find your point (otherwise people will need to click on the exact coordinate pixel. For instance: To go back to my earlier Ottawa example. You have a coordinate in your database for Ottawa, let's imagine it is 1030, 720. To make an acceptable clickable region we could decide that 5 pixels on either side is acceptable for retrieving the information. By doing so we define a bounding box for the location of the data. The rectangle would be: ottawa.x - 5, ottawa.y - 5, ottawa.x + 5, ottawa.y + 5 Now, since you want the information when the cursor is pointed at the coordinate and not when the user clicks the coordinate you are restricted to using a client side technology to determine what data to display to the user (Javascript, Java, whatever else). This also means you will need to send all of the information about locations in the image to the user (possibly dynamically produced Javascript code). If this is to be done then you are probably better off to calculate the bounding box constraints at the client side, rather than on the server and sending the extra data. HTH, Rob. On Thu, 2003-08-07 at 12:38, Yao, Minghua wrote: > Sorry I didn't ask the question clearly. > > I have a large table stored in a db. PHP plots the data in the table. > I'd like the user to be able to get the relevant info of the spot when his > cursor > points at that spot on the plot. > > -MY -- .---------------------------------------------. | 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. | `---------------------------------------------'

« previous php.general (#158682) next »