예제 #1
0
 public MapRenderer()
 {
     WidgetRenders[typeof(Hyperlink)]       = new HyperlinkWidgetRenderer();
     WidgetRenders[typeof(ScaleBarWidget)]  = new ScaleBarWidgetRenderer();
     WidgetRenders[typeof(ZoomInOutWidget)] = new ZoomInOutWidgetRenderer();
     WidgetRenders[typeof(ButtonWidget)]    = new ButtonWidgetRenderer();
 }
예제 #2
0
        public MapRenderer()
        {
            StyleRenderers[typeof(RasterStyle)]  = new RasterStyleRenderer();
            StyleRenderers[typeof(VectorStyle)]  = new VectorStyleRenderer();
            StyleRenderers[typeof(LabelStyle)]   = new LabelStyleRenderer();
            StyleRenderers[typeof(SymbolStyle)]  = new SymbolStyleRenderer();
            StyleRenderers[typeof(CalloutStyle)] = new CalloutStyleRenderer();

            WidgetRenders[typeof(Hyperlink)]       = new HyperlinkWidgetRenderer();
            WidgetRenders[typeof(ScaleBarWidget)]  = new ScaleBarWidgetRenderer();
            WidgetRenders[typeof(ZoomInOutWidget)] = new ZoomInOutWidgetRenderer();
            WidgetRenders[typeof(ButtonWidget)]    = new ButtonWidgetRenderer();
        }
예제 #3
0
        public static void Render(object target, double screenWidth, double screenHeight, IEnumerable <IWidget> widgets,
                                  float layerOpacity)
        {
            var canvas = (SKCanvas)target;

            foreach (var widget in widgets)
            {
                if (widget is Hyperlink)
                {
                    HyperlinkWidgetRenderer.Draw(canvas, screenWidth, screenHeight, widget as Hyperlink, layerOpacity);
                }
                if (widget is ScaleBarWidget)
                {
                    ScaleBarWidgetRenderer.Draw(canvas, screenWidth, screenHeight, widget as ScaleBarWidget, layerOpacity);
                }
                if (widget is ZoomInOutWidget)
                {
                    ZoomInOutWidgetRenderer.Draw(canvas, screenWidth, screenHeight, widget as ZoomInOutWidget, layerOpacity);
                }
            }
        }