/// <summary> /// Parses the specified bounds. /// </summary> /// <param name="bounds">The bounds.</param> /// <returns></returns> public static Bounds Parse(string bounds) { double swlat = 0D; double swlng = 0D; double nelat = 0D; double nelng = 0D; if (!string.IsNullOrEmpty(bounds)) { bounds = bounds.Trim('(', ')'); string[] pair = bounds.Split(':'); if (pair.Length == 2) { string[] p = pair[0].Split(','); if (p.Length == 2) { swlat = JsUtility.ToDouble(p[0]); swlng = JsUtility.ToDouble(p[1]); } p = pair[1].Split(','); if (p.Length == 2) { nelat = JsUtility.ToDouble(p[0]); nelng = JsUtility.ToDouble(p[1]); } } } return(new Bounds { SouthWest = new LatLng(swlat, swlng), NorthEast = new LatLng(nelat, nelng) }); }
/// <summary> /// Parses the specified pair. /// </summary> /// <param name="point">The point.</param> /// <returns></returns> public static LatLng Parse(string point) { double lat = 0D; double lng = 0D; if (!string.IsNullOrEmpty(point)) { point = point.Trim('(', ')'); string[] pair = point.Split(','); if (pair.Length >= 2) { lat = JsUtility.ToDouble(pair[0]); lng = JsUtility.ToDouble(pair[1]); } } return(new LatLng(lat, lng)); }