getting clicked co-ordinates on an image map

Discussion in 'HTML' started by paul@paullee.com, Jan 26, 2006.

  1. Guest

    Hi all,
    I'd like to ask a quick question. Its probably got a simple answer!

    I'm creating a clickable image map for a website - now this doesn't
    present any problems as I have created client side maps in the past.
    But this time, what I would like is to get the co-ordinate of the
    clicked area. Is there any way of doing this and then making those
    co-ordinates available server side?

    The reason for this is as follows: my map will contain many different
    areas, some overlapping, or contained within other areas.

    If I have just one overlapped area for two shapes, then this will lead
    to three clickable areas. With many such overlaps, the amount of
    calculation required to find such areas will be horrible (the areas are
    obtained from a database which is going to be updated on a regular
    basis).

    So, what I was thinking was:
    get the co-ordinates of the clicked point; do the processing server
    side and then sent the client a webpage listing all the areas "found"
    in the clicked region.
    Is this possible?

    Hope that makes sense!

    Thanks

    Paul
     
    , Jan 26, 2006
    #1
    1. Advertising

  2. oeb Guest

    wrote:
    > Hi all,
    > I'd like to ask a quick question. Its probably got a simple answer!
    >
    > I'm creating a clickable image map for a website - now this doesn't
    > present any problems as I have created client side maps in the past.
    > But this time, what I would like is to get the co-ordinate of the
    > clicked area. Is there any way of doing this and then making those
    > co-ordinates available server side?
    >
    > The reason for this is as follows: my map will contain many different
    > areas, some overlapping, or contained within other areas.
    >
    > If I have just one overlapped area for two shapes, then this will lead
    > to three clickable areas. With many such overlaps, the amount of
    > calculation required to find such areas will be horrible (the areas are
    > obtained from a database which is going to be updated on a regular
    > basis).
    >
    > So, what I was thinking was:
    > get the co-ordinates of the clicked point; do the processing server
    > side and then sent the client a webpage listing all the areas "found"
    > in the clicked region.
    > Is this possible?
    >
    > Hope that makes sense!
    >
    > Thanks
    >
    > Paul
    >


    I don't know about xhtml, but you could always create an image map in
    oldstyle html (=P) by just adding the ismap attribute to an image tag.

    This will pass the coordinates along.
     
    oeb, Jan 26, 2006
    #2
    1. Advertising

  3. Guest


    > >

    >
    > I don't know about xhtml, but you could always create an image map in
    > oldstyle html (=P) by just adding the ismap attribute to an image tag.
    >
    > This will pass the coordinates along.


    Thanks...now I'm wondering how to retrieve them serverside...the
    problem is still one
    of mapping a co-ordinate to a dynamically generated series of areas,
    and coping with overlaps,
    whether it be done client or server side.
     
    , Jan 26, 2006
    #3
  4. Guest

    I think I've found what I'm looking for, something like...:

    <form action="getCoords.php" method="post">
    <input type="image" src="getWorldMap.php" name="worldmap" />
    </form>

    and then in getCoords.php I can just get worldmap_x and _y

    Shame I can't try it out right now though....
     
    , Jan 26, 2006
    #4
  5. oeb Guest

    wrote:
    > I think I've found what I'm looking for, something like...:
    >
    > <form action="getCoords.php" method="post">
    > <input type="image" src="getWorldMap.php" name="worldmap" />
    > </form>
    >
    > and then in getCoords.php I can just get worldmap_x and _y
    >
    > Shame I can't try it out right now though....
    >

    They are passed as get variables. You will see them in your request string.
     
    oeb, Jan 26, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roubles

    GIS co-ordinates

    Roubles, Nov 6, 2004, in forum: Java
    Replies:
    1
    Views:
    471
    Oscar kind
    Nov 6, 2004
  2. Abhishek
    Replies:
    0
    Views:
    402
    Abhishek
    Mar 5, 2006
  3. Vikas Kumar

    how to get co-ordinates to write on image

    Vikas Kumar, Jun 20, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    355
    Jeffrey Tan[MSFT]
    Jun 21, 2006
  4. Muhammed Syyid

    Select a section of an image (co-ordinates

    Muhammed Syyid, Nov 17, 2003, in forum: Javascript
    Replies:
    1
    Views:
    92
    Fabian
    Nov 17, 2003
  5. vedavyass1988
    Replies:
    0
    Views:
    650
    vedavyass1988
    Apr 5, 2012
Loading...

Share This Page