Пример #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Map> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                return;
            }
            mapView   = Control;
            customMap = e.NewElement as CustomMap;

            if (customMap != null)
            {
                var tileProvider = new CustomTileProvider(512, 512, customMap.MapTileTemplate);
                var options      = new TileOverlayOptions().InvokeTileProvider(tileProvider);

                mapView.Map.AddTileOverlay(options);
            }

            if (mapView?.Map != null)
            {
                mapView.Map.InfoWindowClick += MapOnInfoWindowClick;
            }


            if (customMap != null)
            {
                ((ObservableCollection <Pin>)customMap.Pins).CollectionChanged += OnCollectionChanged;
            }
        }
Пример #2
0
        private void UpdateTile()
        {
            var tileProvider = new CustomTileProvider(512, 512, customMap.MapTileTemplate);
            var options      = new TileOverlayOptions().InvokeTileProvider(tileProvider);

            mapView.Map.AddTileOverlay(options);
        }