Topic: Lock Position and Zoom

Not sure this is a bug but seems so. When using the Lock Position and zoom features if you do not have the map object selected in the Hierarchy it zooms all the way out and doesn't reflect the correct positioning when you hit play until you click on the map object and then it updates to what it is suppose to be when using in the editor.

Re: Lock Position and Zoom

Hello

I just checked the work of this example.
Everything works well, even if Map GameObject is not selected.

Kind Regards,
Infinity Code Team.

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

Re: Lock Position and Zoom

Odd what version of Unity are you running? I am running two machines both on 5.4.1 and both do the same thing.

Re: Lock Position and Zoom

I think I understand what the problem is.
Try it:

/*     INFINITY CODE 2013-2016      */
/*   http://www.infinity-code.com   */

using UnityEngine;

namespace InfinityCode.OnlineMapsExamples
{
    /// <summary>
    /// Example of how to limit the position and zoom the map.
    /// </summary>
    [AddComponentMenu("Infinity Code/Online Maps/Examples (API Usage)/LockPositionAndZoomExample")]
    public class LockPositionAndZoomExample : MonoBehaviour
    {
        private void Start()
        {
            // Lock map zoom range
            OnlineMaps.instance.zoomRange = new OnlineMapsRange(10, 15);

            // Lock map coordinates range
            OnlineMaps.instance.positionRange = new OnlineMapsPositionRange(33, -119, 34, -118);

            // Initializes the position and zoom
            OnlineMaps.instance.zoom = 10;
            OnlineMaps.instance.position = OnlineMaps.instance.positionRange.center;
        }
    }
}
Kind Regards,
Infinity Code Team.

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

Re: Lock Position and Zoom

That worked. Although I only needed the (OnlineMaps.instance.zoom = 10;) line since I want the map to start out at a specific long and lat and not the center. Thanks!

Not that it wasn't difficult to just click on the Map object. Just wanted to see if it was a bug or just me smile