Topic: Accuracy help needed
Hi,
I have an iOS app which displays users position at the center (I assume) of a tileset prefab. (BTW I recently upgraded from v2 to latest of v3)
I subscribe to location changed events, and when an event occurs I add a 3D marker at the position. Theoretically as the accuracy improves and location events occur, the last marker should be at the center of the tileset. Again, this is assuming the users position is always at the center of the map. However the last marker added is not in the exact center, and I wanted to log the distance between the location change event position and (0,0). Here's my code:
private void HandleLocationChangedEvent(Vector2 position)
{
// Calculate the distance in km between locations.
_distance = OnlineMapsUtils.DistanceBetweenPoints(position, Vector2.zero).magnitude;
// Get instance of OnlineMapsControlBase3D (Texture or Tileset)
OnlineMapsControlBase3D control = OnlineMapsControlBase3D.instance;
if (control == null)
return;
//Create a marker to show the current GPS coordinates.
var marker = OnlineMapsMarker3DManager.CreateItem(position, _userLocPrefab);
Controller.HandleLocationChanged(position);
}
Do you see anything wrong with this? How would I calc the distance in meters?
EDIT: FYI, the location service control has "update map position" checked.