public void UpdateTileForProperty(AbstractTileFactory factory, LayerUpdateArgs updateArgs)
 {
     foreach (KeyValuePair <UnwrappedTileId, UnityTile> tileBundle in _activeTiles)
     {
         factory.UpdateTileProperty(tileBundle.Value, updateArgs);
     }
 }
예제 #2
0
 public void UpdateTileForProperty(AbstractTileFactory factory, LayerUpdateArgs updateArgs)
 {
     foreach (var tileBundle in _activeTiles)
     {
         factory.UpdateTileProperty(tileBundle.Value, updateArgs);
     }
 }
예제 #3
0
 protected virtual void NotifyUpdateLayer(LayerUpdateArgs layerUpdateArgs)
 {
     System.EventHandler handler = UpdateLayer;
     if (handler != null)
     {
         handler(this, layerUpdateArgs);
     }
 }
 protected virtual void NotifyUpdateLayer(AbstractTileFactory factory, bool effectsVectorLayer = false)
 {
     System.EventHandler handler = UpdateLayer;
     if (handler != null)
     {
         LayerUpdateArgs layerUpdateArgs = new LayerUpdateArgs()
         {
             factory            = factory,
             effectsVectorLayer = effectsVectorLayer
         };
         handler(this, layerUpdateArgs);
     }
 }
예제 #5
0
        private void OnImageOrTerrainUpdateLayer(object sender, System.EventArgs eventArgs)
        {
            LayerUpdateArgs layerUpdateArgs = eventArgs as LayerUpdateArgs;

            if (layerUpdateArgs != null)
            {
                _mapVisualizer.UpdateTileForProperty(layerUpdateArgs.factory, layerUpdateArgs);
                if (layerUpdateArgs.effectsVectorLayer)
                {
                    RedrawVectorDataLayer();
                }
                OnMapRedrawn();
            }
        }
예제 #6
0
 protected virtual void NotifyUpdateLayer(AbstractTileFactory factory, MapboxDataProperty prop, bool effectsVectorLayer = false)
 {
     System.EventHandler handler = UpdateLayer;
     if (handler != null)
     {
         LayerUpdateArgs layerUpdateArgs =
             (factory is VectorTileFactory) ?
             new VectorLayerUpdateArgs
         {
             factory            = factory,
             effectsVectorLayer = effectsVectorLayer,
             property           = prop
         }
             :
         new LayerUpdateArgs
         {
             factory            = factory,
             effectsVectorLayer = effectsVectorLayer,
             property           = prop
         };
         handler(this, layerUpdateArgs);
     }
 }
        /// <summary>
        /// Initializes the map using the mapOptions.
        /// </summary>
        /// <param name="options">Options.</param>
        protected virtual void InitializeMap(MapOptions options)
        {
            Options                  = options;
            _worldHeightFixed        = false;
            _fileSource              = MapboxAccess.Instance;
            _centerLatitudeLongitude = Conversions.StringToLatLon(options.locationOptions.latitudeLongitude);
            _initialZoom             = (int)options.locationOptions.zoom;

            options.scalingOptions.scalingStrategy.SetUpScaling(this);

            options.placementOptions.placementStrategy.SetUpPlacement(this);

            _imagery.UpdateLayer += (object sender, System.EventArgs eventArgs) =>
            {
                LayerUpdateArgs layerUpdateArgs = eventArgs as LayerUpdateArgs;
                if (layerUpdateArgs != null)
                {
                    Debug.Log("<color=red>Image</color>");
                    _mapVisualizer.ReregisterTilesTo(layerUpdateArgs.factory);
                    if (layerUpdateArgs.effectsVectorLayer)
                    {
                        _mapVisualizer.UnregisterTilesFrom(VectorData.Factory);
                        VectorData.UpdateFactorySettings();
                        _mapVisualizer.ReregisterTilesTo(VectorData.Factory);
                    }
                    OnMapRedrawn();
                }
            };

            _terrain.UpdateLayer += (object sender, System.EventArgs eventArgs) =>
            {
                LayerUpdateArgs layerUpdateArgs = eventArgs as LayerUpdateArgs;
                if (layerUpdateArgs != null)
                {
                    Debug.Log("<color=green>Terrain</color>");
                    _mapVisualizer.ReregisterTilesTo(layerUpdateArgs.factory);
                    if (layerUpdateArgs.effectsVectorLayer)
                    {
                        _mapVisualizer.UnregisterTilesFrom(VectorData.Factory);
                        VectorData.UpdateFactorySettings();
                        _mapVisualizer.ReregisterTilesTo(VectorData.Factory);
                    }
                    OnMapRedrawn();
                }
            };

            _vectorData.UpdateLayer += (object sender, System.EventArgs eventArgs) =>
            {
                LayerUpdateArgs layerUpdateArgs = eventArgs as LayerUpdateArgs;
                if (layerUpdateArgs != null)
                {
                    Debug.Log("_vectorData.UpdateLayer");
                    _mapVisualizer.UnregisterTilesFrom(layerUpdateArgs.factory);
                    VectorData.UpdateFactorySettings();
                    _mapVisualizer.ReregisterTilesTo(VectorData.Factory);
                    OnMapRedrawn();
                }
            };

            _mapVisualizer.Initialize(this, _fileSource);
            _tileProvider.Initialize(this);

            SendInitialized();

            _tileProvider.UpdateTileExtent();
        }