473,395 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

extract the unique node id given the x and y coordinates

3
Hi,

I need to get the unique node assosicated given 2 sets of x and y coordinates.
I have the start and end coordinates of a selected region. And now I need to get the unique ID associated with both of it.

Please do let me know as soon as possible as to how I can go about doing this.

Thanks..
avz
Mar 26 '09 #1
5 2661
JosAH
11,448 Expert 8TB
@avvz
You have to give some more detail: how are those x,y,ID triples stored? What is/are stored in those two sets? Just (x,y) coordinates or the Carthesian product of all coordinates? Are you looking for a position on a (geographical) map?

kind regards,

Jos
Mar 26 '09 #2
avvz
3
Hi Jos,

Thank you for replying.
The x and y coordinates, are the coordinates where the screen starts at (0,0),
So when the mouse clicks to select an area, (assume a square ), then i get the top left x y position and the bottom right x y position.
So now that I have these values, I need to get the unique ID from the DOM tree. I learnt that for each element on the HTML page there is a unique node id associated with it.
So I need to get the unique node ids with the pair of x n y coordinates I have got.
Please do let me know if you need more information.

Thanks,
Avanthi
Mar 26 '09 #3
JosAH
11,448 Expert 8TB
For every component in that DOM tree you need to get the (x,y) (w,h) values (the top/left coordinate and width and height) and check whether or not they lie inside the given (x,y) (w, h) values. If the z value of those components is available as well, take the component which is nearest to the top of the z stack.

kind regards,

Jos
Mar 27 '09 #4
avvz
3
Hi Jos,

Thanks for the reply. Actually that is simliar to the logic I was thinking, but I just needed some code to go about doing this. So is there some code which I could get from anywhere?
Mar 27 '09 #5
JosAH
11,448 Expert 8TB
@avvz
Do you know how to iterate over your components in your DOM? If so you have solved the major part of your problem already.

kind regards,

Jos
Mar 27 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Rolf Kemper | last post by:
Dear Experts, I got stuck with the following problem and need your help. What I wnat to do is to get a set of distinct nodes. Before the distinct I have selected the multiple occourences...
3
by: xixi | last post by:
we are using db2 udb v8.1 on win 64 bit with fp3 with type 4 db2jcc.jar driver. i got some error extract from db2diag.log file, can someone explain me what this mean? ID:1788 TID:3492...
1
by: Brian Henry | last post by:
how do you determin what tree node something was drug onto? When I use the e.x and e.y to get the current node at that point useing GetNodeAt, the e.X and e.Y are not coordinates on the treeview,...
0
by: deko | last post by:
I'm trying to implement a custom TreeView that shows a ghost image while dragging. But the form I'm using is different from the sample code found here:...
2
by: RichardHatcher.com | last post by:
I am writing C code using xpath to extract some data from a XML document. The file uses namespaces, but the name spaces are all listed in the root node of the file as attributes. I want to...
6
by: Alan T | last post by:
Can I find out which node was right clicked on a treeview?
7
by: dotnetnoob | last post by:
i keep getting Object references not set to an instance of an object from this code: Private Sub EqBinding() Dim x As Integer x = 0 Do If CStr(arlsType.Item(x)) = "Bacnet Point" Then Dim...
2
by: wolfgang.schwarz | last post by:
hi, is there a way of getting the position and size of a text node in Firefox without altering the DOM? For example, suppose I have a document fragment like this: <div> textnode1 <img>...
45
by: Dennis | last post by:
Hi, I have a text file that contents a list of email addresses like this: "foo@yahoo.com" "tom@hotmail.com" "jerry@gmail.com" "tommy@apple.com" I like to
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.