MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Show lat lon point from text message

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint Web Service and Virtual Earth

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-06-2006
Junior Member
White Belt
 
Join Date: Dec 2006
Posts: 1
Show lat lon point from text message

I am totally new to Map Point. I am looking for high level, step-by-step guidence for setting up a service whereby a lat lon coordinate can be text messaged to a DB ( or directly to Map Point ) and then allow a user so access Map Point via a web browser and see the lat lon coordinate ( as a pushpin I assume ).

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 12-08-2006
Junior Member
Yellow Belt
 
Join Date: Sep 2002
Posts: 20
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/show-lat-lon-point-text-message-5443.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 12:59 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51