This is a migrated thread and some comments may be shown as answers.

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

1 Answer 181 Views
Map
This is a migrated thread and some comments may be shown as answers.
Glen
Top achievements
Rank 1
Glen asked on 20 Nov 2014, 05:34 PM
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)

1 Answer, 1 is accepted

Sort by
0
Glen
Top achievements
Rank 1
answered on 21 Nov 2014, 10:05 AM
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
Tags
Map
Asked by
Glen
Top achievements
Rank 1
Answers by
Glen
Top achievements
Rank 1
Share this question
or