Using ImageMap

Discussion in 'ASP .Net Building Controls' started by WAkthar, Jan 6, 2006.

  1. WAkthar

    WAkthar Guest

    Hi

    I need to use the imagemap control to display a map of a city centre.
    Using this imagemap I need to be able to load locations of certain places
    and display a yellow circle on the map. I also need to be able to display a
    pop up with some info for the location whenever the user moves the mouse
    over that location.


    In my Page_Load method I have the following at the moment:

    // Example of a hotspot
    imageMap.Areas.Add(new ImageMapCircleArea("", new Point(100, 50), 12));
    imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(139, 50), 41,
    "Location X"));

    // How can I add a circle to the imagemap to cover this hotspot???

    StringBuilder script = new StringBuilder();
    script.AppendFormat("<script language=\"javascript\">{0}",
    Environment.NewLine);
    script.AppendFormat("\tvar image1 = new Image(291, 112);{0}",
    Environment.NewLine);
    script.AppendFormat("\timage1.src = \"Map Backdrop.JPG\";{0}",
    Environment.NewLine);
    script.AppendFormat("\tfunction DisplayImage(image) {0}{1}", "{",
    Environment.NewLine);
    script.AppendFormat("\t\tdocument.imageMap.src = image.src;{0}",
    Environment.NewLine);
    script.AppendFormat("\t\treturn true;{0}", Environment.NewLine);
    script.AppendFormat("\t{0}{1}", "}", Environment.NewLine);
    script.Append("</script>");

    Page.RegisterClientScriptBlock("DisplayImage", script.ToString());
     
    WAkthar, Jan 6, 2006
    #1
    1. Advertising

  2. WAkthar

    Vear Guest

    Were you able to do this? I'm trying to do a similar thing with no luck.

    Thanks

    "WAkthar" wrote:

    > Hi
    >
    > I need to use the imagemap control to display a map of a city centre.
    > Using this imagemap I need to be able to load locations of certain places
    > and display a yellow circle on the map. I also need to be able to display a
    > pop up with some info for the location whenever the user moves the mouse
    > over that location.
    >
    >
    > In my Page_Load method I have the following at the moment:
    >
    > // Example of a hotspot
    > imageMap.Areas.Add(new ImageMapCircleArea("", new Point(100, 50), 12));
    > imageMap.Areas.Add(new ImageMapCircleArea(null, new Point(139, 50), 41,
    > "Location X"));
    >
    > // How can I add a circle to the imagemap to cover this hotspot???
    >
    > StringBuilder script = new StringBuilder();
    > script.AppendFormat("<script language=\"javascript\">{0}",
    > Environment.NewLine);
    > script.AppendFormat("\tvar image1 = new Image(291, 112);{0}",
    > Environment.NewLine);
    > script.AppendFormat("\timage1.src = \"Map Backdrop.JPG\";{0}",
    > Environment.NewLine);
    > script.AppendFormat("\tfunction DisplayImage(image) {0}{1}", "{",
    > Environment.NewLine);
    > script.AppendFormat("\t\tdocument.imageMap.src = image.src;{0}",
    > Environment.NewLine);
    > script.AppendFormat("\t\treturn true;{0}", Environment.NewLine);
    > script.AppendFormat("\t{0}{1}", "}", Environment.NewLine);
    > script.Append("</script>");
    >
    > Page.RegisterClientScriptBlock("DisplayImage", script.ToString());
    >
    >
    >
     
    Vear, Mar 18, 2006
    #2
    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. Ben Fidge

    Client-side imagemap editor?

    Ben Fidge, Oct 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    563
    Patrice
    Oct 13, 2004
  2. Gilgamesh
    Replies:
    0
    Views:
    481
    Gilgamesh
    Jan 6, 2006
  3. Nathan Sokalski

    Using ASP.NET 2.0's ImageMap Control

    Nathan Sokalski, Sep 24, 2006, in forum: ASP .Net
    Replies:
    9
    Views:
    474
    clintonG
    Sep 25, 2006
  4. Nathan Sokalski

    Using ASP.NET 2.0's ImageMap Control

    Nathan Sokalski, Sep 24, 2006, in forum: ASP .Net Building Controls
    Replies:
    9
    Views:
    193
    clintonG
    Sep 25, 2006
  5. Nathan Sokalski

    Using ASP.NET 2.0's ImageMap Control

    Nathan Sokalski, Sep 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    9
    Views:
    149
    clintonG
    Sep 25, 2006
Loading...

Share This Page