public MapRenderer() { WidgetRenders[typeof(Hyperlink)] = new HyperlinkWidgetRenderer(); WidgetRenders[typeof(ScaleBarWidget)] = new ScaleBarWidgetRenderer(); WidgetRenders[typeof(ZoomInOutWidget)] = new ZoomInOutWidgetRenderer(); WidgetRenders[typeof(ButtonWidget)] = new ButtonWidgetRenderer(); }
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(); }
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); } } }