如果我們將地址作爲查詢字符串傳遞,如何在gridview中顯示yahoo靜態地圖?也請告訴如何顯示動態雅虎地圖。我搜索了約雅虎地圖,並獲得以下鏈接http://developer.yahoo.com/flash/maps/examples.html,http://developer.yahoo.com/maps/rest/V1/和http://developer.yahoo.com/maps/。我沒有得到任何鏈接,有代碼將雅虎地圖集成到ASP.Net網站中!如何在Yahoo.Net網站中集成Yahoo地圖
0
A
回答
0
我已經創建了雅虎動態地圖,該地址可以作爲頁面中隱藏字段的值傳遞。隱藏字段的值可以在page_load事件中動態傳遞。我在ASP.Net的母版頁封裝的子頁面中創建了這個。
在開始之前,用戶必須通過登錄您的雅虎ID並導航到此鏈接https://login.yahoo.com/config/login_verify2?.src=devnet&.done=http://developer.apps.yahoo.com/wsregapp/並提供我們的網站URL來生成使用雅虎地圖的應用程序ID。
用於顯示雅虎地圖的代碼如下給出:
.MAP { 高度:400像素; 寬度:700px; font-family:Verdana; font-size:11px; font-weight:bold; }
<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=YourAPPID">
</script>
<script type="text/javascript">
// Capture the user mouse-click and expand the SmartWindow
function onSmartWinEvent() {
// Create a map object
var map = new YMap(document.getElementById('<%= map.ClientID %>'));
// Add a pan control
map.addPanControl();
// Add a slider zoom control
map.addZoomLong();
// Display the map centered on the address specified
map.drawZoomAndCenter(document.getElementById('<%= HiddenField1.ClientID %>').value, 3);
// Create a marker positioned at the address specified
var marker = new YMarker(document.getElementById('<%= HiddenField1.ClientID %>').value, createCustomMarkerImage());
// Add a label to the marker
//marker.addLabel("<blink>*</blink>");
// Call onSmartWinEvent when the user clicks on the marker
YEvent.Capture(marker, EventsList.MouseClick, onSmartWinEvent);
// Display the marker
map.addOverlay(marker);
var words = document.getElementById('<%= HiddenField1.ClientID %>').value;
marker.openSmartWindow(words);
// Add map type control
map.addTypeControl();
// Default map to satellite (YAHOO_MAP_REG) -- other opts: YAHOO_MAP_HYB,YAHOO_MAP_SAT
map.setMapType(YAHOO_MAP_REG);
}
function createCustomMarkerImage() {
var myImage = new YImage();
myImage.src = 'http://l.yimg.com/www.flickr.com/images/dot_splat.png';
myImage.size = new YSize(30, 31);
myImage.offsetSmartWindow = new YCoordPoint(15, 15);
return myImage;
}
</script>
<table width="100%" align="left">
<tr>
<td>
<body onload="onSmartWinEvent()">
<div id="map" class="map" runat="server">
</div>
<asp:HiddenField ID="HiddenField1" runat="server" />
</body>
</td>
</tr>
</table>
注:速率限制:在雅虎AJAX Maps API每天每IP限制爲50,000個查詢。查看該鏈接 http://developer.yahoo.com/search/rate.html
相關問題
- 1. 如何在手機網站中集成谷歌地圖
- 2. Yahoo API集成?
- 3. 如何生成uCommerce網站地圖XML
- 4. 如何生成網站地圖?(asp.net MVC3)
- 5. 如何生成現有網站的可視網站地圖?
- 6. 如何爲Maven網站生成Google網站地圖?
- 7. 如何爲其他人的網站生成網站地圖?
- 8. 如何在網站中集成位置圖?
- 9. 網站集成
- 10. 如何生成大型網站的圖形站點地圖
- 11. 在jsRender網站中使用Yahoo Web Analytics
- 12. 如何在iOS中集成Google地圖?
- 13. 如何在我的asp.net網頁中集成Google地圖?
- 14. 如何在ASP.NET網站中集成ASP.NET成員資格?
- 15. Facebook集成在PHP網站
- 16. 如何爲php網站生成XML站點地圖
- 17. 網站PayPal集成
- 18. phpbb網站集成
- 19. Facebook - 網站集成
- 20. 如何將我的站點地圖鏈接到Yahoo Boss?
- 21. 如何在網站上建立地圖
- 22. 如何將smpp集成到php網站
- 23. 如何將網站與Flickr API集成
- 24. 如何從網站集成JSON API
- 25. 如何將symfony網站與whmcs集成
- 26. 如何在網站上生成圖像?
- 27. 站點地圖生成器與RoumenDianoff網站地圖
- 28. 如何在網頁中安排div如google地圖或其他地圖網站
- 29. 如何爲反應中的網站創建網站地圖?
- 30. 如何將PHP網站和.Net網站與SSO集成