目前的地圖服務主要微軟的virtual earth,google的google earth和yahoo的map service.從開發上來說,微軟的virtual earth是最方便的。不過論地圖的精準性還是google的強大,畢竟它做的比較早。微軟已經將virtual earth改成Bing maps,將地圖服務整合到Bing(必應)搜尋中。而微軟的live service又包含bing service和Windows Azure Platform,live service本身就是架構在windows Azure平台上面 。扯到這裡已經扯的很遠了。
一般Map service有以下應用場合:
l 網站地理定位。比如你可以把你的商店,資產裝置,公司機構形象化的顯示在地圖上。可以便利的使用鳥瞰圖進行map漫遊和特定搜尋。
l 資訊門戶。基於地圖的入口網站搜尋,將地圖資訊與相關資訊進行整合便於地圖搜尋。
l 旅行門戶– 提供虛擬路線和路線中的資訊如路線中經過的商店,銀行,賓館等。
l 移動定位服務 .
l 即時航線和路線預測追蹤
在微軟開發領域,整合Google earth可以用其提供的COM api進行整合。COM api或和google的service進行互動。同時COM sdk提供了地圖用戶端的操作模型。
下面重點談談如何整合Bing Maps. 整合Bing Maps有二種方式
1 Meshup
l Ajax control
Example:
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
<script type="text/javascript">
var map = null;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>
l Silverlight control
<UserControl x:Class="MapControlInteractiveSdk.Tutorials.Modes.TutorialFadingLabels"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl">
<Grid x:Name="LayoutRoot" Background="White">
<m:Map CredentialsProvider="{StaticResource MyCredentials}" Center="37.806029,-122.407007" ZoomLevel="16">
<m:Map.Mode>
<m:AerialMode Labels="True" FadingLabels="True" />
</m:Map.Mode>
</m:Map>
<Border VerticalAlignment="Top" HorizontalAlignment="Right" Background="White" Opacity="0.7" CornerRadius="5" Padding="10">
<TextBlock Text="Labels fade after a few seconds when mouse remains still." />
</Border>
</Grid>
</UserControl>
l Asp.net control還沒有推出,馬上推出
2 server-side integration
有兩種地圖web service可供選擇。
l Bing Maps Web Services. Bing Maps Web Services (BMWS) provides SOAP/XML Web service access to static map images (.gif, .jpeg, and .png), direct map tile access, one-box search functionality, geocoding, reverse geocoding, and routing. These services also integrate with features in the Bing Maps Silverlight Control to provide a complete Web mapping application feature set.
l MapPoint Web Service. The MapPoint Web Service (MWS) uses industry-proven Web services available from Microsoft since 2002. The MWS core strength includes the ability to use customer-specific data to perform proximity and route searching and line drive maps.
其他整合方式:
某些第三方組件公司如ComponentOne提供了Map control for silverlight,map Control for asp.net,可以設定data source為google earth或virtual earth,可以更方便的API去控制地圖。在GE項目中我們就是用了這種方式
1. Virtual earth API主要功能:
2. 顯示地圖
3. 使用圖層,(圖釘圖層,shape圖層)
4. 加入元素(可以按比例縮放),加入元素按照座標
5. 加入map 事件
6. 自訂地表徵圖題圖層
7. 調用bing maps web service做商務邏輯自訂
8. 自訂形狀或導航
9. 資料繫結
10. 其他
是GE 項目的