/// <summary>
        /// Returns the ranged properties.
        /// </summary>
        /// <returns></returns>
        public List <MapCSSRuleProperties> GetRanges()
        {
            var rules = new List <MapCSSRuleProperties>();
            MapCSSRuleProperties currentRule = null;
            string previousRuleString = string.Empty;
            int    minZoom = 0, maxZoom = 20;

            for (int zoomLevel = 0; zoomLevel < 20; zoomLevel++)
            {
                // get the current rule string.
                string currentRuleString = this.GetRuleStringForZoom(zoomLevel);

                if (previousRuleString != currentRuleString)
                { // there is a new rule.
                    // store the previous rule.
                    if (currentRule != null)
                    { // the current rule exists; store it.
                        currentRule.MinZoom = minZoom;
                        currentRule.MaxZoom = maxZoom + 1;

                        rules.Add(currentRule);
                        currentRule = null;
                    }

                    if (!string.IsNullOrWhiteSpace(currentRuleString))
                    {                        // only do this part when string is not empty.
                        minZoom = zoomLevel; // set the min zoom.
                        MapCSSRuleProperties props = this.GetRulesForZoom(zoomLevel);
                        if (props != null)
                        {
                            currentRule = new MapCSSRuleProperties(minZoom, 20);
                            currentRule = currentRule.Merge(props);
                        }
                    }
                    previousRuleString = currentRuleString;
                }
                maxZoom = zoomLevel; // set the max zoom.
            }

            // store the previous rule.
            if (currentRule != null)
            { // the current rule exists; store it.
                currentRule.MinZoom = minZoom;
                currentRule.MaxZoom = maxZoom + 1;

                rules.Add(currentRule);
            }

            return(rules);
        }
        /// <summary>
        /// Returns the rules for the given zoom.
        /// </summary>
        /// <param name="zoom"></param>
        /// <returns></returns>
        public MapCSSRuleProperties GetRulesForZoom(int zoom)
        {
            MapCSSRuleProperties rule = null;

            for (int idx = 0; idx < _properties.Count; idx++)
            {
                if (_properties[idx].IsForZoom(zoom))
                {
                    if (rule == null)
                    {
                        rule = new MapCSSRuleProperties(_properties[idx].MinZoom,
                                                        _properties[idx].MaxZoom);
                        rule = rule.Merge(_properties[idx]);
                    }
                    else
                    {
                        rule = rule.Merge(_properties[idx]);
                    }
                }
            }
            return(rule);
        }