Share via


Get a Map

The Get a Map sample is a Pocket PC application that shows how to locate your own position using MapPoint Location Server Web Service and then render a map centered on that position.

Running the Sample in Visual Studio .NET 2003

Note    You must install Microsoft® Visual Studio® .NET 2003, the Microsoft .NET Compact Framework version 1.0 with Service Pack 2 (SP2), and have a Pocket PC or a Pocket PC emulator to run this sample.

To run the sample

  1. In Visual Studio .NET, on the File menu, point to New, and then click Project.

  2. In the left pane of the New Project dialog box, click Visual Basic Projects or Visual C# Projects, and then click the Smart Device Application template.

  3. In Name, change SmartDeviceApplication1 to GetMap, and then click OK.

  4. In the Smart Device Application Wizard dialog box, make sure the following settings are selected:

  5. Platform is set to Pocket PC

  6. Project type is set to Windows Application

  7. On the Project menu, click Add Existing Item.

  8. Navigate to the appropriate project subfolder in the GetMap folder, select All Files in the Files of type box, and then select all the available files.

    • The default location for Visual Basic .NET project files is:
      Program Files\Microsoft MapPoint Location Server SDK, Version 1.0\Samples\Pocket PC Samples\GetMap\vb.
    • The default location for Visual C# .NET project files is:
      Program Files\Microsoft MapPoint Location Server SDK, Version 1.0\Samples\Pocket PC Samples\GetMap\cs.

    Note  When prompted, replace any existing files.

  9. Delete the default windows form, Form1, from the project.

  10. On the Project menu, click Add Web Reference.

  11. In Address, type the URL for the MapPoint Location Server Web Service WSDL (similar to https://your-domain/your-path/LocationServer.wsdl), and then press ENTER.

  12. When the WSDL appears, click Add Reference.

  13. In Solution Explorer, right-click the Web reference, and then click Rename.

  14. Rename the Web reference to MapPointLocationServer.

  15. Right-click the GetMap.cs or the  GetMap.vb file, and then click View Code.

  16. Search for and replace the following items with your personal information:

  17. Search for user-name and replace it with your alias.

  18. Search for user-password and replace it with your domain password.

  19. Search for user-domain and replace it with your domain name.

  20. On the Debug menu, click Start.

  21. When the application is deployed and loaded onto your Pocket PC or Pocket PC emulator, click Map My Position!.

See Also

Sample Code