Using ImageMap

W

WAkthar

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());
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top