Support Topics Documentation Slack YouTube Blog

Getting Metadata of a Geo-Point without BackendlessGeoQuery, through User Property


(Pujan Paudel) #1

I have related a GeoPoint with every User Object on my Project. I read in the docs that geoPoint’s metadata can be retrieved through a BackendlessGeoQuery by the property includeMetadata. But ,I am loading a Backendless User Property and getting the location property by accesing the user property rather than a need for extra BackendlessGeoQuery.I succesfully download the location data Any Ideas on how can I access my metadata from the user property


(Mark Piller) #2

Hi Pujan,

In Java you can do this:
Backendless.Geo.loadMetadata( geoPoint )

In iOS:
backendless.geoService loadMetadata:geoPoint

Regards,
Mark


(Pujan Paudel) #3

Hello Mark ,
That’s cool . But , It does cost me an extra Network Request while fetching the Meta-data part of the geopoint, doesn’t it ? I would like to know if there’re any ways in which the Meta-Data Could be loaded automatically without a 2 step retrieval process. (Something like Autoload on Relations ) .
Regards,
Pujan


(Mark Piller) #4

Hi Pujan,

Currently metadata can be loaded using only BackendlessGeoQuery, which means you need to query the geolocation store directly, which also means you’d need to make an additional call. An alternative to that approach would be to create a custom service which does all the queries on the server-side and returns the data to the mobile client in a single call.

Regards,
Mark


(Kadik) #5

I have trouble with updating user’s geolocation. I used this tutorial but i didn’t work.
https://backendless.com/documentation/users/ios/users_relations_with_geo_points.htm
Please help me Mark !!!


(Mark Piller) #6

We can help if you provide specific information about the error you’re getting or a description of something not working as documented.


(Kadik) #7

i used this codes:
/*
BackendlessUser *user = [[backendless.persistenceService of:BackendlessUser.class] findFirst];
GeoPoint *geoPoint = [GeoPoint geoPoint:(GEO_POINT){.latitude=48.85, .longitude=2.35}];
[user setProperty:@“location” object:geoPoint];
[[backendless.persistenceService of:BackendlessUser.class] save:user];
NSLog(@“SYNC: User has been saved: %@”, user);
*/
to update user’s geolocation, i also added a new property for Users table called location, which is a geo location type but the code above didn’t work, nothing happened!!


(Vyacheslav Vdovichenko) #8

Try:

user = [[backendless.persistenceService of:BackendlessUser.class] save:user];
NSLog(@“SYNC: User has been saved: %@”, user);