Exemplo n.º 1
0
        public void Setup(IMapControl mapControl)
        {
            _mapControl = mapControl;

            //I like bing Hybrid
            mapControl.Map = BingSample.CreateMap(BingHybrid.DefaultCache, BruTile.Predefined.KnownTileSource.BingHybrid);

            var widget = new PerformanceWidget(_performance);

            widget.WidgetTouched += OnClick;

            mapControl.Map.Widgets.Add(widget);
            mapControl.Performance = _performance;
            mapControl.Renderer.WidgetRenders[typeof(PerformanceWidget)] = new PerformanceWidgetRenderer(10, 10, 12, SKColors.Black, SKColors.White);
        }
Exemplo n.º 2
0
        public void Setup(IMapControl mapControl)
        {
            mapControl.Map = OsmSample.CreateMap();

            if (mapControl.Performance == null)
            {
                mapControl.Performance = new Utilities.Performance();
            }

            var widget = new PerformanceWidget(mapControl.Performance);

            widget.WidgetTouched += (sender, args) => {
                mapControl?.Performance.Clear();
                mapControl?.RefreshGraphics();

                args.Handled = true;
            };

            mapControl.Map.Widgets.Add(widget);
            mapControl.Renderer.WidgetRenders[typeof(PerformanceWidget)] = new Rendering.Skia.SkiaWidgets.PerformanceWidgetRenderer(10, 10, 12, SkiaSharp.SKColors.Black, SkiaSharp.SKColors.White);

            ((MapView)mapControl).UseDoubleTap  = true;
            ((MapView)mapControl).UniqueCallout = true;

            var sw = new Stopwatch();

            sw.Start();

            // Add 1000 pins
            var list = new System.Collections.Generic.List <Pin>();

            for (var i = 0; i < 1000; i++)
            {
                list.Add(CreatePin(i));
            }

            var timePart1 = sw.Elapsed;

            ((ObservableRangeCollection <Pin>)((MapView)mapControl).Pins).AddRange(list);

            var timePart2 = sw.Elapsed;

            sw.Stop();
        }