VDS Technologies

 

IN INFORMATION TOOL HOW TO ADD PHOTO

8/5/2015 1:51:56 AM
Total Posts 1

IN INFORMATION TOOL HOW TO ADD PHOTO

Sir,

i HAVE PROBLEM TO DISPLAY PHOTO ALONG WITH SOME INFORMATION IN INFORMATION TOOL

PLEASE FIND THE SOLUTION

 

8/5/2015 3:54:23 AM
Total Posts 33

Re: IN INFORMATION TOOL HOW TO ADD PHOTO

Hope this code below can help you,

protected void map_InfoWindowTool(object sender, AspMap.Web.InfoWindowToolEventArgs e)
{
AspMap.Recordset records;
records = map.Identify(e.InfoPoint, 20);
string s = records.Layer.Name;

e.InfoWindow.HorizontalAlign = HorizontalAlign.Center;
e.InfoWindow.Font.Bold = true;
e.InfoWindow.ScrollBars = ScrollBars.Auto;
e.InfoWindow.Width = 350;
e.InfoWindow.Height = 310;

StringBuilder sHtml = new StringBuilder();

// "locations" Layer Name
if (s == "locations")
{
while (!records.EOF)
{
sHtml.Append("<table width=\"308px\" >");
sHtml.Append("<thead><tr><td colspan=\"2\">INFO</td></tr></thead>");
sHtml.Append("<tbody>");

// "COLUMN_IMAGE" Image Location Path
sHtml.Append("<tr><td>Image</td><td >&nbsp;<img style=\"height:50px;width:50px;border-width:0px;cursor:pointer\" src=\"" + records.Fields["COLUMN_IMAGE"].Value.ToString() + "\" alt=\"Image\" /></td></tr> ");

sHtml.Append("</tbody>");
sHtml.Append("</table>");

records.MoveNext();
}

e.InfoWindow.Content = sHtml.ToString();
}
}

8/8/2015 12:08:42 AM
MVP
Total Posts 323

Re: IN INFORMATION TOOL HOW TO ADD PHOTO

An image inside an InfoWindow can be displayed as follows:

    void map_InfoWindowTool(object sender, InfoWindowToolEventArgs e)

    {

        e.InfoWindow.Width = 200;

        e.InfoWindow.Content = "Some info<br/> <img src=\"images/img1.gif\">";

    }