/// <summary> /// Called when user chooses to display legendControl /// 当用户单击图标时显示“legendControl” /// </summary> protected virtual void OnLegendClick(object sender, EventArgs e) { if (legendControl == null) { legendControl = new ColorbarLegend(null); } legendControl.LoadImage(m_legendImagePath); }
/// <summary> /// Cleanup when layer is disabled /// 释放资源 /// </summary> public override void Dispose() { this.IsInitialized = false; if (downloadThread != null) { if (downloadThread.IsAlive) { downloadThread.Abort(); } downloadThread = null; } if (m_SurfaceImage != null) { //m_ParentWorld.WorldSurfaceRenderer.RemoveSurfaceImage(m_SurfaceImage.ImageFilePath); //m_SurfaceImage = null; } if (this.texture != null) { this.texture.Dispose(); this.texture = null; } if (legendControl != null) { legendControl.Dispose(); legendControl = null; } if (refreshTimer != null && refreshTimer.Enabled) { refreshTimer.Stop(); refreshTimer = null; } }