Exemple #1
0
        public LineOverlay CreateLineOverlay(LineStyleInfo styleInfo)
        {
            var paint       = MapquestStyleFactory.CreatePaintFromStyleInfo(styleInfo);
            var lineOverlay = new LineOverlay(paint);

            // get from styleInfo
            var paint1 = new Paint(PaintFlags.AntiAlias);

            paint1.StrokeWidth = styleInfo.StrokeWidth;
            paint1.Alpha       = 100;
            paint1.Color       = new Color(0, 0, 0, 255);
            lineOverlay.SetShowPoints(true, paint1);
            return(lineOverlay);
        }
Exemple #2
0
        public PolygonOverlay CreatePolygonOverlay(PolygonStyleInfo styleInfo)
        {
            //var paint = new Paint(PaintFlags.AntiAlias);
            //paint.Color = Color.Black;
            //paint.SetStyle(Paint.Style.Stroke);
            //paint.StrokeWidth = 3;
            //paint.Alpha = 100;
            //paint.StrokeJoin = Paint.Join.Round;
            //paint.StrokeCap = Paint.Cap.Round;

            var paint          = MapquestStyleFactory.CreatePaintFromStyleInfo(styleInfo);
            var polygonOverlay = new PolygonOverlay(paint);

            return(polygonOverlay);
        }
Exemple #3
0
        public ILayerViewModel CreateOverlay(FeatureLayerContext layerContext,
                                             MapView mapView,
                                             AssetManager assetManager,
                                             AnnotationView annotationView = null)
        {
            if (layerContext.StyleType == StyleType.Point)
            {
                var overlay = CreatePointOverlay((PointStyleInfo)layerContext.StyleInfo, assetManager, annotationView);
                return(new PointFeatureLayerViewModel(layerContext.Name, layerContext.Alias, overlay, layerContext.GeoDataManager));
            }

            //if (layerContext.StyleType == StyleType.Point)
            //{
            //    var style = MapquestStyleFactory.CreatePointStyle((PointStyleInfo)layerContext.StyleInfo, assetManager);
            //    return CreateFeatureLayerViewModel(style, assetManager, annotationView, layerContext);
            //}

            //if (layerContext.StyleType == StyleType.Line)
            //{
            //    var lineOverlay = CreateLineOverlay((LineStyleInfo) layerContext.StyleInfo);
            //    return new LineFeatureLayerViewModel(layerContext.Name, layerContext.Alias, lineOverlay, layerContext.GeoDataManager);
            //}

            if (layerContext.StyleType == StyleType.Line)
            {
                var lineStyle = MapquestStyleFactory.CreateLineStyle((LineStyleInfo)layerContext.StyleInfo);
                return(CreateFeatureLayerViewModel(lineStyle, assetManager, annotationView, layerContext));
            }

            if (layerContext.StyleType == StyleType.Polygon)
            {
                var overlay = CreatePolygonOverlay((PolygonStyleInfo)layerContext.StyleInfo);
                return(new PolygonFeatureLayerViewModel(layerContext.Name, layerContext.Alias, overlay, layerContext.GeoDataManager));
            }

            throw new NotSupportedException(string.Format("layer content style {0} not supported.", layerContext.StyleType));
        }