SuperMap.Web.Mapping.SmMapServiceInfo.FromJson C# (CSharp) Method

FromJson() public static method

public static FromJson ( System.Json.JsonObject jsonObject ) : SmMapServiceInfo
jsonObject System.Json.JsonObject
return SmMapServiceInfo
        public static SmMapServiceInfo FromJson(JsonObject jsonObject)
        {
            if (jsonObject == null)
            {
                return null;
            }

            SmMapServiceInfo msi = new SmMapServiceInfo();
            msi.MapBounds = JsonHelper.ToRectangle2D((JsonObject)jsonObject["mapBounds"]);
            msi.ReferViewBounds = JsonHelper.ToRectangle2D((JsonObject)jsonObject["referViewBounds"]);
            msi.ReferViewer = JsonHelper.ToRect((JsonObject)jsonObject["referViewer"]);
            msi.ReferScale = (double)jsonObject["referScale"];

            if (jsonObject.ContainsKey("coordsSys"))
            {
                msi.CRS = JsonHelper.ToCRS((JsonObject)jsonObject["coordsSys"]);
            }
            return msi;
        }