You can use the .JsonTo<T>
extension method to convert your paths
key to a Point[][]
then you can easily traverse the collection.
Simple Point
class:
public class Point
{
public float lat { get; set; }
public float lng { get; set; }
}
Usage (kept as similar to your usage in JSON.NET)
var mapObjects = JsonObject.Parse(request.MapObjects);
foreach(var overlay in mapObjects.ArrayObjects("overlays"))
{
if(overlay.Get("type")=="polygon")
{
foreach(var pathPart in overlay.JsonTo<Point[][]>("paths"))
{
foreach(var pathItem in pathPart)
{
Console.WriteLine(pathItem.lat);
Console.WriteLine(pathItem.lng);
}
}
}
}
I hope this helps.