Exemplo n.º 1
0
        internal async void FlashStreet()
        {
            if (StreetLayer != null && StreetLayer is FeatureLayer)
            {
                if (Type == "INTERSECTS")
                {
                    QueryParameters _query = new QueryParameters();
                    _query.WhereClause = $"REGISTEREDNAME = '{SelectedPrimaryStreet.name}' and STREETTYPE = '{SelectedPrimaryStreet.type}' and QUADRANT = '{SelectedPrimaryStreet.quad}'";

                    var prifeatures = await StreetLayer.FeatureTable.QueryFeaturesAsync(_query);

                    _query.WhereClause = $"REGISTEREDNAME = '{SelectedIntersectingStreet.name}' and STREETTYPE = '{SelectedIntersectingStreet.type}' and QUADRANT = '{SelectedIntersectingStreet.quad}'";
                    var intfeatures = await StreetLayer.FeatureTable.QueryFeaturesAsync(_query);

                    var showfeatures = new List <Feature>();
                    foreach (var prifeature in prifeatures)
                    {
                        foreach (var intfeature in intfeatures)
                        {
                            if (GeometryEngine.Touches(prifeature.Geometry, intfeature.Geometry))
                            {
                                showfeatures.Add(prifeature);
                                showfeatures.Add(intfeature);
                            }
                        }
                    }
                    var strings = showfeatures.Select(feature => $"OBJECTID = {feature.Attributes["OBJECTID"]?.ToString()}");


                    _query.WhereClause = String.Join(" or ", strings.ToArray());

                    StreetLayer.SelectFeaturesAsync(_query, Esri.ArcGISRuntime.Mapping.SelectionMode.New);

                    await Task.Delay(1 * 1000);

                    StreetLayer.ClearSelection();
                }
                else
                {
                    QueryParameters _query = new QueryParameters();
                    _query.WhereClause = $"REGISTEREDNAME = '{SelectedPrimaryStreet.name}' and STREETTYPE = '{SelectedPrimaryStreet.type}' and QUADRANT = '{SelectedPrimaryStreet.quad}'";
                    _query.WhereClause = _query.WhereClause + $" and  FROMLEFTTHEORETICRANGE = '{SelectedRange.leftLower}' and TOLEFTTHEORETICRANGE = '{SelectedRange.leftUpper}' and FROMRIGHTTHEORETICRANGE = '{SelectedRange.rightLower}' and TORIGHTTHEORETICRANGE = '{SelectedRange.rightUpper}'";
                    StreetLayer.SelectFeaturesAsync(_query, Esri.ArcGISRuntime.Mapping.SelectionMode.New);

                    await Task.Delay(1 * 1000);

                    StreetLayer.ClearSelection();
                }
            }
        }
Exemplo n.º 2
0
        static float sModalOffset   = 0;//15;

        public void Create(object masterView, RectangleF frame, Rock.Mobile.UI.PlatformButton.OnClick searchNeighborhoodsClicked,
                           Rock.Mobile.UI.PlatformButton.OnClick searchShortTermClicked,
                           Rock.Mobile.UI.PlatformButton.OnClick searchYoungAdultsClicked)
        {
            Backer = PlatformView.Create( );
            Backer.BackgroundColor = 0x000000FF;
            Backer.Opacity         = sBackerOpacity;
            Backer.AddAsSubview(masterView);
            Backer.Frame = frame;

            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.AddAsSubview(masterView);
            View.Frame = frame;

            Title = PlatformLabel.Create( );
            Title.AddAsSubview(View.PlatformNativeObject);
            Title.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize);
            Title.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            Title.TextAlignment = TextAlignment.Center;

            Details = PlatformLabel.Create( );
            Details.AddAsSubview(View.PlatformNativeObject);
            Details.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Small_FontSize);
            Details.TextColor = ControlStylingConfig.TextField_ActiveTextColor;


            // Name Info
            StreetLayer = PlatformView.Create( );
            StreetLayer.AddAsSubview(View.PlatformNativeObject);
            StreetLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            StreetLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            StreetLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            Street = PlatformTextField.Create( );
            Street.AddAsSubview(View.PlatformNativeObject);
            Street.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            Street.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            Street.Placeholder            = ConnectStrings.GroupFinder_StreetPlaceholder;
            Street.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            Street.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            Street.AutoCapitalizationType = AutoCapitalizationType.Words;
            Street.AutoCorrectionType     = AutoCorrectionType.No;


            CityLayer = PlatformView.Create( );
            CityLayer.AddAsSubview(View.PlatformNativeObject);
            CityLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            CityLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            CityLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            City = PlatformTextField.Create( );
            City.AddAsSubview(View.PlatformNativeObject);
            City.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            City.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            City.Placeholder            = ConnectStrings.GroupFinder_CityPlaceholder;
            City.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            City.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            City.AutoCapitalizationType = AutoCapitalizationType.Words;
            City.AutoCorrectionType     = AutoCorrectionType.No;


            StateLayer = PlatformView.Create( );
            StateLayer.AddAsSubview(View.PlatformNativeObject);
            StateLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            StateLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            StateLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            State = PlatformTextField.Create( );
            State.AddAsSubview(View.PlatformNativeObject);
            State.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            State.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            State.Placeholder            = ConnectStrings.GroupFinder_StatePlaceholder;
            State.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            State.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            State.AutoCapitalizationType = AutoCapitalizationType.Words;
            State.AutoCorrectionType     = AutoCorrectionType.No;

            ZipCodeLayer = PlatformView.Create( );
            ZipCodeLayer.AddAsSubview(View.PlatformNativeObject);
            ZipCodeLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            ZipCodeLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            ZipCodeLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            ZipCode = PlatformTextField.Create( );
            ZipCode.AddAsSubview(View.PlatformNativeObject);
            ZipCode.SetFont(ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ZipCode.PlaceholderTextColor   = ControlStylingConfig.TextField_PlaceholderTextColor;
            ZipCode.Placeholder            = ConnectStrings.GroupFinder_ZipPlaceholder;
            ZipCode.TextColor              = ControlStylingConfig.TextField_ActiveTextColor;
            ZipCode.KeyboardAppearance     = KeyboardAppearanceStyle.Dark;
            ZipCode.AutoCapitalizationType = AutoCapitalizationType.None;
            ZipCode.AutoCorrectionType     = AutoCorrectionType.No;


            // Search Neighborhoods Button
            SearchNeighborhoodsClicked = searchNeighborhoodsClicked;
            SearchNeighborhoodsButton  = PlatformButton.Create( );
            SearchNeighborhoodsButton.AddAsSubview(View.PlatformNativeObject);
            SearchNeighborhoodsButton.BackgroundColor = ControlStylingConfig.Button_BGColor;
            SearchNeighborhoodsButton.TextColor       = ControlStylingConfig.Button_TextColor;
            SearchNeighborhoodsButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            SearchNeighborhoodsButton.Text            = ConnectStrings.GroupFinder_Search_NeighborhoodGroups;
            SearchNeighborhoodsButton.SetFont(ControlStylingConfig.Font_Regular, 14);
            SearchNeighborhoodsButton.SizeToFit( );
            SearchNeighborhoodsButton.ClickEvent = ( PlatformButton b ) =>
            {
                // treat the search button as if Return was pressed
                if (ShouldReturn( ))
                {
                    SearchNeighborhoodsClicked(null);
                }
            };


            // Search ShortTerm Button
            SearchShortTermClicked = searchShortTermClicked;
            SearchShortTermButton  = PlatformButton.Create( );
            SearchShortTermButton.AddAsSubview(View.PlatformNativeObject);
            SearchShortTermButton.BackgroundColor = ControlStylingConfig.Button_BGColor;
            SearchShortTermButton.TextColor       = ControlStylingConfig.Button_TextColor;
            SearchShortTermButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            SearchShortTermButton.Text            = ConnectStrings.GroupFinder_Search_ShortTermGroups;
            SearchShortTermButton.SetFont(ControlStylingConfig.Font_Regular, 14);
            SearchShortTermButton.SizeToFit( );
            SearchShortTermButton.ClickEvent = ( PlatformButton b ) =>
            {
                // treat the search button as if Return was pressed
                if (ShouldReturn( ))
                {
                    SearchShortTermClicked(null);
                }
            };

            // Search Young Adults Button
            SearchYoungAdultsClicked = searchYoungAdultsClicked;
            SearchYoungAdultsButton  = PlatformButton.Create( );
            SearchYoungAdultsButton.AddAsSubview(View.PlatformNativeObject);
            SearchYoungAdultsButton.BackgroundColor = ControlStylingConfig.Button_BGColor;
            SearchYoungAdultsButton.TextColor       = ControlStylingConfig.Button_TextColor;
            SearchYoungAdultsButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            SearchYoungAdultsButton.Text            = ConnectStrings.GroupFinder_Search_YoungAdultGroups;
            SearchYoungAdultsButton.SetFont(ControlStylingConfig.Font_Regular, 14);
            SearchYoungAdultsButton.SizeToFit( );
            SearchYoungAdultsButton.ClickEvent = ( PlatformButton b ) =>
            {
                // treat the search button as if Return was pressed
                if (ShouldReturn( ))
                {
                    SearchYoungAdultsClicked(null);
                }
            };


            SearchShortTermButton.Hidden   = true;
            SearchYoungAdultsButton.Hidden = true;

            LayoutChanged(frame);
        }