Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

Show lat lon point from text message

This is a discussion on Show lat lon point from text message within the Bing Maps and MapPoint Web Service 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 ...

  1. #1
    southernpost is offline 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.

  2. #2
    shaistasohail is offline 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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. hidden message
    By Anonymous in forum General Chat
    Replies: 1
    Last Post: 04-04-2005, 07:53 AM
  2. Show stops with address in text box
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 03-14-2005, 02:00 PM
  3. Server Busy Message fix in .Net
    By matnace in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 05-11-2004, 12:48 PM
  4. Show information of text balloons
    By Jasmino in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-26-2004, 01:19 PM
  5. Error message
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-16-2003, 09:11 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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