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