Exemple #1
0
        public static TwitterBoundingBox Parse(JsonObject obj)
        {
            // Check whether "obj" is NULL
            if (obj == null)
            {
                return(null);
            }

            // Get the array
            JsonArray coordinates = obj.GetArray("coordinates");

            // Initialize the bounding box
            TwitterBoundingBox boundingBox = new TwitterBoundingBox {
                Type        = obj.GetString("type"),
                Coordinates = new TwitterCoordinates[coordinates.Length][]
            };

            // Parse the coordinates
            for (int i = 0; i < coordinates.Length; i++)
            {
                boundingBox.Coordinates[i] = TwitterCoordinates.ParseMultiple(coordinates.GetArray(i));
            }

            // Return the building box
            return(boundingBox);
        }
Exemple #2
0
        private TwitterBoundingBox(JObject obj) : base(obj)
        {
            // Get the array
            JArray coordinates = obj.GetArray("coordinates");

            // Initialize properties
            Type        = obj.GetString("type");
            Coordinates = new TwitterCoordinates[coordinates.Count][];

            // Parse the coordinates
            for (int i = 0; i < coordinates.Count; i++)
            {
                Coordinates[i] = TwitterCoordinates.ParseMultiple(coordinates.GetArray(i));
            }
        }