Johannes Kebeck's Blog
03-30-2008, 07:51 AM
<p>The Virtual Earth Platform contains actually 2 services. Virtual Earth (VE) itself and the MapPoint Web Service (MWS). As a customer you have access to both services and if you just want to evaluate the MapPoint Web Service you can request an evaluation-account <a href="https://mappoint-css.live.com/MwsSignup/Eval.aspx">here</a>. <p>While Virtual Earth is implemented through an AJAX-control you can access the MapPoint Web Service through a SOAP-API. In general there are not many reasons why you would want to use MapPoint Web Service in the presentation layer. One of the exceptions might be the LineDrive map-style for driving directions which removes the complexity of the map and shows just the relevant pieces of the route. <p><a href="http://blufiles.storage.msn.com/y1pLfDzppuxasiSBIQjz9eQf2YFH4JIwSPFP--1dB8mEytr5b2fDeI5SxyDrGkPTstuROHHwR5DE-U?PARTNER=WRITER">
http://blufiles.storage.msn.com/y1pLfDzppuxashThyjut_cXO0UatyieBBWe_jWiKcw_IRqpavY 7X0Im4iKH21uaxsrtHakE_LBdV0g?PARTNER=WRITER</a> <p>However, in the business layer and the backend MapPoint Web Service has still a few advantages such as: <ul> <li>batch geocoding, <li>reverse geocoding and <li>a point of interest database. </ul> <p>While Virtual Earth has business listings available in some countries, MapPoint Web Service has point of interest databases for the <a href="http://msdn2.microsoft.com/en-us/library/ms868169.aspx">North American</a> and the <a href="http://msdn2.microsoft.com/en-us/library/ms868167.aspx">European</a> market. These POI data sources are organized hierarchically, e.g.: <p><a href="http://eayyzw.blu.livefilestore.com/y1psLOdC392akqHTWPlARr2y81_OjwhNfhpTg8oznqh5E80v52 z6grm5ZYBpqHsIhsxY3_keli_uel1EsAwyvZD5g?PARTNER=WR ITER">
http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WEMnBc031S3QGcjn2DKTbo5Q_8pu5QUi0YI395 6Yo3JoSSUgIgfHW3mRgb37LegG06yVQV9nMElWlwy04mtNnPa? PARTNER=WRITER</a> <p>If you are interested for example in airports you can distinguish between minor airfields and major airports or you can get them all with one call. To do so you determine the Entity-name in the POI-table which is linked above, e.g. SIC4581 for major airports, SIC4580 for airfields or SICMaj45 if you want them all. Even when you get them all you can retrieve the Entity-Type from the results to set different icons (e.g. myResults.Results(j).FoundLocation.Entity.TypeName ). <p>The limitation is that the search-radius may not be bigger than 400 km or 250 miles. Additionally you have to consider that MWS uses a search-radius while Virtual Earth (VE) has a rectangle mapview. To determine the search-radius you can retrieve the latitude and longitude from the upper-left corner and the centre-point in VE and pass them as parameter through an AJAX-call to a web handler which in turn calls MWS. In MWS we have a function which allows you to <a href="http://msdn2.microsoft.com/en-us/library/aa492568.aspx">calculate distances between 2 or more pairs of latitudes and longitudes</a>. <p>Lets have a look at the process: <p><a href="http://blu1.storage.msn.com/y1pgaVuGim1rV1aNq9marHhU1FcvPttdUiCm5bXdH3Cl90UNp_ vQq53JcMIky8zTcC3OfoU6KyShI5pKtS6xGg6rlULAXQNq10v? PARTNER=WRITER">
http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WHIPIi-zZzIkLanxwQXBD4VN7OjOXnN__EvHiLonLSC9uKB5otv2-zXrzfFluQmgOmLVJ1L6mWNS54AZ4QMGVR8?PARTNER=WRITER</a> <ul> <li>When the user opens the page in his browser <ul> <li>He retrieves the website itself* from your server (1a) ... <li>...and since you reference the Virtual Earth MapControl in the head of the HTML-document, it retrieves the MapControl and the tiles directly from the Microsoft data centres (1b).</ul> <li>If you want to display the a POI-category you execute an AJAX-call to a web handler or web service on your web server. As parameters we send the latitude and longitudes of the upper-left corner and the centre-point of the map...<br><a href="http://eayyzw.blu.livefilestore.com/y1psLOdC392akpScj7ekic1MHwnldBTnhcbx6imfBPSYjyFbTi W2W0M2z8T_rS3nijVIFE9stEcKVRW6M5LQqaKWw?PARTNER=WR ITER">
http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WG5EJk2OMwCl9-mzgEVQW1Q8Ja7mC8WxP32E5lGI-y6mSGHGu6fi6Gi0UOjGWeBKTL3Mtpsf97G7JWZs4COKxhN?PAR TNER=WRITER</a> <br>...as well as the category of the POI we want to display (2a). The web handler will fetch the URL parameters and uses the latitudes and longitudes of the 2 points in a SOAP-call to the MWS in order to calculate the search-radius (2b). With the result it creates another SOAP-call to the FindServiceSoap and retrieves the POI in the area 2c). The result will be processed with a string builder and returned as JavaScript to the AJAX-call which is still waiting for the response (2a). Once the result is received it will be executed using the JavaScript eval-function.</ul> <p>Below you will find a sample application. <p> <p>This application uses a couple of your categories and adjusts the search-result whenever you pan or zoom the map. <p>If you haven’t done so yet, you need to <a href="https://mappoint-css.live.com/MwsSignup/Eval.aspx">request a MWS developer account</a>. To do so you will need a Windows Live ID. This account can later be converted into a production account. Once you have the credentials enter them in the web handler CallMWS.ashx<pre><span style="color:green">'Set up the web service
</span><span style="color:blue">Dim </span>myCredentials <span style="color:blue">As New </span>NetworkCredential(<span style="color:#a31515">"YOUR ID"</span>, <span style="color:#a31515">"YOUR PWD"</span>)</pre><a href="http://11011.net/software/vspaste"></a>
<p>The SDK for the MWS is available online <a href="http://msdn2.microsoft.com/en-us/library/aa492550.aspx">here</a> and available for download <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cb5148a9-f09e-4ec8-992f-16478c0b5d9a&DisplayLang=en">here</a>. If you are using Java or PHP you may want to have a look at the <a href="http://go.mappoint.net/mappointmpac/">MapPoint Multi-Platform Assistance</a>. Centre.
<p>
<div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px">Technorati Tags: <a href="http://technorati.com/tags/Virtual Earth" rel=tag>Virtual Earth</a>,<a href="http://technorati.com/tags/MapPoint Web Service" rel=tag>MapPoint Web Service</a></div><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=4819404664324524694&page=RSS%3a+Integrating+Virtual+Earth+and+MapPoint +Web+Service&referrer=" width="1px" height="1px" border="0" alt=""><img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&NA=1149&PI=73329&RF=&DI=3919&PS=85545&TP=johanneskebeck.spaces.live.com>1=JohannesKebeck">
Click here to view the article. (http://JohannesKebeck.spaces.live.com/Blog/cns!42E1F70205EC8A96!3765.entry)
http://blufiles.storage.msn.com/y1pLfDzppuxashThyjut_cXO0UatyieBBWe_jWiKcw_IRqpavY 7X0Im4iKH21uaxsrtHakE_LBdV0g?PARTNER=WRITER</a> <p>However, in the business layer and the backend MapPoint Web Service has still a few advantages such as: <ul> <li>batch geocoding, <li>reverse geocoding and <li>a point of interest database. </ul> <p>While Virtual Earth has business listings available in some countries, MapPoint Web Service has point of interest databases for the <a href="http://msdn2.microsoft.com/en-us/library/ms868169.aspx">North American</a> and the <a href="http://msdn2.microsoft.com/en-us/library/ms868167.aspx">European</a> market. These POI data sources are organized hierarchically, e.g.: <p><a href="http://eayyzw.blu.livefilestore.com/y1psLOdC392akqHTWPlARr2y81_OjwhNfhpTg8oznqh5E80v52 z6grm5ZYBpqHsIhsxY3_keli_uel1EsAwyvZD5g?PARTNER=WR ITER">
http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WEMnBc031S3QGcjn2DKTbo5Q_8pu5QUi0YI395 6Yo3JoSSUgIgfHW3mRgb37LegG06yVQV9nMElWlwy04mtNnPa? PARTNER=WRITER</a> <p>If you are interested for example in airports you can distinguish between minor airfields and major airports or you can get them all with one call. To do so you determine the Entity-name in the POI-table which is linked above, e.g. SIC4581 for major airports, SIC4580 for airfields or SICMaj45 if you want them all. Even when you get them all you can retrieve the Entity-Type from the results to set different icons (e.g. myResults.Results(j).FoundLocation.Entity.TypeName ). <p>The limitation is that the search-radius may not be bigger than 400 km or 250 miles. Additionally you have to consider that MWS uses a search-radius while Virtual Earth (VE) has a rectangle mapview. To determine the search-radius you can retrieve the latitude and longitude from the upper-left corner and the centre-point in VE and pass them as parameter through an AJAX-call to a web handler which in turn calls MWS. In MWS we have a function which allows you to <a href="http://msdn2.microsoft.com/en-us/library/aa492568.aspx">calculate distances between 2 or more pairs of latitudes and longitudes</a>. <p>Lets have a look at the process: <p><a href="http://blu1.storage.msn.com/y1pgaVuGim1rV1aNq9marHhU1FcvPttdUiCm5bXdH3Cl90UNp_ vQq53JcMIky8zTcC3OfoU6KyShI5pKtS6xGg6rlULAXQNq10v? PARTNER=WRITER">
http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WHIPIi-zZzIkLanxwQXBD4VN7OjOXnN__EvHiLonLSC9uKB5otv2-zXrzfFluQmgOmLVJ1L6mWNS54AZ4QMGVR8?PARTNER=WRITER</a> <ul> <li>When the user opens the page in his browser <ul> <li>He retrieves the website itself* from your server (1a) ... <li>...and since you reference the Virtual Earth MapControl in the head of the HTML-document, it retrieves the MapControl and the tiles directly from the Microsoft data centres (1b).</ul> <li>If you want to display the a POI-category you execute an AJAX-call to a web handler or web service on your web server. As parameters we send the latitude and longitudes of the upper-left corner and the centre-point of the map...<br><a href="http://eayyzw.blu.livefilestore.com/y1psLOdC392akpScj7ekic1MHwnldBTnhcbx6imfBPSYjyFbTi W2W0M2z8T_rS3nijVIFE9stEcKVRW6M5LQqaKWw?PARTNER=WR ITER">
http://eayyzw.blu.livefilestore.com/y1pYZrCEXzy6WG5EJk2OMwCl9-mzgEVQW1Q8Ja7mC8WxP32E5lGI-y6mSGHGu6fi6Gi0UOjGWeBKTL3Mtpsf97G7JWZs4COKxhN?PAR TNER=WRITER</a> <br>...as well as the category of the POI we want to display (2a). The web handler will fetch the URL parameters and uses the latitudes and longitudes of the 2 points in a SOAP-call to the MWS in order to calculate the search-radius (2b). With the result it creates another SOAP-call to the FindServiceSoap and retrieves the POI in the area 2c). The result will be processed with a string builder and returned as JavaScript to the AJAX-call which is still waiting for the response (2a). Once the result is received it will be executed using the JavaScript eval-function.</ul> <p>Below you will find a sample application. <p> <p>This application uses a couple of your categories and adjusts the search-result whenever you pan or zoom the map. <p>If you haven’t done so yet, you need to <a href="https://mappoint-css.live.com/MwsSignup/Eval.aspx">request a MWS developer account</a>. To do so you will need a Windows Live ID. This account can later be converted into a production account. Once you have the credentials enter them in the web handler CallMWS.ashx<pre><span style="color:green">'Set up the web service
</span><span style="color:blue">Dim </span>myCredentials <span style="color:blue">As New </span>NetworkCredential(<span style="color:#a31515">"YOUR ID"</span>, <span style="color:#a31515">"YOUR PWD"</span>)</pre><a href="http://11011.net/software/vspaste"></a>
<p>The SDK for the MWS is available online <a href="http://msdn2.microsoft.com/en-us/library/aa492550.aspx">here</a> and available for download <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=cb5148a9-f09e-4ec8-992f-16478c0b5d9a&DisplayLang=en">here</a>. If you are using Java or PHP you may want to have a look at the <a href="http://go.mappoint.net/mappointmpac/">MapPoint Multi-Platform Assistance</a>. Centre.
<p>
<div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px">Technorati Tags: <a href="http://technorati.com/tags/Virtual Earth" rel=tag>Virtual Earth</a>,<a href="http://technorati.com/tags/MapPoint Web Service" rel=tag>MapPoint Web Service</a></div><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=4819404664324524694&page=RSS%3a+Integrating+Virtual+Earth+and+MapPoint +Web+Service&referrer=" width="1px" height="1px" border="0" alt=""><img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&NA=1149&PI=73329&RF=&DI=3919&PS=85545&TP=johanneskebeck.spaces.live.com>1=JohannesKebeck">
Click here to view the article. (http://JohannesKebeck.spaces.live.com/Blog/cns!42E1F70205EC8A96!3765.entry)