Guest User

Untitled

a guest
Jul 20th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. foreach (var data in lineString.ToEnumerable())
  2. {
  3.  
  4. }
  5.  
  6. public async void OnMapReady(GoogleMap googleMap)
  7. {
  8. InvokeOnMapReadyBaseClassHack(googleMap);
  9. map = googleMap;
  10. layer = new KmlLayer(map, Resource.Raw.mykmlfile, Android.App.Application.Context);
  11. }
  12.  
  13. async void MoveCameraToKmlTwo(KmlLayer kmlLayer)
  14. {
  15. var list = new List<object>();
  16.  
  17. if (kmlLayer.HasContainers)
  18. {
  19. void IterateProperties(KmlContainer containers)
  20. {
  21. foreach (var property in containers.Properties.ToEnumerable())
  22. {
  23.  
  24. }
  25. }
  26. void IterateLineString(ArrayList lineString)
  27. {
  28. //when i try to get out the data in here i get the crash
  29. foreach (var data in lineString.ToEnumerable())
  30. {
  31.  
  32. }
  33. }
  34.  
  35. void IteratePlaceMarks(KmlContainer container)
  36. {
  37. foreach (KmlPlacemark placemark in container.Placemarks.ToEnumerable())
  38. {
  39. IterateProperties(container);
  40. if (placemark.HasGeometry & placemark.Geometry is KmlLineString)
  41. {
  42. IterateLineString(placemark.Geometry.GeometryJavaObject() as Java.Util.ArrayList);
  43.  
  44. }
  45. }
  46. }
  47.  
  48. void IterateSubContainers(KmlContainer container)
  49. {
  50. IterateProperties(container);
  51. IteratePlaceMarks(container);
  52. if (container.HasContainers)
  53. {
  54. foreach (KmlContainer subContainer in container.Containers.ToEnumerable())
  55. IterateSubContainers(subContainer);
  56. }
  57. }
  58.  
  59. foreach (KmlContainer container in kmlLayer.Containers.ToEnumerable())
  60. IterateSubContainers(container);
  61.  
  62. }
  63. }
  64.  
  65. <?xml version="1.0" encoding="UTF-8"?>
  66. <kml xmlns="http://earth.google.com/kml/2.1">
  67.  
  68. <Document>
  69. <name>Routes</name>
  70. <description></description>
  71. <visibility>1</visibility>
  72. <open>1</open>
  73.  
  74. <Style id="dark_green">
  75. <LineStyle>
  76. <color>C8008C14</color>
  77. <width>4</width>
  78. </LineStyle>
  79. </Style>
  80.  
  81. <Style id="route_dark_blue">
  82. <LineStyle>
  83. <color>96F01414</color>
  84. <width>4</width>
  85. </LineStyle>
  86. </Style>
  87.  
  88.  
  89. <Folder>
  90. <name>Tracks</name>
  91. <description>A list of tracks</description>
  92. <visibility>1</visibility>
  93. <open>0</open>
  94. <Placemark>
  95. <visibility>0</visibility>
  96. <open>0</open>
  97. <styleUrl>#red</styleUrl>
  98. <name>Around the lake</name>
  99. <description>Track no. 1</description>
  100. <LineString>
  101. <extrude>true</extrude>
  102. <tessellate>true</tessellate>
  103. <altitudeMode>clampToGround</altitudeMode>
  104. <coordinates>
  105. 7.366653,42.281982,106.075562 7.366759,42.282024,99.504028 7.366846,42.282043,95.945312 7.366909,42.282085,94.900269 7.366982,42.282116,94.186218 7.367039,42.282150,90.530640 7.367124,42.282135,87.749268 7.367111,42.282192,89.794800 7.367088,42.282242,90.636597 7.367079,42.282299,89.214539
  106. </coordinates>
  107. </LineString>
  108. </Placemark>
  109. </Folder>
  110. </Document>
  111. </kml>
  112.  
  113. placemark.Geometry.GeometryJavaObject() as Java.Util.ArrayList
  114.  
  115. placemark.Geometry.GeometryJavaObject().JavaCast<Java.Util.ArrayList>()
Add Comment
Please, Sign In to add comment