Пример #1
0
    public void Scale(bool Enlarge)
    {
        if (map == null)
        {
            findMap();
        }
        if (Handler == null)
        {
            findHandler();
        }
        int   currScale   = Handler.CurrScale;
        float scaleAmount = Handler.scaleAmount;
        var   t           = new RangeTileProviderOptions();

        if (Enlarge)
        {
            currScale = (int)Mathf.Min(100, Mathf.Max(1, currScale + scaleAmount));
        }
        else
        {
            currScale = (int)Mathf.Min(100, Mathf.Max(1, currScale - scaleAmount));
        }
        Handler.GetComponent <vars>().CurrScale = currScale;
        t.SetOptions(currScale, currScale, currScale, currScale);
        map.SetExtentOptions(t);
        map.UpdateMap();
    }
Пример #2
0
    public void changeMapSize()
    {
        Debug.Log(MapSizeSlider.value);
        Map.Options.locationOptions.latitudeLongitude = PlayerPrefs.GetString("MapCenter");
        RangeTileProviderOptions options = Map.Options.extentOptions.GetTileProviderOptions() as RangeTileProviderOptions;

        options.west = options.south = options.north = options.east = (int)MapSizeSlider.value;
        PlayerPrefs.SetInt("MapSize", (int)MapSizeSlider.value);
        Map.UpdateMap();
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        string mapLayer = PlayerPrefs.GetString("MapDefaultLayer");

        useSatelliteMap = (mapLayer == "mapbox.satellite");
        Map.ImageLayer.SetLayerSource(mapLayer);

        Map.Options.locationOptions.latitudeLongitude = PlayerPrefs.GetString("MapCenter");
        RangeTileProviderOptions options = Map.Options.extentOptions.GetTileProviderOptions() as RangeTileProviderOptions;

        options.west = options.south = options.north = options.east = PlayerPrefs.GetInt("MapSize");
        Invoke("AddMeshCollider", 1);
    }
Пример #4
0
        public override void OnInitialized()
        {
            if (Options != null)
            {
                _rangeTileProviderOptions = (RangeTileProviderOptions)Options;
            }
            else
            {
                _rangeTileProviderOptions = new RangeTileProviderOptions();
            }

            _initialized = true;
            _currentExtent.activeTiles = new HashSet <UnwrappedTileId>();
        }
Пример #5
0
        //private List<UnwrappedTileId> _toRemove;
        //private HashSet<UnwrappedTileId> _tilesToRequest;

        public override void OnInitialized()
        {
            if (Options != null)
            {
                _rangeTileProviderOptions = (RangeTileProviderOptions)Options;
            }
            else
            {
                _rangeTileProviderOptions = new RangeTileProviderOptions();
            }

            _initialized = true;
            //_toRemove = new List<UnwrappedTileId>((_rangeTileProviderOptions.east + _rangeTileProviderOptions.west) * (_rangeTileProviderOptions.north + _rangeTileProviderOptions.south));
            _currentExtent.activeTiles = new HashSet <UnwrappedTileId>();
        }
Пример #6
0
    public void Scale(int scaleAmount)
    {
        if (map == null)
        {
            findMap();
        }
        if (Handler == null)
        {
            findHandler();
        }
        var t = new RangeTileProviderOptions();

        t.SetOptions(scaleAmount, scaleAmount, scaleAmount, scaleAmount);
        map.SetExtentOptions(t);
        Handler.GetComponent <vars>().CurrScale = scaleAmount;
    }