Пример #1
0
    private void ToggleGraticule(bool isOn)
    {
        if (isOn)
        {
            if (!isInitialized)
            {
                isInitialized = Init();

                if (graticuleLayer == null)
                {
                    graticuleLayer = toolLayers.CreateMapLayer(graticuleLayerPrefab, "Graticule");
                }

                OnShowGridToggleChanged(false);

                // Initialize graticule content with intervals
                graticulePanel.GetPrevIntervals(out float?intervalX, out float?intervalY);
                float x = intervalX ?? graticuleLayer.IntervalX;
                float y = intervalY ?? graticuleLayer.IntervalY;
                graticuleLayer.SetInterval(x, y, graticulePanel.IsDegrees);
                graticuleLayer.UpdateContent();
            }
            graticuleImageColor.a = 1.0f;
            graticulePanel.SetIntervalX(graticuleLayer.IntervalX);
            graticulePanel.SetIntervalY(graticuleLayer.IntervalY);

            UpdateDimensionsText(graticulePanel.IsDegrees, graticuleLayer.IntervalX, graticuleLayer.IntervalY);
        }
        else
        {
            graticuleImageColor.a = 0.0f;
        }

        graticuleImageBG.color = graticuleImageColor;
        graticulePanel.gameObject.SetActive(isOn);
        panelEnabled = isOn;
    }
Пример #2
0
 public void CreateLineMapLayer(LineInspectorInfo lineInfo, LineInspectionMapLayer lineInspectionMapLayerPrefab)
 {
     lineInfo.mapLayer = toolLayers.CreateMapLayer(lineInspectionMapLayerPrefab, "LineInspectionLayer" + createdLineInspectionCount.ToString());
     lineInfo.mapLayer.Init(lineInfo.coords);
     lineInfo.mapLayer.ShowTransect(false);
 }