Esempio n. 1
0
 private void OnToggleShowIsochrons(bool isOn)
 {
     if (reachabilityPatch != null)
     {
         reachabilityPatch.GetMapLayer().Show(isOn);
     }
 }
Esempio n. 2
0
    private void OnPatchVisibilityChange(DataLayer dataLayer, Patch patch, bool visible)
    {
        if (dataLayer.Name == networkLayerName)
        {
            if (visible)
            {
                SetNetworkPatch(patch as GraphPatch);
            }
            else if (patch == networkPatch)
            {
                SetNetworkPatch(null);
            }
        }
        else if (dataLayer.Name == reachabilityLayerName)
        {
            if (visible)
            {
                reachabilityPatch = patch as GridPatch;
                GridMapLayer mapLayer = reachabilityPatch.GetMapLayer() as GridMapLayer;
                if (mapLayer != null)
                {
                    mapLayer.SetStripes(stripeCount, true);
                }

                if (reachabilityPatch.grid.IsCategorized)
                {
                    ShowError(CategorizedReachabilityError);
                    ResetTool(true);
                    return;
                }
                else if (placeStart != null)
                {
                    placeStart.ReachabilityPatch = reachabilityPatch;
                }
            }
            else if (patch == reachabilityPatch)
            {
                reachabilityPatch = null;
            }
        }

        if (networkPatch == null)
        {
            ShowError(NetworkNotAvailableHereError);
            movedAwayError = true;
        }
        else if (movedAwayError)
        {
            movedAwayError = false;
            HideErrorMessage();
        }
    }