JsonArray pInnerPoints = JsonPoints[i] as JsonArray;
for (int j = 0; j < pInnerPoints.Count; j++)
{
string pStr = pInnerPoints[j].ToString();
string[] pStrPoints = pInnerPoints[j].ToString().Substring(1, pInnerPoints[j].ToString().Length - 2).Split(',');
MapPoint pPoint = new MapPoint();
pPoint.X = Convert.ToDouble(pStrPoints[0]);
pPoint.Y = Convert.ToDouble(pStrPoints[1]);
pPointCollections.Add(pPoint);
}
pPointCollection.Add(pPointCollections);
}
}
pPolyline.Paths = pPointCollection;
pGeo = pPolyline;
}
}
else if (jsonObjectGeo.ContainsKey("rings"))
{
JsonValue JsonPoints = jsonObjectGeo["rings"];
ESRI.ArcGIS.Client.Geometry.Polygon pPolygon = new ESRI.ArcGIS.Client.Geometry.Polygon();
ObservableCollection<ESRI.ArcGIS.Client.Geometry.PointCollection> pPointCollection = new ObservableCollection<ESRI.ArcGIS.Client.Geometry.PointCollection>();
if (JsonPoints is JsonArray)
{
for (int i = 0; i < JsonPoints.Count; i++)
{
if (JsonPoints[i] is JsonArray)
{
ESRI.ArcGIS.Client.Geometry.PointCollection pPointCollections = new ESRI.ArcGIS.Client.Geometry.PointCollection();
JsonArray pInnerPoints = JsonPoints[i] as JsonArray;
for (int j = 0; j < pInnerPoints.Count; j++)
{
string pStr = pInnerPoints[j].ToString();
string[] pStrPoints = pInnerPoints[j].ToString().Substring(1, pInnerPoints[j].ToString().Length - 2).Split(',');
MapPoint pPoint = new MapPoint();
pPoint.X = Convert.ToDouble(pStrPoints[0]);
pPoint.Y = Convert.ToDouble(pStrPoints[1]);
pPointCollections.Add(pPoint);
}
pPointCollection.Add(pPointCollections);
}
}
pPolygon.Rings= pPointCollection;
pGeo = pPolygon;
}
}
}
pGeo.SpatialReference = pSpatial;
return pGeo;
}