예제 #1
0
        private void SetKML()
        {
            var bundle = NSBundle.MainBundle;
            var path   = bundle.PathForResource("KML_Sample", "kml");
            var url    = NSUrl.CreateFileUrl(path, null);
            var parser = new GMUKMLParser(url);

            parser.Parse();
            var renderer = new GMUGeometryRenderer(mapView, parser.Placemarks, parser.Styles);

            renderer.Render();
        }
예제 #2
0
        void AddKml()
        {
            var path = NSBundle.MainBundle.PathForResource("KML_Samples", "kml");
            // var url = new NSUrl(path);
            var data      = NSData.FromFile(path);
            var kmlParser = new GMUKMLParser(data);

            kmlParser.Parse();

            // var renderer = new GMUGeometryRenderer(mapView, kmlParser.Placemarks, kmlParser.Styles);
            var placemarks = kmlParser.Placemarks;
            var styles     = kmlParser.Styles;
            var renderer   = new GMUGeometryRenderer(mapView, placemarks);

            renderer.Render();
        }
        public override void LoadView()
        {
            var camera = CameraPosition.FromCamera(latitude: 37.4220, longitude: -122.0841, 17);

            mapView   = MapView.FromCamera(frame: CGRect.Empty, camera: camera);
            this.View = mapView;

            var path = NSBundle.PathForResourceAbsolute("KML_Sample", "kml", NibBundle.BundlePath);
            var url  = NSUrl.CreateFileUrl(path, null);

            kmlParser = new GMUKMLParser(url);
            kmlParser.Parse();

            renderer = new GMUGeometryRenderer(map: mapView,
                                               geometries: kmlParser.Placemarks,
                                               styles: kmlParser.Styles);

            renderer.Render();
        }