<img src="xxx.jpg" border="0" usemap="#Map"> 
<map name="Map">
  <area shape="rect" coords="240,19,503,59" href="http://xxx.xxx.xxx" target="_blank">
</map>shape表示在图片上的热点区域为方形,coords表示起点和终点的坐标,href表示热点的连接地址,target表示打开连接的方式,这里是新打开一页

解决方案 »

  1.   

    用dreamweaver或frontpage更方便一点
      

  2.   

    dreamweaver,frontpage我都不会,还是用beyond_xiruo的方法更现实点,我先试试再说,先谢了 啊!
      

  3.   

    比如我的地图文件放在C盘的TEST文件夹下,取名为"image.jpg",上述程序应该怎么写?
      

  4.   

    <img src="file:///C:/TEST/image.jpg" border="0" usemap="#Map"> 
    <map name="Map">
      <area shape="rect" coords="240,19,503,59" href="http://xxx.xxx.xxx" target="_blank">
    </map>
    coords里的坐标参数还是要你自己来定,它表示图片上的坐标点
      

  5.   

    我现在已经做出一个可以在地图上看坐标的程序,可是还是不知道怎么把北京二字变为可点击的,大家继续帮忙!程序如下:import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;/*
    <APPLET
     CODE=Mouse.class
     WIDTH=300                 //修改为适应图片大小
     HEIGHT=200>               //修改为适应图片大小
    </APPLET>
    */public class Mouse extends Applet implements MouseListener,
    MouseMotionListener
    {
     Image image;     
     TextField text1;
     
     public void init()
     {
      text1=new TextField(30);
      add(text1);
      addMouseListener(this);
      addMouseMotionListener(this);  image=getImage(getDocumentBase(),"image.jpg"); //参照你的代码增加 
    }public void paint(Graphics g)       
    {                                   
     g.drawImage(image,150,150,this);   
    }                                   public void mousePressed(MouseEvent e)
    {
     if((e.getModifiers()&InputEvent.BUTTON1_MASK)==InputEvent.BUTTON1_MASK)
     { 
      text1.setText("Left mouse button down at"+e.getX()+","+e.getY());
     }
     else
     {
      text1.setText("Right mouse button down at"+e.getX()+","+e.getY());
     }
    }public void mouseClicked(MouseEvent e)
    {
     text1.setText("You clicked the mouse at"+e.getX()+","+e.getY());
    }public void mouseReleased(MouseEvent e)
    {
     text1.setText("The mouse button went up.");
    }public void mouseEntered(MouseEvent e)
    {
     text1.setText("The mouse entered.");
    }public void mouseExited(MouseEvent e)
    {
     text1.setText("The mouse exited.");
    }public void mouseDragged(MouseEvent e)
    {
     text1.setText("The mouse was dragged.");
    }public void mouseMoved(MouseEvent e)
    {
     text1.setText("The mouse was moved.");
    }
    }
    以上是鼠标事件,大家可以保存为Mouse.java
       <html>
       <head>
       <title>MyMap</title>
       </head>
       <body>
       
       <applet 
        code="Mouse.class"
        width=300
        height=300
       >
       </applet>
       </body>
       </html>
    以上是一个HTML文件,可保存为map.html,
    当然大家还要导入一个地图文件,这里不能帖图,http://www.culturalink.gov.cn/chinamap.htm可以去这下一个放在和刚才两个文件保存在同一个文件夹中。
    这样在APPLET中就可以运行了,只是不太好看。请大家帮忙做的人性化些,怎样才能把鼠标放在北京二字上就会出现坐标?而不用点击后才出现?我现在要的是点击后出现北京市地图!谢谢大家,一起完成这个程序,好吗?