public virtual void GetData(Tuple <double, double, double, double> bbox) { try { using (WebClient wc = new WebClient()) { //Main string url = string.Format(baseUrl, 21, FormatBbox(bbox)); string jsonResponse = wc.DownloadString(url); wc.Headers.Add("Content-Type", "application/json"); ACstormwater_OBJ.ACServices ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse); DrawPoly(ob); //Private url = string.Format(baseUrl, 22, FormatBbox(bbox)); jsonResponse = wc.DownloadString(url); ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse); DrawPoly(ob); //Abandoned url = string.Format(baseUrl, 23, FormatBbox(bbox)); jsonResponse = wc.DownloadString(url); ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse); DrawPoly(ob); //Manhole url = string.Format(baseUrl, 13, FormatBbox(bbox)); jsonResponse = wc.DownloadString(url); ACstormwater_OBJ.ACServicesManhole mh = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServicesManhole>(jsonResponse); DrawMarker(mh); } } catch { } }
public void DrawMarker(ACstormwater_OBJ.ACServicesManhole manhole) { foreach (ACstormwater_OBJ.ACFeatureManHole feat in manhole.features) { if (feat.attributes.TLATYPENAME == "Standard Manhole") { PointLatLng pt = new PointLatLng(feat.geometry.y, feat.geometry.x); } } }