Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    california
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ismap / imagemap question

    I am using the ismap tag and for the most part, it works fabulously. However, recently I went on a co-workers computer and noticed that the ismap coordinates are incorrect. the image is set to be 800 x 400 but on his computer it thinks the image is 100 x 500!!! So far it's the only computer that does that. Has anyone else encountered this problem and how to solve it?

    thanks a mill,
    sharyn
    'tis best not to get worked up over nothing

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Well, since there's no link, code, screenshot, or anything, I will use my magic eight ball....

    Apparently, the answer is "Signs point to yes."

    Well, ismap is really, really old and not very well implemented. Try another alternative:

    http://www.w3schools.com/tags/tag_map.asp

    Hopefully that works out for you. Make sure you're using a proper Doctype, etc, just to be extra careful.

  • #3
    New Coder
    Join Date
    Feb 2004
    Location
    california
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I need to get the x,y coordinates back. I am clicking on a map of something and I need to calculate the lat & long of where I clicked. Can I do this with the map tag?
    'tis best not to get worked up over nothing

  • #4
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Yes, sort of. The map tag defines the client-side image map. Within the map tag are the area shapes, where you define the clickable regions. So if you're using ismap for an image map then <map> will work just fine, and it's valid.

    If you need to get a reference of the coordinates for something other than an image map, then javascript might be the way to go. You can use ismap, but you can't count on it, as it's (as you see) not implemented by every browser.

    A link to the page in question might help us help you a little better...

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    I may be off-track, but if you're having trouble with making a imagemap, mapedit is pretty cool.

    http://www.boutell.com/mapedit/

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #6
    New Coder
    Join Date
    Feb 2004
    Location
    california
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    rmedek,

    I need x,y coordinates back from clicking on the image map. I can't see that the regular <map> tag does this.... or does it and I just can't figure it out?

    Sorry but the page is internal.

    - sharyn
    'tis best not to get worked up over nothing

  • #7
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    No. <map> will not return the coordinates, it is a container for predefined areas that are clickable. You will need to use javascript or some sort of processing to get the coordinates.

    I would pm a moderator to move this to the correct forum if that's the case.

  • #8
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Okay, forget everything I ever told you. I'm an idiot

    I was confusing ismap as a tag versus ismap as an attribute, and of course, it is in the xhtml spec (the link is to the XHTML2 working draft):

    http://www.w3.org/TR/2002/WD-xhtml2-...-ssImgMap.html

    So where's the smiley for embarassment? Oh, there it is.

    Anyways... I understand the link is internal but perhaps if you could at least post some code someone an dig in and take a closer look.

  • #9
    New Coder
    Join Date
    Feb 2004
    Location
    california
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    rmedek,

    Here is the code :

    Code:
    <div align="center">
    <font color="#3366FF" size="2" face="Trebuchet MS">
    <table width="25%" border="1" align="center">
      <tr>
        <td>
          <div align="center">
          <font color="#3366FF" face="Trebuchet MS">[ Click anywhere on the map ]</font></div>
        </td>
      </tr>
      <tr>
        <td>
          <a href="intermediate.php?UserID=2&ResLev=0&Zoom=on"><img src="Maps/WorldMap.jpg" width="800" border="0" ismap></a>
        </td>
      </tr>
    </table>
    </font>
    </div>
    'tis best not to get worked up over nothing


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •