Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach (var data in lineString.ToEnumerable())
- {
- }
- public async void OnMapReady(GoogleMap googleMap)
- {
- InvokeOnMapReadyBaseClassHack(googleMap);
- map = googleMap;
- layer = new KmlLayer(map, Resource.Raw.mykmlfile, Android.App.Application.Context);
- }
- async void MoveCameraToKmlTwo(KmlLayer kmlLayer)
- {
- var list = new List<object>();
- if (kmlLayer.HasContainers)
- {
- void IterateProperties(KmlContainer containers)
- {
- foreach (var property in containers.Properties.ToEnumerable())
- {
- }
- }
- void IterateLineString(ArrayList lineString)
- {
- //when i try to get out the data in here i get the crash
- foreach (var data in lineString.ToEnumerable())
- {
- }
- }
- void IteratePlaceMarks(KmlContainer container)
- {
- foreach (KmlPlacemark placemark in container.Placemarks.ToEnumerable())
- {
- IterateProperties(container);
- if (placemark.HasGeometry & placemark.Geometry is KmlLineString)
- {
- IterateLineString(placemark.Geometry.GeometryJavaObject() as Java.Util.ArrayList);
- }
- }
- }
- void IterateSubContainers(KmlContainer container)
- {
- IterateProperties(container);
- IteratePlaceMarks(container);
- if (container.HasContainers)
- {
- foreach (KmlContainer subContainer in container.Containers.ToEnumerable())
- IterateSubContainers(subContainer);
- }
- }
- foreach (KmlContainer container in kmlLayer.Containers.ToEnumerable())
- IterateSubContainers(container);
- }
- }
- <?xml version="1.0" encoding="UTF-8"?>
- <kml xmlns="http://earth.google.com/kml/2.1">
- <Document>
- <name>Routes</name>
- <description></description>
- <visibility>1</visibility>
- <open>1</open>
- <Style id="dark_green">
- <LineStyle>
- <color>C8008C14</color>
- <width>4</width>
- </LineStyle>
- </Style>
- <Style id="route_dark_blue">
- <LineStyle>
- <color>96F01414</color>
- <width>4</width>
- </LineStyle>
- </Style>
- <Folder>
- <name>Tracks</name>
- <description>A list of tracks</description>
- <visibility>1</visibility>
- <open>0</open>
- <Placemark>
- <visibility>0</visibility>
- <open>0</open>
- <styleUrl>#red</styleUrl>
- <name>Around the lake</name>
- <description>Track no. 1</description>
- <LineString>
- <extrude>true</extrude>
- <tessellate>true</tessellate>
- <altitudeMode>clampToGround</altitudeMode>
- <coordinates>
- 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
- </coordinates>
- </LineString>
- </Placemark>
- </Folder>
- </Document>
- </kml>
- placemark.Geometry.GeometryJavaObject() as Java.Util.ArrayList
- placemark.Geometry.GeometryJavaObject().JavaCast<Java.Util.ArrayList>()
Add Comment
Please, Sign In to add comment