Cross plateform development

Nov 18, 2013 at 4:32 PM
Nice job!
As the core project is now a full PCL, I was wondering if there is any planed work on developping the rendering (MapControl, MapRenderer, etc) on Android and iOS devices thanks to Xamarin.Android an Xamarin.iOS before thinking about doing it by my self?

Nov 18, 2013 at 5:30 PM
Hi Jeremy, that is definitely the ambition but I am not sure what the best route is.

There is already a sample for MonoGame rendering on Windows-8. I would like to create Android and iOS versions of that too. That should be relatively simple. MonoGame MapRendering now supports tiles and bitmap pointsymbols. That is already enough for some scenarios. Polgons and Lines will be harder but should be possible. Still for most scenarios I need business like functionality and would need to use the platform specific Xamarin controls.

I think the best option would be if we could use MonoGame MapRenderer within platform specific Xamarin controls, so the two can be combined. I have seen samples like that with SharpDX within xaml, but I know little more about that. Perhaps the renderer should just return a bitmap which can then be draw on the platform specific canvas.

Perhaps there are other options as well for cross platform rendering. Also we could just create platform specific versions. We have already made something like that for iOS (not part of the Mapsui project).

I think an important requirement is that maps can be rendered on a background thread so that the running thread only needs to render the resulting bitmaps.

Do you have suggestions?
Nov 22, 2013 at 3:18 PM
Well, because of my personal need/calendar, I'll investigate in creating a project like Mapsui.Rendering.Xamarin-Droid and Mapsui.Rendering.Xamarin-iOS with Renderer and Control for each because I don't know anything about MonoGame and SharpDX.
Also I'm not a "Xamarin pure gamer" but it's more friendly for me.
Nov 22, 2013 at 10:57 PM
What kind of rendering will you be using on Android and iOS? Which assemblies/libraries/namespaces?
Nov 23, 2013 at 12:08 PM
Well I was thinking about building it thanks to Xamarin dlls like Mono.Android.dll giving access to namespaces like Android.Graphics, Android.View or Android.Annimation for example.
As for now I don't know yet if it will be something possible to do, I did something like that in the past, rewriting the Radial Menu Widget java project into .Net thanks to Xamarin dlls, so I think it should be.
I think I will learn from OSMDroid sources for the philosophy, the namespaces and else (using canvas, viewgroup, etc...).

As Xamarin is not an open source project, I know it will be useful only for developers having a Xamarin account like I do.
But anyway it suite for my need and may be for the Xamarin developer's community also.

What's your opinion?
Nov 24, 2013 at 8:32 AM
For Mapsui I am definitely interested in a Xamarin.Android implementation even if you need a Xamarin account. This has been a goal all along. I favor a rendering implementation that could work (to some extent) cross platform but so far have not found the perfect solution. So I am also interested in a platform specific implementation.

Learning from OsmDroid rendering might be a very good idea. Porting from java should be relatively straight forward. It depends on how they organized their rendering code though.

Another option would be to use something based on System.Drawing because there is already an implementation in Mapsui.Rendering.GdiRendering. There is a mono implemention of System.Drawing. I did some searching however and it seems there is no Xamarin.Android implementation:
Still not quite sure though.

Another option is something based on OpenTK. This is also used by MonoGame.