Ejemplo n.º 1
0
        public DefaultItemizedOverlay CreatePointOverlay(PointStyleInfo styleInfo, AssetManager assetManager, AnnotationView annotationView = null)
        {
            var drawable = CreateDrawable(styleInfo, assetManager);
            var overlay  = new DefaultItemizedOverlay(drawable);

            overlay.SetTapListener(new TapOverlayListener(overlay, annotationView));
            return(overlay);
        }
Ejemplo n.º 2
0
        private Drawable CreateDrawable(PointStyleInfo styleInfo, AssetManager assetManager)
        {
            if (string.IsNullOrWhiteSpace(styleInfo.ImageUrl))
            {
                throw new NotSupportedException("point style for non-images not supported.");
            }

            var asset = assetManager.Open(styleInfo.ImageUrl);

            return(new BitmapDrawable(asset));
        }
Ejemplo n.º 3
0
        private void CreateMyLocationOverlay(string name, string alias,
                                             PointStyleInfo userSymbol,
                                             PointStyleInfo compassSymbol = null,
                                             IUserLocationTracker userLocationDataManager = null)
        {
            var locationOverlay =
                _mapQuestOverlayFactory.CreateMyLocationOverlay(name, alias,
                                                                userSymbol, compassSymbol,
                                                                _assetManager, userLocationDataManager, _map, _annotationView);

            RegisterLayerViewModel(locationOverlay);
        }
Ejemplo n.º 4
0
        public static PointStyle CreatePointStyle(PointStyleInfo styleInfo, AssetManager assetManager)
        {
            Drawable drawable = null;

            if (!string.IsNullOrWhiteSpace(styleInfo.ImageUrl))
            {
                drawable = CreateBitmapDrawable(styleInfo.ImageUrl, assetManager);
            }
            else
            {
                drawable = new ColorDrawable(CreateColor(styleInfo.SolidColor));
            }

            return(new PointStyle(drawable));
        }
Ejemplo n.º 5
0
        public void AddMyLocationLayer(
            string name, string alias,
            PointStyleInfo userSymbol,
            PointStyleInfo compassSymbol = null,
            IUserLocationTracker userLocationDataManager = null)
        {
            if (_mapView == null)
            {
                _pendingLayerDrawActions.Add(() => CreateMyLocationOverlay(name, alias, userSymbol, compassSymbol, userLocationDataManager));
            }
            else
            {
                CreateMyLocationOverlay(name, alias, userSymbol, compassSymbol, userLocationDataManager);
            }

            //locationOverlay.IsLocationUpdateEnabled = true;  //.EnableLocationTracking();
            //locationOverlay.RunOnFirstFix(new MyLocationRunnable(locationOverlay, _map));
        }
Ejemplo n.º 6
0
        public MyLocationLayerViewModel CreateMyLocationOverlay(string name, string alias,
                                                                PointStyleInfo userSymbol,
                                                                PointStyleInfo compassSymbol,
                                                                AssetManager assetManager,
                                                                IUserLocationTracker userLocationDataManager,
                                                                MapView mapVIew,
                                                                AnnotationView annotationView = null)
        {
            var      userDrawable    = CreateDrawable(userSymbol, assetManager);
            Drawable compassDrawable = null;

            if (compassSymbol != null)
            {
                compassDrawable = CreateDrawable(compassSymbol, assetManager);
            }
            var layer = new MyLocationOverlay(userDrawable, compassDrawable);

            layer.SetTapListener(new TapOverlayListener(layer, annotationView));
            return(new MyLocationLayerViewModel(name, alias, layer, userLocationDataManager, mapVIew));
        }