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; }
private void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { Exception ex = null; if (!this.CheckForFault(e, out ex)) { JsonObject jsonObject = (JsonObject)JsonObject.Parse(e.Result); mapServiceInfo = SmMapServiceInfo.FromJson(jsonObject); if ((this.Initialized != null) && (this.mapServiceInfo != null)) { this.Initialized(this, new MapServiceInitalizeArgs { MapService = this }); } } }