BackendlessGeoQuery geoQuery = new BackendlessGeoQuery();
geoQuery.Latitude = 37.9811;
geoQuery.Longitude = 23.6363;
geoQuery.Radius = 1;
geoQuery.Units = BackendlessAPI.Geo.Units.KILOMETERS;
Backendless.Geo.GetPoints(geoQuery, getPointscallback);
Furthermore, i connect each geopoint with metadata being the name of the person in this location. How can i take
metadata of each geopoint and show it on screen?
(what i am trying to do in my application is to search in radius for nearby users within 1km and get their name on my screen)
I think that extracting the metadata is the wrong way. In my app the users log in and each user save its GeoPoint when clicking the button (with this method BackendlessAPI.Backendless.Geo.SavePoint(geoPoint, callback); ). Then i want for every user to search for nearby users within 1km radius and see their names. How can i associate a geopoint with a user?? I use older sdk beacuse there is a problem referencing the newest ( i have made a topic for this) , so i cannot user SetRelation method to do it.
You can establish user-to-geo relation. Navigate to users schema and add a new column > select a datatype “geopoint relationship”. Here is the manual for managing data-to-geo relations in Backendless 3. This one for Backendless 4
Hi Anton! I do include metadata using geoQuery.IncludeMeta = true; . But i cannot find getMetada() method even though i tried some paths. I am using Backendless sdk version 1.0 . I cannot add 4.0 reference and i have made a topic for this. Where is method getMetadata() located in sdk i cannot find that either, i searched here https://github.com/Backendless/.NET-SDK/tree/master/Backendless
I have a column location type of geopoint relationship but i cannot set tha property with this line
currentUser.SetProperty(“location”, geoPoint);
AddRelation method does not exist in backendles sdk 1.0
Furthermore,
BackendlessUser currentUser = Backendless.UserService.CurrentUser;
//get current logged in user
GeoPoint geoPoint = new GeoPoint(latitude, longitude);
var name = currentUser.GetProperty(“firstname”).ToString();
geoPoint.Metadata.Add(name, currentUser);
Backendless.Geo.AddPoint(geoPoint);
geoPoint.Metadata is a Dictionary<string, object> where object value is a string.
I cannot get the string value probably because it’s an object. Here is my code:
AsyncCallback<BackendlessCollection<GeoPoint>> getPointscallback = new AsyncCallback<BackendlessCollection<GeoPoint>>
(
result =>
{
foreach (var item in result.GetCurrentPage())
{ //Dispatcher.BeginInvoke(() => ProblemBlock.Text = item.Metadata.ToString());
System.Diagnostics.Debug.WriteLine(item.Metadata.Values.ToString());
}
}
I get this System.Collections.Generic.Dictionary`2+ValueCollection[System.String,System.Object] and not the actual value which is a string name for example george. How can i solve this??