搜狗地图添加线路标注

//js代码

void ShowMap(WebBrowser wb)
{
wb.ObjectForScripting = this;
wb.DocumentText = ""
+ @""

+ ""
+ "

"
+ "";

}


//C#代码

{
int i = 0;

foreach (string data in pointName)
{
string sCmd = "showMarker('"

+ pointX[i] + "','" + pointY[i] + "','" + data + "')";
string sCmd2 = "getLatLng('" + pointX[i] + "','" + pointY[i] + "','" + data + "')";
try
{
IHTMLDocument2 doc = (IHTMLDocument2)wbmap.Document.DomDocument;
IHTMLWindow2 win = (IHTMLWindow2)doc.parentWindow;
doc = (IHTMLDocument2)wbmap.Document.DomDocument;
win = (IHTMLWindow2)doc.parentWindow;
win.execScript(sCmd, "JScript");
win.execScript(sCmd2, "JScript");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
i++;
}


try
{
string sCmd = "showLine('" + i + "')";
IHTMLDocument2 doc = (IHTMLDocument2)wbmap.Document.DomDocument;
IHTMLWindow2 win = (IHTMLWindow2)doc.parentWindow;
doc = (IHTMLDocument2)wbmap.Document.DomDocument;
win = (IHTMLWindow2)doc.parentWindow;
win.execScript(sCmd, "JScript");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

相关文档
最新文档