Topic: Location Services not working

Another question, I'm trying to test the location services option by just having the map make a marker where I'm located and be centered around my location, and it's not working. Am I missing something? I have done the following,

-Added the online maps location services script and checked create marker. When the app is built my coordinates seem to be at 0,0

-Made my own script with a reference to the online maps script and the online maps location services script, and used the SetLocation() method with whatever current lat long positions the online maps locations services script finds, When the app is built my coordinates seem to be at 0,0


How can I make this work please? I'm trying to make a navigation application.

Re: Location Services not working

Hello.

When you use Location Service in Unity Editor, you can enable GPS Emulator, to test it.
OnlineMapsLocationService.position not available in Start, because GPS is not already initialized.
Use OnlineMapsLocationService.OnLocationChanged or OnlineMapsLocationService.OnLocationInited (OnlineMaps v2.4.0.17+) to determine the GPS initialization.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Location Services not working

Hmm, that makes a lot of sense actually, let me try it and get back to you

Re: Location Services not working

It's still now working, am I doing it wrong? In my update() method I have    
   
                locService.OnLocationChanged(pos);
        lng = pos.x;
        lat = pos.y;
        mapsControl.SetPosition (lng, lat);

I tried using OnlineMapsLocationService.OnLocationInited but I have no idea how. Please help

Re: Location Services not working

private void Start ()
{
    OnlineMapsLocationService.instance.OnLocationChanged += OnLocationChanged;
}

private void OnLocationChanged(Vector2 pos)
{
    OnlineMaps.instance.SetPosition(pos.x, pos.y);
}
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Location Services not working

Thanks! That worked great! Is there anyway to check if it's being initialized and when it's over, I'm having some time when the app starts off of just the map before it finds my position, I'd love to let the user know they're waiting for the initialization while that's happening.

Re: Location Services not working

Make some field that will store GPS status. Default - not initialized. In OnLocationChanged you change it to initialized.
Or, when starting you show that GPS is not initialized. In OnLocationChanged you hide it.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Location Services not working

I will try it out! I'm def giving you five stars on the asset store. Your product and support are unbelievably awesome!