Sunday, 7 April 2013

New mg-desktop binaries

Coinciding with the final release of MapGuide Open Source 2.5, is a new release of mg-desktop.

So if you're wondering that that screenshot was all about, that was a simple test application using the new experimental Java API for mg-desktop. This is based on the enhanced Java API work for the Web API in 2.5, so it has none of the cruftiness of the original MapGuide Java wrapper API.

The Java API is also windows only as the MapGuideDesktopApi.jar is a SWIG-generated JNI wrapper around the native mg-desktop libraries. Since these libraries currently only exist as windows dlls, this jar obviously will not work on platforms that are not Microsoft Windows.

This Java API is there so you can explore what can be done with mg-desktop in the Java ecosystem. I myself am not fully proficient in Java (the platform) to be able to extend mg-desktop in Java in the same way as I have done for .net (so uh ... is swing still what you use for GUIs in Java?).

The Java API is only bundled with the zip package of mg-desktop. The mg-desktop nuget package does not include the Java API (it wouldn't make much sense to include it either).

Besides the new experimental Java API, mg-desktop itself has some small API enhancements as well:

  • IMapViewer now includes a new overload of SelectByGeometry() that accepts a callback and allows you to do "one-shot" programmatic selection that does not trigger the selection events that are normally raised by the viewer and does not require event subscription/unsubscription.
  • The MgdRenderingService::RenderDynamicOverlay() method now has a new behaviour flag value (8 to render base layers). If you logically OR this new flag value into the rendering options behaviour, your overlay image will include the map's base (tiled) layers as well. This means that you no longer have to use the RenderMap API to get a map image that includes tiled layers, and this one has the advantage of not having it's background pre-filled (it's an overlay image after all). Secondly this new behaviour is the viewer default, meaning you don't have to use the currently documented workarounds and also means that pre-rendering hooks in the viewer are actually useful on a map with tiled layers for once!
For this release, I've decided to stop doing .net 2.0 builds of mg-desktop. It's just too much effort to produce a .net 2.0 build of mg-desktop nowadays  For a .net 2.0 build, the whole FDO/MapGuide stack has to be built in VS2008. Whereas with .net 4.0 build, we can just ride the coat-tails of the current MapGuide Open Source build process where 80% of the stuff is already built for us. Plus I'd figure most of you would be on .net 4.0 anyway. 

This means that the mg-desktop build used by the Local Connection mode in Maestro 4.0.x will forever be on the same version as it is right now. Maestro 4.0.x is a maintenance branch that we aren't actively developing new features into so this shouldn't be much of an issue.

On the nuget front, this release replaces the 2.4 series. I'm not sure if this is how new versions are supposed to be put out as nuget doesn't really have the notion of "branches". If you install a new mapguide nuget package, it will now be pulling down the 2.5 package by default unless you explicitly specify the version number.

So a command like this:

Install-Package mapguide-api-base-x86

will install the 2.5 version of the package (this release), but a command like this:

Install-Package mapguide-api-base-x86 -Version

will install the latest 2.4 package. If you don't know the specific number, you can hit tab after the -Version parameter and the Package Manager Console will display an autocomplete prompt with all the applicable versions. You want to pick the latest major.minor version that matches the installed major.minor version of MapGuide that you're working with.

Something to take note of if you're building MapGuide web applications where the version you're working with matters, or if you need to fetch the correct CS-Map dictionaries for an older mg-desktop package.


kuba said...

Some early work based on mg-desktop.

kuba said...

Some early work based on mg-desktop.

Jackie Ng said...

Interesting, which bits of mg-desktop are you using? The backend stuff?