30.Add the following btnGetMap_Clickevent procedure to the form. This procedure runs whenthe user clicks on the Get Map button to use the MapPoint API to retrieve a map for the con- tact s city and state/region. Replace YOURUSERIDand YOURPASSWORDfollowing in the twospecified places with your MapPoint API account trial version credentials or purchased licensecredentials. Private Sub btnGetMap_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles btnGetMap.ClickOn Error GoTo handleerror Purpose: Retrieve a map for a given address NOTE: Make sure to include imports statement for MapPoint Web service for abbreviated declarations below to work Specify the credentials for the find service Use the customer id and password you were providedDim findService As New FindServiceSoapfindService.Credentials = New _ System.Net.NetworkCredential( YOUR USER ID , YOUR PASSWORD ) findService.PreAuthenticate = True Get a map of a specified addressDim findSpec As New FindSpecification specify the data source – change as desired – North America belowfindSpec.DataSourceName = MapPoint.NA retrieve the City and State/Region of the current companyfindSpec.InputPlace = txtCity.Text & , & txtRegion.TextDim foundResults As FindResultsfoundResults = findService.Find(findSpec) Dim Views(0) As ViewByHeightWidthViews(0) = foundResults.Results(0).FoundLocation.BestMapView.ByHeightWidth Specify the credentials for the render service Use the customer id and password you were providedDim renderService As New RenderServiceSoaprenderService.Credentials = New _ System.Net.NetworkCredential( YOUR USER ID , YOUR PASSWORD ) renderService.PreAuthenticate = TrueDim mapSpec As New MapSpecificationmapSpec.DataSourceName = MapPoint.NA mapSpec.Views = Views get the map from MapPointDim mapImages() As MapImagemapImages = renderService.GetMap(mapSpec) read the map into a stream for display255Case
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Mac Web Hosting services