示例#1
0
 public void Initialize()
 {
     if (_layerProperty.sourceType != ImagerySourceType.Custom && _layerProperty.sourceType != ImagerySourceType.None)
     {
         _layerProperty.sourceOptions.layerSource = MapboxDefaultImagery.GetParameters(_layerProperty.sourceType);
     }
     _imageFactory = ScriptableObject.CreateInstance <MapImageFactory>();
     _imageFactory.SetOptions(_layerProperty);
 }
示例#2
0
 public void SetLayerSource(ImagerySourceType imageSource)
 {
     if (imageSource != ImagerySourceType.Custom && imageSource != ImagerySourceType.None)
     {
         _layerProperty.sourceType = imageSource;
         _layerProperty.sourceOptions.layerSource = MapboxDefaultImagery.GetParameters(imageSource);
     }
     else
     {
         Debug.LogWarning("Invalid style - trying to set " + imageSource.ToString() + " as default style!");
     }
 }
示例#3
0
 public void Initialize()
 {
     if (_layerProperty.sourceType != ImagerySourceType.Custom && _layerProperty.sourceType != ImagerySourceType.None)
     {
         _layerProperty.sourceOptions.layerSource = MapboxDefaultImagery.GetParameters(_layerProperty.sourceType);
     }
     _imageFactory = ScriptableObject.CreateInstance <MapImageFactory>();
     _imageFactory.SetOptions(_layerProperty);
     _layerProperty.PropertyHasChanged += RedrawLayer;
     _layerProperty.rasterOptions.PropertyHasChanged += (property, e) =>
     {
         NotifyUpdateLayer(_imageFactory, property as MapboxDataProperty, false);
     };
 }
示例#4
0
        /// <summary>
        /// Change image layer settings.
        /// </summary>
        /// <param name="imageSource">Data source for the image provider.</param>
        /// <param name="useRetina">Enable/Disable high quality imagery.</param>
        /// <param name="useCompression">Enable/Disable Unity3d Texture2d image compression.</param>
        /// <param name="useMipMap">Enable/Disable Unity3d Texture2d image mipmapping.</param>
        public virtual void SetProperties(ImagerySourceType imageSource, bool useRetina, bool useCompression, bool useMipMap)
        {
            if (imageSource != ImagerySourceType.Custom && imageSource != ImagerySourceType.None)
            {
                _layerProperty.sourceType = imageSource;
                _layerProperty.sourceOptions.layerSource = MapboxDefaultImagery.GetParameters(imageSource);
                _layerProperty.HasChanged = true;
            }

            if (_layerProperty.rasterOptions.useRetina != useRetina ||
                _layerProperty.rasterOptions.useCompression != useCompression ||
                _layerProperty.rasterOptions.useMipMap != useMipMap)
            {
                _layerProperty.rasterOptions.useRetina      = useRetina;
                _layerProperty.rasterOptions.useCompression = useCompression;
                _layerProperty.rasterOptions.useMipMap      = useMipMap;
                _layerProperty.rasterOptions.HasChanged     = true;
            }
        }