Exemplo n.º 1
0
        public override void DrawCore(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas,
                                      DrawContext drawContext, bool shadow)
        {
#if DEBUG
            Log.Debug("com.mapquest.android.maps.lineoverlay", "LineOverlay.draw()");
#endif

            ////if (this.listener == null)
            ////{
            ////    this.listener = new EventListener(null);
            ////    mapView.addMapViewEventListener(this.listener);
            ////}
            
            Rect bounds = canvas.ClipBounds;
            Rect imageRegion = Util.CreateRectFromBoundingBox(boundingBox, drawContext.MapView);

            int pad = (int) LinePaint.StrokeWidth/2;
            imageRegion.Inset(-pad, -pad);

            BoundingBox screenBox = Util.CreateBoundingBoxFromRect(bounds, drawContext.MapView);

            foreach (var feature in features)
            {
                if (CanDraw(feature))
                {
                    DrawLineCore(feature.Geometry, GetPaint(feature), imageRegion, bounds, screenBox,
                                 drawContext.MapView, canvas);
                }
            }

        }
Exemplo n.º 2
0
        public override void Draw(Canvas canvas, MapView mapView, bool shadow)
        {
            var beginDrawEventArgs = new OverlayDrawEventArgs();
            OnBeginDraw(beginDrawEventArgs);
            if (beginDrawEventArgs.Cancel)
                return;

            var drawContext = new DrawContext(mapView.Context.Assets, mapView);
            ZoomLevelSet.Draw(FeatureSource, FeatureSource.GetBoundingBox(), canvas, drawContext, shadow);
        }
Exemplo n.º 3
0
        public override void DrawCore(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
        {
            var projection = drawContext.MapView.Projection;
            var bounds = canvas.ClipBounds;

            BoundingBox screenBox = Util.CreateBoundingBoxFromRect(bounds, drawContext.MapView);
            if (BoundingBox.Intersect(boundingBox, screenBox))
            {
                Point point = new Point();
                foreach (var feature in features)
                {
                    // there is a condition that checks for focus index before drawing
                    if (!CanDraw(feature))
                        continue;

                    Drawable marker = GetMarker(feature, drawContext.Assets);
                    //if (item.Alignment != 0)
                    //{
                    //    Overlay.SetAlignment(marker, item.Alignment);
                    //}
                    var geoPoint = feature.Geometry as GeoPoint;
                    if (geoPoint == null) continue;

                    projection.ToPixels(geoPoint, point);
                    DrawFeature(canvas, feature, point, marker, shadow);
                }

                //int size = this.items.size();
                //for (int i = size - 1; i >= 0; i--)
                //{
                //    if (this.focusedIndex != i)
                //    {
                //        OverlayItem item = getItem(i);

                //        item.
                //        Drawable marker = GetMarker(item);
                //        if (item.Alignment != 0)
                //        {
                //            Overlay.SetAlignment(marker, item.Alignment);
                //        }
                //        projection.ToPixels(item.Point, point);
                //        DrawFeature(canvas, item, point, marker, shadow);
                //    }
                //}

                //if ((this.drawFocusedItem) && (this.focusedIndex != -1))
                //{
                //    Item item = getItem(this.focusedIndex);
                //    projection.ToPixels(item.getPoint(), point);
                //    drawItem(canvas, getItem(this.focusedIndex), point, getMarker(item), shadow);
                //}
            }
        }
Exemplo n.º 4
0
        public void Draw(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
        {
            var enumerable = features as IList<Feature> ?? features.ToList();

            if (CustomZoomLevels.Count > 0)
            {
                foreach (var zoomLevel in CustomZoomLevels)
                {
                    zoomLevel.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
                }
            }
            else
            {
                ZoomLevel01.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
            }
        }
Exemplo n.º 5
0
 public void Draw(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
 {
     var enumerable = features as IList<Feature> ?? features.ToList();
     if (CustomStyles.Count > 0)
     {
         foreach (var style in CustomStyles)
         {
             style.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
         }
     }
     else
     {
         DefaultPointStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
         DefaultLineStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
         DefaultAreaStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
         DefaultTextStyle.Draw(enumerable, boundingBox, canvas, drawContext, shadow);
     }
 }
Exemplo n.º 6
0
 public abstract void DrawCore(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow);
Exemplo n.º 7
0
 public void Draw(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
 {
     DrawCore(features, boundingBox, canvas, drawContext, shadow);
 }
Exemplo n.º 8
0
 public override void DrawCore(IEnumerable<Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public abstract void DrawCore(IEnumerable <Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow);
Exemplo n.º 10
0
 public void Draw(IEnumerable <Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
 {
     DrawCore(features, boundingBox, canvas, drawContext, shadow);
 }
Exemplo n.º 11
0
 public override void DrawCore(IEnumerable <Feature> features, BoundingBox boundingBox, Canvas canvas, DrawContext drawContext, bool shadow)
 {
     throw new NotImplementedException();
 }