public void Refresh() { GlobeLayerInfo[] globeLayers = globe.layers; for (int i = 0; i < layers.Length; i++) { GlobeLayerInfo globeLayer = globeLayers[i]; GlobeTileLayerInfo myLayer = layers[i]; if (myLayer.name != globeLayer.name || myLayer.date != globeLayer.date || manualRefreshRequested) { layers[i].name = globeLayer.name; layers[i].date = globeLayer.date; if (string.IsNullOrEmpty(globeLayer.name)) { ClearTexture(i); } else { if (globeLayer.wmsLayer != null) { layers[i].status = LoadStatus.InProgress; RequestTexture(globeLayer.wmsLayer, layers[i].date, LoadTexture, i); } } } } manualRefreshRequested = false; globe.refreshesThisFrame++; }
public override void ClearLayers() { for (int i = 0; i < MaxLayers; i++) { // Reset layer layers[i] = new GlobeLayerInfo(); } LoadLayer(initialLayer, initialDateTime); }
private void Awake() { cullingCamera = FindVrCamera() ?? Camera.main; layers = new GlobeLayerInfo[MaxLayers]; for (int i = 0; i < MaxLayers; i++) { // Reset layer layers[i] = new GlobeLayerInfo(); } }
public override void LoadLayer(int index, string layerName, DateTime date) { if (index >= MaxLayers) { throw new ArgumentException("Too many layers"); } GlobeLayerInfo globeLayer = layers[index]; globeLayer.name = layerName; globeLayer.date = date; globeLayer.status = LayerStatus.Loading; globeLayer.rootTilesLoaded = 0; globeLayer.transitionProgress = 0f; globeLayer.elapsedTransitionTime = 0f; globeLayer.wmsLayer = availableLayers[layerName]; }
public float GetGlobeLayerLoadingTransition(string layerId) { GlobeLayerInfo gli = null; foreach (GlobeLayerInfo globeLayerInfo in globe.LayerInfo) { if (globeLayerInfo.name == layerId) { gli = globeLayerInfo; break; } } if (gli == null) { return(0f); } return(gli.status == LayerStatus.Complete ? 1f : gli.transitionProgress); }
private void UpdateGlobeLayer(int layerIndex, Dropdown dropdown, bool isExtruded) { string layerName = dropdown.options[dropdown.value].text; GlobeLayerInfo globeLayer = globe.layers[layerIndex]; if (globeLayer.name == null || layerName != globeLayer.name) { if (isExtruded) { Debug.LogFormat("Setting extruded layer {0} to {1}", layerIndex, layerName); layerApplier.ApplyLayer(layerName, new DateTime(2016, 8, 16), LayerApplier.LayerVisualizationStyle.Volumetric, layerIndex); } else { Debug.LogFormat("Setting flat layer {0} to {1}", layerIndex, layerName); layerApplier.ApplyLayer(layerName, new DateTime(2016, 8, 16), LayerApplier.LayerVisualizationStyle.Flat, layerIndex); } } }
private void UpdateLayerTransition(int layerIndex, GlobeLayerInfo layer, float blendDuration) { float blendAmount = layer.elapsedTransitionTime / blendDuration; float smoothedBlendAmount = Mathf.SmoothStep(0.0f, 1.0f, blendAmount); for (int j = 0; j < rootTiles.Length; j++) { rootTiles[j].SetTransitionProgress(layerIndex, blendAmount); } layer.transitionProgress = smoothedBlendAmount; if (blendAmount >= 1f) { layer.status = LayerStatus.Complete; layer.rootTilesLoaded = 0; } layer.elapsedTransitionTime += Time.deltaTime; }