Start a new topic
Solved

GeoLocations appear too close to my location

Hello!


First time posting an issue here so please let me know if there's anything I can do to make it better.


Essentially, I've been working to modify the POI example to use some custom data relevant to our app. I've created a bunch of markers with their latitudes and longitudes. The main problem I've come across is that while (most of) the directions of the GeoLocation object is correct, the markers are all really crowded around my location and not indicative of their location in space.


I've even gone through and used the markerLocation.distanceToUser() function and I'm getting values between 500-2000 (assuming this is meters?). To me, this should be displayed as relatively much further away than I'm seeing, but this may just be a limitation of the plugin.


Here's the only real custom code I've changed (perks is an object I've created with some test data):

		for (var currentPlaceNr = 0; currentPlaceNr < perks.length; currentPlaceNr++) {
			var singlePoi = {
				"id": perks[currentPlaceNr].id,
				"latitude": parseFloat(perks[currentPlaceNr]["locations"][0].latitude),
				"longitude": parseFloat(perks[currentPlaceNr]["locations"][0].longitude),
				"altitude": 100.0,
				"title": perks[currentPlaceNr].name,
				"description": perks[currentPlaceNr].description
			};

			/*
				To be able to deselect a marker while the user taps on the empty screen, 
				the World object holds an array that contains each marker.
			*/
			World.markerList.push(new Marker(singlePoi));
		}

 Here's a photo example of what I'm talking about. These markers should be around 100-500 meters away from me, but I feel like I could reach out and touch them all with my hand. I want the feel of my app to be exploring a city, so it's important that the relative distance feels far away if the marker is a few blocks away.


image


Thanks in advance!

Evan



Hello Evan,

Since you are using GeoLocation services let me briefly informed you about GeoLocation and RelativeLocation functions. When working with Geo locations you can choose either RelativeLocation (and this is what we implement in our samples) or GeoLocation. The concept of RelativeLocation is that they are always relative to the current user location and this is why we prefer these when we need to test. GeoLocations are fixed to a certain latitude/longitude coordinate and stay at exact this place. In order to make sure that you have specified the correct coordinates when working with GeoLocations you can also advice these websites to Convert Lat and Long to Address and to Get Latitude and Longitude.

Regarding the second problem you are having with overlapping POIs, this is because you set the position of the POIs too close to each other. In general, the number of POIs that you can display is around 50 POIs in order to still have a good user experience. If you have more then you can combine POIs that are near each other. Details can be found here.

Thanks

Eva

Hey Eva,


Thanks for your response!


I understand the difference between RelativeLocation and GeoLocation. I intentionally chose GeoLocation because I want the markers to be placed based on latitude and longitude, even if they're not close to the user. I also went through and verified the correct coordinates on a map before passing them to the plugin. Regardless, it still feels like the GeoLocation markers are too far away and sometimes even in the wrong direction.


I also definitely have less than 50 POIs and while some of them are close, others are quite far away from each other. Do the markers not scale to appear smaller when the physical location is farther from the user's location?


Thanks!

Evan

Hello Evan,

The expected behavior is that markers will scale if the location of the user is updated. Did you make sure that you have implemented a AR.context.onLocationChanged callback to receive the location of the user (details here)?  

In addition, GeoLocation features heavily depend on parameters like the accuracy of your GPS provider. So please:
  • Make sure you are testing with our latest SDK version, which is 6.1
  • Make sure that your GPS provider is accurate enough and also make sure to calibrate your phone before start testing. Note that the distance calculation highly depends on the accuracy of your LocationProvider implementation. I recommend using GooglePlay Location Service to not rely on a manual GPS fetching approach.
  • Test outside
Let me know if this improves your performance.

Thanks
Eva
Login or Signup to post a comment