JSON Location field - how to serialize from Lat/Long fields in SQL Tables ?

2 posts, 0 answers
  1. Glen
    Glen avatar
    11 posts
    Member since:
    Oct 2010

    Posted 20 Nov 2014 Link to this post

    New to JSON and struggling to convert a SQL table whereby Latitude and Longitude are stored in separate float fields.  The requirement of RadMap to receive a single field (say Location as per examples) seems to be an Array.  Any examples whereby these two distinct fields can be converted on the fly and JSON'd to the RadMap control as a single field ?  (Note: I am choosing not to bind to the Latitude/Longitude via server binding method, I wish to use the RadClientDataSource consuming JSON)
  2. Glen
    Glen avatar
    11 posts
    Member since:
    Oct 2010

    Posted 21 Nov 2014 Link to this post

    Solved it. Using SQL to LINQ and added a Partial Class, LINQ with JavaScriptSerializer takes care of the rest.  Would be useful for future update if the RadMap MapLayer took properties of Latitude & Longitude Fields

    Partial Public Class GetCustomers
        Private _Location As New List(Of Decimal)
        Public Property Location() As List(Of Decimal)
            Get
                    _Location.Add(_Latitude)
                    _Location.Add(_Longitude)
                    Return _Location
            End Get
            Set(value As List(Of Decimal))
     
            End Set
        End Property
     
    End Class
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top