如何在ASP.Net gridview控件中顯示雅虎靜態地圖?加載地圖的地址將出現在gridview的其中一列中,並且基於每行的地址來顯示每行上的靜態地圖。如何將雅虎靜態地圖整合到ASP.Net網站中
0
A
回答
0
我已經完成了在ASP.Net網頁上顯示靜態地圖的代碼。我們可以在gridview的行數據綁定事件中調用DisplayYStaticMap方法,並在gridview中顯示yahoo靜態地圖。
公共靜態字符串DisplayYStaticMap(串streetName,串CITYNAME,串Statename的,INT imgWidth,INT imgHeight,INT變焦) { Web客戶端WC =新Web客戶端();
StringBuilder strb = new StringBuilder();
strb.Append("http://local.yahooapis.com/MapsService/V1/mapImage?Appid=YOURAPIID--&");
if (streetName != "")
{
strb.Append("street=");
strb.Append(streetName);
}
if (CityName != "")
{
strb.Append("&city=");
strb.Append(CityName);
}
if (stateName != "")
{
strb.Append("&state=");
strb.Append(stateName);
}
if (imgHeight != 0)
{
strb.Append("&image_height=");
strb.Append(imgHeight);
}
if (imgWidth != 0)
{
strb.Append("&image_width=");
strb.Append(imgWidth);
}
if (zoom != 0)
{
strb.Append("&zoom=");
strb.Append(zoom);
}
string str = wc.DownloadString(strb.ToString());
if (str.IndexOf("--&") != -1)
{
return str.Substring(str.IndexOf("http://gws.maps.yahoo.com"), str.IndexOf("--&"));
}
else
{
return str.Substring(str.IndexOf("http://gws.maps.yahoo.com"));
}
}
}
imgPhotos.Src = DisplayYStaticMap(ds.Tables [0] .Rows [0] [ 「PropertyAddress」]。的ToString()。SUBSTRING(0,ds.Tables [0] .Rows [0] [ 「PropertyAddress」]。ToString()。IndexOf(「,」)), ds.Tables [0] .Rows [0] [「PropertyCity」]。ToString(),ds.Tables [0] .Rows [0] [ 「PropertyState」]的ToString(),150,90,8)。
相關問題
- 1. 如何註冊雅虎網站分析?
- 2. 將Facebook'Page'狀態整合到網站中
- 3. 雅虎OAUTH登錄網站
- 4. 如何將hipchat整合到網站中?
- 5. 將wordpress整合到一個靜態網站
- 6. 如何將「聊天」整合到ASP.NET MVC網站中?
- 7. 谷歌地圖整合到網站
- 8. 如何將動態靜態Bing地圖嵌入到網頁中
- 9. 雅虎地圖ASP.NET內聯網應用示例
- 10. 如何將checkstyle整合到網站上?
- 11. 如何將簽證整合到網站?
- 12. 將自定義Google地圖搜索整合到網站中
- 13. 如何在雅虎地圖說明框中嵌入YouTube視頻 - 雅虎管道
- 14. API雅虎印度地圖
- 15. 如何以編程方式登錄到雅虎網站
- 16. 如何使用我從雅虎網站收到的價值yii
- 17. 將asp.net動態網站轉換爲靜態網站的工具
- 18. 來自ASP.NET網站的靜態網站
- 19. 將Google+整合到網站
- 20. 如何將博客引擎整合到asp.net mvc網站?
- 21. ASP.net - 靜態網站搜索
- 22. 將網站升級到HTML5;雅虎網站驗證是否重要?
- 23. 將WordPress嵌入到靜態網站中
- 24. 雅虎openid網站兼容性
- 25. 最適合谷歌地圖或雅虎地圖的.NET包裝?
- 26. 如何加載網站(谷歌,雅虎,任何網站)以帆布
- 27. ASP.NET網站地圖
- 28. 如何在Visual Studio 2013中將wrapbootstrap主題整合到asp.net網站中?
- 29. 如何從雅虎財經等網站獲取數據?
- 30. 將n2cms集成到靜態html網站
此鏈接http://developer.yahoo.com/maps/rest/V1/的代碼是用PHP語言顯示Yahoo靜態地圖,但我想用ASP.Net或C#.Net語言或javascript。 – banupriya 2010-10-05 11:49:38