HTML image map

Discussion in 'NZ Computing' started by Rob J, Dec 10, 2005.

  1. Rob J

    Rob J Guest

    I have a site I decided to put an image map into to handle an image with
    different areas linking to different places.

    With the image map included in the source file it works fine but I
    figured it would be easier to put the image map into another file so it
    only has to be changed in one place if the links or image are changed.

    This is supposed to work with <img src="..." usemap="file.html#mapname">
    And the file contains

    <map name="mapname">
    <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
    "http://somesite/">
    <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
    "http://somesite/">
    <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
    "http://somesite/">
    <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
    "http://somesite/">
    </map>

    Except it doesn't work. Firefox shows the image is linkable but nothing
    happens when you click on any part of it.

    Does the file with the map in it have to be in any specific format e.g.
    full HTML format?

    I tried this also
    usemap="/path/to/map.html"
    which should work?
     
    Rob J, Dec 10, 2005
    #1
    1. Advertising

  2. Rob J

    Rob J Guest

    In article <>,
    am says...
    > I have a site I decided to put an image map into to handle an image with
    > different areas linking to different places.
    >
    > With the image map included in the source file it works fine but I
    > figured it would be easier to put the image map into another file so it
    > only has to be changed in one place if the links or image are changed.
    >
    > This is supposed to work with <img src="..." usemap="file.html#mapname">
    > And the file contains
    >
    > <map name="mapname">
    > <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
    > "http://somesite/">
    > <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
    > "http://somesite/">
    > <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
    > "http://somesite/">
    > <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
    > "http://somesite/">
    > </map>
    >
    > Except it doesn't work. Firefox shows the image is linkable but nothing
    > happens when you click on any part of it.
    >
    > Does the file with the map in it have to be in any specific format e.g.
    > full HTML format?
    >
    > I tried this also
    > usemap="/path/to/map.html"

    correction:
    <img usemap="/path/to/map.html#mapname">
     
    Rob J, Dec 10, 2005
    #2
    1. Advertising

  3. On Sat, 10 Dec 2005 19:48:30 +1300, Rob J wrote:

    > I have a site I decided to put an image map into to handle an image with
    > different areas linking to different places.
    >
    > With the image map included in the source file it works fine but I
    > figured it would be easier to put the image map into another file so it
    > only has to be changed in one place if the links or image are changed.
    >
    > This is supposed to work with <img src="..." usemap="file.html#mapname">
    > And the file contains
    >
    > <map name="mapname">
    > <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
    > "http://somesite/">
    > <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
    > "http://somesite/">
    > <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
    > "http://somesite/">
    > <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
    > "http://somesite/">
    > </map>
    >
    > Except it doesn't work. Firefox shows the image is linkable but nothing
    > happens when you click on any part of it.
    >
    > Does the file with the map in it have to be in any specific format e.g.
    > full HTML format?
    >
    > I tried this also
    > usemap="/path/to/map.html"
    > which should work?


    Wouldn't it be easier to use a serverside include?


    Undeniably Sluttish

    --
    Free software on every PC on every desk.
     
    Mr Undeniably Sluttish, Dec 10, 2005
    #3
  4. Rob J

    Enkidu Guest

    Rob J wrote:
    > I have a site I decided to put an image map into to handle an image with
    > different areas linking to different places.
    >
    > With the image map included in the source file it works fine but I
    > figured it would be easier to put the image map into another file so it
    > only has to be changed in one place if the links or image are changed.
    >
    > This is supposed to work with <img src="..." usemap="file.html#mapname">
    > And the file contains
    >
    > <map name="mapname">
    > <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
    > "http://somesite/">
    > <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
    > "http://somesite/">
    > <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
    > "http://somesite/">
    > <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
    > "http://somesite/">
    > </map>
    >

    One thing that I think is wrong is the usemap parameter. What you have
    says 'look for the anchor 'mapname' in 'file.html'. If the mapfile is a
    separate file called 'mapname' then it should be 'usemap=mapname' if
    'mapname' is in that same directory. Or you could specify the relative
    or absolute URL of the mapfile.

    As to the contents of the file, I'm not sure, but that format doesn't
    look familiar, but it's a long time since I used image maps.

    Cheers,

    Cliff
     
    Enkidu, Dec 10, 2005
    #4
  5. Rob J

    Shane Guest

    On Sat, 10 Dec 2005 20:58:07 +1300, Enkidu wrote:

    > Rob J wrote:
    >> I have a site I decided to put an image map into to handle an image with
    >> different areas linking to different places.
    >>
    >> With the image map included in the source file it works fine but I
    >> figured it would be easier to put the image map into another file so it
    >> only has to be changed in one place if the links or image are changed.
    >>
    >> This is supposed to work with <img src="..." usemap="file.html#mapname">
    >> And the file contains
    >>
    >> <map name="mapname">
    >> <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
    >> "http://somesite/">
    >> <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
    >> "http://somesite/">
    >> <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
    >> "http://somesite/">
    >> <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
    >> "http://somesite/">
    >> </map>
    >>

    > One thing that I think is wrong is the usemap parameter. What you have
    > says 'look for the anchor 'mapname' in 'file.html'. If the mapfile is a
    > separate file called 'mapname' then it should be 'usemap=mapname' if
    > 'mapname' is in that same directory. Or you could specify the relative
    > or absolute URL of the mapfile.
    >
    > As to the contents of the file, I'm not sure, but that format doesn't
    > look familiar, but it's a long time since I used image maps.
    >
    > Cheers,
    >
    > Cliff


    <map name="map">
    <area alt="" shape="poly" coords="2,11,8,116,23,115,20,10"
    href="#modern_operating_systems"
    ONMOUSEOVER="update_sel_book(modern_operating_systems,this.href);" />
    <area alt="" shape="rect" coords="64,13,76,115" href="#computer_networks"
    ONMOUSEOVER="update_sel_book(computer_networks,this.href);" />


    stolen from working example at
    http://www.simtec.co.uk/appnotes/AN0017/
    --
    To be a kind of moral Unix, he touched the hem of Nature's shift.
    -- Shelley
     
    Shane, Dec 12, 2005
    #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. sabine

    image in html document

    sabine, Dec 9, 2003, in forum: Computer Support
    Replies:
    2
    Views:
    406
    ┬░Mike┬░
    Dec 9, 2003
  2. Willard

    Free Map & Image Viewer??

    Willard, Jun 9, 2005, in forum: Computer Support
    Replies:
    5
    Views:
    552
    Willard
    Jun 11, 2005
  3. Todd Cary

    Creating HTML image displays

    Todd Cary, Nov 16, 2003, in forum: Digital Photography
    Replies:
    7
    Views:
    366
  4. Geoffrey Sinclair

    Policy map using policy map

    Geoffrey Sinclair, Jul 27, 2009, in forum: Cisco
    Replies:
    1
    Views:
    531
    bod43
    Jul 27, 2009
  5. Monima
    Replies:
    0
    Views:
    1,805
    Monima
    Dec 14, 2010
Loading...

Share This Page