Community of VE/MapPoint Users and Developers
This is a discussion on Show lat lon point from text message within the MapPoint Web Service and Virtual Earth forums, part of the Map Forums category; I am totally new to Map Point. I am looking for high level, step-by-step guidence for setting up a service ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Show lat lon point from text message I am looking for a quick solution initially so that I can demo the capability. Then I will do more exhaustive research and build a robust solution using SQL Server 2005 as the lat lon repository. My background is a SQL Server DBA with some old C programming experience. I haven't gotten into .Net much yet. So, the less programming, the better, initially. Thank you. |
| |||
| Re: Show lat lon point from text message
Here is some sample code. This will not work in itself but it can be used a reference. Look at MapPoint SDK examples. They are fairly comprehensive. Public Sub ShowLocationFromGeoCode() 'Create a global object to initialize MapPoint .NET objects 'MapServerWS is the name space of out project. You will something different. Dim global As MapServerWS.Global = Context.ApplicationInstance 'Create the Location object for the start point Dim StartLocation As New Location Dim StartGeoCode As New LatLong StartGeoCode.Latitude = Request.QueryString("LAT") StartGeoCode.Longitude = Request.QueryString("LON") StartLocation.LatLong = StartGeoCode 'Set up the datasource to use Dim myDataSourceName As String Dim oUserInfo As New UserInfoRouteHeader 'You can get fancy when determiningthe data source. If your locations are in United States only then use MapPoint.NA 'If Request.QueryString("DS") Is Nothing Then 'myDataSourceName = GetDataSetFromCountry(Request.QueryString("COUNTRY")) ' Else 'myDataSourceName = GetDataSet(Request.QueryString("DS")) 'End If myDataSourceName = "MapPoint.NA" Try 'Now get the map Dim myPushPins(0) As Pushpin myPushPins(0) = New Pushpin myPushPins(0).PinID = "DISPLOC" If Request.QueryString("NAME") = "" Then myPushPins(0).Label = "Dispatch Location" Else myPushPins(0).Label = Request.QueryString("NAME") End If myPushPins(0).IconName = "72" myPushPins(0).IconDataSource = "MapPoint.Icons" myPushPins(0).LatLong = StartGeoCode 'Set up the map options Dim myMapOptions As New MapOptions myMapOptions.ReturnType = MapReturnType.ReturnUrl myMapOptions.Format = New ImageFormat myMapOptions.Format.Height = Me.MapImage.Height.Value myMapOptions.Format.Width = Me.MapImage.Height.Value 'Set up the specification object Dim myMapViews(0) As ViewByScale myMapViews(0) = New ViewByScale myMapViews(0).CenterPoint = StartGeoCode myMapViews(0).MapScale = 5000 Dim mapSpec As New MapSpecification mapSpec.Views = myMapViews mapSpec.Options = myMapOptions mapSpec.DataSourceName = myDataSourceName mapSpec.Pushpins = myPushPins 'Declare the map image array and get the map 'RenderServiceClass was initialized in Global.ASAX 'MapImage is app:Image control Dim myMapImages() As MapImage myMapImages = global.RenderServiceClass.GetMap(mapSpec) If myMapImages(0) Is Nothing Then Me.MapImage.Visible = False Exit Sub End If '*** Cache the map image and then render the map Cache(Session.SessionID & "_MapImage") = myMapImages(0) 'Set the MapImage url Me.MapImage.ImageUrl = myMapImages(0).Url Me.MapImage.Visible = True '*** Set the driving directions in driving directions text box Cache(Session.SessionID & "_PushPins") = myPushPins Catch myException As SoapException 'Catch any errors in the CalculateSimpleRoute request If myException.Message = cUnauthorized Then Response.Write("Invalid username or password specified for MS MapPoint Web Service. Please contact your web adminstrator.") ElseIf (myException.Detail("Type").InnerText = "MapPointUnroutableException") Then Response.Write("Dispatch location could not be displayed because roads data is not available.") Else ErrorProc(Response, myException.Message, myException.StackTrace) End If Response.End() Catch ex As Exception If ex.Message = cUnauthorized Then Response.Write("Invalid username or password specified for MS MapPoint Web Service. Please contact your web adminstrator.") Else ErrorProc(Response, ex.Message, ex.StackTrace) End If Response.End() End Try End Sub |
![]() |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 12-06-2006 09:15 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| hidden message | Anonymous | General Chat | 1 | 04-04-2005 06:53 AM |
| Show stops with address in text box | Anonymous | MapPoint 2006/2009 Discussion | 3 | 03-14-2005 01:00 PM |
| Server Busy Message fix in .Net | matnace | MapPoint 2006/2009 Discussion | 0 | 05-11-2004 11:48 AM |
| Show information of text balloons | Jasmino | MapPoint 2006/2009 Discussion | 2 | 03-26-2004 12:19 PM |
| Error message | Anonymous | MapPoint 2006/2009 Discussion | 0 | 03-16-2003 08:11 PM |
Ski Chalet Holidays
Considering ski chalet holidays? Why not find out what your options our using the simple ski holiday search online at Holiday Hypermarket. Why not check it out now?
Greece Holidays
Find great Greece Holidays with Travel Counsellors. A personal Travel Counsellor can help you plan the perfect holiday to Greece.
Holiday to Thailand
Want to go somewhere new? Book a low cost holiday to Thailand at dealchecker.co.uk. See the stunning national parks and uninhabited islands.
Sri Lanka Holidays
There are some outstanding deals on Sri Lanka holidays at theholidayplace.co.uk. Sri Lanka is renowned for it's exceptional beauty! Book a holiday today!
Holidays
For bargain holidays to destinations including Mexico, South Africa, India and more, visit ULookUBook online today. Check out our free travel guides to help you make an informed decision for your holidays.
Package Holidays
With the help of Travel.co.uk you can find the package holidays of your dreams.
Sharm Holidays
See beautiful Egyptian sites! Info on Sharm holidays, only at On The Beach.