Sample Code
The MapPoint Web Service SDK includes several samples that demonstrate how to use MapPoint Web Service features in applications. The samples are installed as Microsoft® Visual Studio® .NET solution files, and are available in Visual Basic .NET and Microsoft® Visual C#™ languages.
You must have Visual Studio .NET installed on your computer to run these applications. Otherwise, you can view the source files in Notepad or any text editor.
In This Section
- Client-Side Point to Latitude/Longitude Conversion Sample
This sample shows how to convert a point to latitude/longitude on client-side (without calling the MapPoint Web Service). - Core Functionality Sample
This is a set of samples that shows how to use the basic MapPoint Web Service functionality: find a place, find an address, find nearby locations, get a map, and route between locations. This sample has been updated to find entities by using the new FindServiceSoap.FindByID and FindServiceSoap.FindByProperty methods. These samples are ASP.NET Web applications. - Click to Center Map Sample
This sample Windows application uses the RenderServiceSoap.ConvertToLatLong method to re-center a map image based on the pixel coordinate where the end-user clicks. The latitude and longitude coordinates of the map, as well as the pixel coordinate of the image are displayed below the map. Additionally, the FindServiceSoap.GetLocationInfo method is used to identify the county for the area on the map where the user clicked. - Drag Pushpin on Map Sample
This sample Windows application allows the end-user to place and relocate pushpins by dragging them and dropping them onto a map. The sample application uses the RenderServiceSoap.ConvertToLatLong method to get the location and FindServiceSoap.GetLocationInfo method to get address information for the pushpin. This information is displayed in a grid next to the map. - Image Map Sample
In this ASPX Web application, the user can click a pushpin on the map and relevant information about the pushpin is displayed on the Web page. - Inset Overview Map Sample
This ASPX Web application displays a small overview map of the current map view. The sample makes use of the FindServiceSoap.GetLocationInfo method to find out which entities the current location is a part of. From this list of entities, an overview entity is chosen and a map of the entity is displayed. - Mobile Application Sample
This Mobile Web application requires the Microsoft Mobile Internet Toolkit to run. This sample asks the end-user for an address and then displays a list of nearby coffee stores (using the sample customer data source MapPoint.FourthCoffeeSample). When the end-user selects a store location, a map and directions to the store are displayed. - Pan Map Navigation Control Sample
In this ASPX Web application, the end-user can pan the map by dragging it to a new location. Once the mouse button is released, the RenderServiceSoap.ConvertToLatLong method is used to find the new center LatLong object. This sample also demonstrates use of the zoom feature. - Store Locator Sample
This is a complete sample store locator ASPX Web application. This sample application asks the end-user for an address and then displays a list of nearby coffee stores (using the sample customer data source MapPoint.FourthCoffeeSample). When the end-user selects a store location, a map and directions to the store are displayed. - Turn-by-Turn Route Maps Sample
In this ASPX Web application, the end-user enters two place strings, which are sent to MapPoint Web Service to return possible matches. Then the sample routes between the two points and displays a list of directions and each corresponding map view.