Share via


Click to Center Map Sample

Click to Center Map Sample

This sample Windows application uses the RenderServiceSoap.ConvertToLatLong method to recenter 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 or region for the area on the map where the user clicked.

Run this sample in Visual Studio .NET

  1. Double-click the project file to open the project in Microsoft® Visual Studio® .NET.

    Visual Basic .NET project location:

    SDK_Install_Folder\Samples\[.NET 1.1 | .NET 2.0]\ClickToCenterMap\vb\ClickToCenterMapVB.vbproj

    Visual C# .NET project location:

    SDK_Install_Folder\Samples\[.NET 1.1 | .NET 2.0]\ClickToCenterMap\cs\ClickToCenterMapCS.csproj

  2. In the Solution Explorer window, double-click app.config to open the file.

  3. Replace the values of the MPUser and MPPass keys with your customer ID and password.

  4. In the Solution Explorer window, expand the Web References folder, right-click MapPointService, and then click Update Web Reference.

  5. On the Debug menu, click Start.