Wednesday, 25 December 2013

Announcing: MapGuide Maestro 5.1

Here's a new release of Maestro just in time for Christmas!

Here's an overview of the goodies in this release.

XML Editor element completion

The XML editor now supports completion of valid XML elements

Map Definition Editor improvements

The Map Definition editor now uses a PropertyGrid for editing common properties. This allows us to enable selection of multiple layers and/or groups and be able to batch edit properties of these selected layers/groups.

Also for a single selected layer, we've added a shortcut to open the referenced Layer Definition in an editor.

SDK Changes

If you build applications using the Maestro API and use the LocalNative connection provider, we've now included the Maestro API test runner in the SDK so you can do basic validation and verification of the connection provider.

Also we've added support in the ProviderTemplate tool to build your connection provider in debug mode

If you don't know what this tool does. Stay tuned for a blog post where I explain what this tool does.

Other Changes

The Resource ID address bar now has an XML editor option. Useful for viewing and editing session-based resources.

The Create Package dialog now has a button to read resource ids from a text file

Upward and downward references in the Resource Properties dialog can now be opened in an editor

And of course, this release includes plenty of bug fixes since the 5.0.1 release.


Wednesday, 4 December 2013

New mg-desktop binaries

As mg-desktop builds tails off of the MapGuide builds. Here's a new mg-desktop release as well.

This release has the following changes:

Legend Fixes

The legend plotting fixes in MapGuide Open Source 2.5.2 have been ported over to mg-desktop as well.

In addition, the legend component of the viewer library now properly handles all possible permutations of single/multiple basic/composite styles in your Layer Definitions. If your layers are using Basic Stylization, this problem wouldn't have been apparent. But if you used lots of layers with Advanced Stylization, this problem would've stuck out like a sore thumb until now.


The viewer library now includes a Generic Redlining component to give your mg-desktop application out-of-the-box redlining capabilities. It's modelled on the same design as the Fusion Redlining widget.

You can grab this release of mg-desktop from the downloads page or from NuGet.

Announcing: MapGuide Open Source 2.5.2

Here's another point release of the 2.5 series of MapGuide Open Source.

This release contains some DWF and legend image (not icon) rendering fixes, the latter of which was critical in order to make the new QuickPlot enhancements in Fusion 2.6 not suck should you choose to install it to replace the bundled copy of Fusion in this release.

On Linux, this release also fixes the issue of certain RDBMS FDO providers missing from the installation packages. Linux builds are still cranking and will be available shortly after the windows builds, which are now available in the link below.


Thursday, 28 November 2013

Better Fusion errors

So I'm currently hacking on Fusion to make it try and give us errors (if any occur) that actually mean something instead of a wall-of-gibberish that's alert()'ed out.

Now this is an error in Fusion that actually contains useful information!

And if you're wondering how useful that above error was, it told me that the CreateSession.php helper script had some syntactical compatibility issues for PHP 5.5, something that obviously slipped under the radar when I was upgrading PHP and assorted PHP code for the next release of MapGuide Open Source.

So in the process of building this feature, it immediately went straight to work and caught some server-side problem that would've taken several debug cycles to dig out. And I didn't even have to break into Firebug/Developer Tools to get this information! I'm loving the taste of this dogfood already!

Tuesday, 26 November 2013

Another cool upcoming Maestro feature

The next version of Maestro (I have decided) will be version 5.1

I've already shown one cool feature that will be in this release. Here's another cool feature that just landed in trunk.

To illustrate this, here's the Map Definition in the current stable 5.0.1 release.

If you have a Map Definition of say 100+ layers, and you want to make the majority of them un-selectable, there's going to be a lot of clicking around different layers and un-ticking the selectable checkbox for that layer. Not very efficient from a usability standpoint.

You could currently take advantage of scripting to automate this task, but this usability deficiency is something worth fixing in the application itself.

So how did we solve this? Meet the revised Map Definition editor.

We now use a WinForms PropertyGrid component to represent the checkable/boolean layer properties. Why a PropertyGrid? Because the PropertyGrid has this special unique feature of being able to automagically edit not only properties of any object, but also be able to edit properties of an array of objects!

Meaning, we can now do things like batch edit the selectability of multiple selected layers

What about heterogeneous selections of groups and layers? No problem.

Due to the magic of the PropertyGrid, only the properties in common between the selected objects are presented in the grid for editing. Groups do not have a selectability setting, so this property has been omitted.

With this new feature in place, batch editing of common layer/group properties is now much simpler and faster.

Friday, 15 November 2013

FDO Toolbox has moved

FDO Toolbox has moved to github.

The removal of downloads from Google Code was the last straw. Github having support for releases was enough to convince me to make the move.

Still got to migrate assorted content from the Google Code site, but the source code is all there now.

I'll still be sticking to my update-on-every-new-release-of-FDO plan, but now that the code is on github you can get into the open source spirit by forking the repo, hacking on the code, and sending me some nice pull requests :)

Thursday, 7 November 2013

MapGuide tidbits: MgConnectionFailedException

Here's another one for the newbies

If you can't connect to MapGuide with Maestro

Or you're getting a message like this when you run your MapGuide application

It means your Web Tier to Server Tier connectivity is broken. Or to explain visually

MapGuide is a 3-tier system. When you're "connecting to a MapGuide Server", you are asking the Web Tier middleman to ask the Server Tier to do something (render a map, query a Feature Source, read an XML resource, etc, etc). If this Web Tier <-> Server Tier connectivity is broken, then the Web Tier is unable to forward any commands or operations to the MapGuide Server, hence it throws this error message back to the client application.

So what is the resolution for this? Simply restarting the MapGuide Server is enough to re-establish this broken connection.

Why did the MapGuide Server go down? Analyzing MapGuide's various log files may give you a clue as to why it went down.

On the other hand, what if you try to restart the MapGuide Server and it doesn't come back up? This is where it helps to run the MapGuide Server in interactive mode. To run the MapGuide Server in interactive mode, go to the directory where the MapGuide Server executable is located (generally C:\Program Files\OSGeo\MapGuide\Server\bin on windows and /usr/local/mapguideopensource-x.y.z/Server/bin on Linux where x.y.z is your MapGuide version number), and run the following from the command line

On Windows:
mgserver.exe run
On Linux:

If something is preventing MapGuide Server from starting up, it will most likely spit out some error message about it to the command-line 99% of the time. This should give you more information to work with.

Friday, 25 October 2013

Madness? This. Is. My. 300th post!

Now that the 300 joke is out of the way ...

This post marks my 300th post on this blog. My 70th post for this year, making 2013 my most productive blogging year thus far.

And this blog also just passed 200k visiting pairs of eyeballs!

Like my 200 post retrospective, here's my hand-picked highlight reel from my journey to 300 posts:

And we ain't even done yet! How many more records will be broken?

Going to Autodesk University?

Well I'm not going unfortunately. But one of our major clients is.

Recep Alakus from Hume City Council will be at Autodesk University 2013 to present about using AIMS and AutoCAD Map3D to manage assets and facilities.

Most of our MapGuide-related handiwork is in use at Hume City Council. So this presentation may be of interest to any of you that are going to AU.

Wednesday, 16 October 2013

Yo Adrian! I did it!

 Thank you all for lending your eyeballs to this blog. All 200k pairs of them.

Tuesday, 15 October 2013


How do you know this screenshot below is OpenLayers 3

Rotation! Can't do that stuff client-side in OpenLayers 2!

Tuesday, 8 October 2013

MapGuide 2.6 feature showcase: Fusion

Since the 2.6 preview release bundles a trunk build of Fusion, I might as well cover what's new in Fusion in addition to a whole bunch of bug fixes and minor improvements.

OpenLayers upgraded to 2.12

OpenLayers has been upgraded to the 2.12 release. This gives Fusion plenty of new toys to play with.
  • Client-zoom. If you have a Map Definition with an OpenStreetMap backdrop, the OpenStreetMap tiles will stretch appropriately if you zoom to an unsupported OSM scale

  • Improved touch support for mobile devices. Try viewing your Fusion layout on an iOS or Android device. Not that we're going to officially support Fusion for mobile devices (my recommendation is to still build a dedicated viewer or use an existing mobile-optimized viewer for mobile devices), but you might be surprised to find that the Fusion is quite serviceable on tablets/phones due to the improvements provided by OpenLayers 2.12.
  • Cleaner custom build experience. As a result of the OpenLayers upgrade, we've also took the opportunity to restructure how we keep OpenLayers under version control. Now we also keep any customizations to OpenLayers under a separate directory so that creating your own custom build of OpenLayers for Fusion is a case of extracting the 2.12 release to a temp directory, overlaying our modified files on top and then building a new OpenLayers.js which can then be incorporated into the Fusion installation
Time/resources permitting, we may look to bump this to the latest stable (2.13.1)

New Geolocation widget

The Geolocation widget taps into the new HTML5 geolocation API allowing you to pan (and optionally zoom) to your current position on the map.

Of course, the utility of this widget is somewhat diminished if you (the user) are nowhere physically within the area of the map you're looking at (like myself, based in Melbourne, Australia looking at a map of Sheboygan, Wisconsin, USA). The widget will warn you if your physical location is outside the bounds of the map.

New Coordinate Tracker widget

The Coordinate Tracker widget allows you to view your current mouse coordinates in various different coordinate systems.

Unlike MapGuide, we're leveraging Proj4js to do these transformations (because CS-Map is not available for us to use in JavaScript), and we also keep a pretty big list of coordinate systems that are convertible between CS-Map and proj4 to ensure maximum compatibility of most coordinate systems.

Improved Load/Selection performance

If you're working with a version of MapGuide that supports the new CREATERUNTIMEMAP and QUERYMAPFEATURES operations (ie. The 2.6 Preview Release), you should see improvements in map loading and selection. For large maps, you should see significant loading improvements.

Otherwise we stick to the existing set of PHP web tier glue for doing map loading/selection.

Redline Enhancements

The Redline widget also sees continued improvements

Firstly, the redline widget now supports Advanced Stylization. In terms of what you see on the map, it shouldn't be much different visually from Basic Stylization except that labels you include with drawn redline objects will always be visible regardless of scale. Previously, under Basic Stylization feature labels were subjected to "MapGuide knows best" label placement which is not a good thing to have when you've made some notes on the map and you can't see the actual notes!

The lines actually have labels too, but "MapGuide knows best" label placement has determined that it can't find a suitable place to draw a label. Point styles under basic stylization had an option to override this behaviour, to always draw the label regardless. Unfortunately, line or area styles do not have an equivalent setting.

Moving to Advanced Stylization gives us this capability for all geometry style types.

As you can see, all the labels are now visible even if not packed nicely. But at least this way, you know for certain visually whether a redline feature has labels or not.

But this is not to say we've removed basic stylization support. You can choose what type of stylization to use through the new StylizationType widget extension property.

Secondly, we've continued to improve the user workflow and continue to reduce the amount of setup steps a user needs to take. You can now specify the desired redline data store format and geometry types upfront as widget extension properties. Having these properties set turns the main redline from this

To this

No need for the user to have to choose (he/she probably has no clue). Just click the big button to start.

Thirdly, we've improved the redline editing process. The redline list box is now multi-selectable, meaning you can now select/delete/edit text of multiple redline objects at once instead of doing it one-by-one

QuickPlot Enhancements

The QuickPlot widget now supports legends. The legend is produced through the existing GETMAPLEGENDIMAGE operation.

Also the QuickPlot UI lets you configure which elements you want to show in the final PDF plot.

Try it now

If you can't install the MapGuide 2.6 preview release, we've made available a trunk snapshot of Fusion for you to download and try out.

Just extract the zip or tarball to the www directory of your MapGuide web tier installation. If you want a side-by-side install without replacing the current Fusion, just rename one of the fusion directories and change the "fusion" in your viewer URL to this renamed directory as well.

This snapshot includes the 5 MapGuide templates and is newer than the Fusion that is bundled with the MapGuide 2.6 preview release.

MapGuide Open Source 2.4.1 and newer are the versions of MapGuide that will work with this release. Versions older than 2.4.1 are un-tested and aren't guaranteed to work.

Thursday, 3 October 2013

Announcing: MapGuide Maestro 5.0.1

So ... with that problem out of the way, here's the release of MapGuide Maestro 5.0.1

This release contains 2 new features. The first one is adding in missing support for editing properties of symbol instances in a composite rule. The symbol instances dialog now has a button to edit the properties of the selected symbol instance.

This brings up a new dialog to edit the properties of the symbol instance in question

The second feature is a small enhancement to the Generic XML editor to let you re-read XML content from the originating resource. A useful feature when you need to "refresh" the XML of your current edited resource if it has changed underneath since the moment you opened it for editing.

And being a point release, it includes bug fixes from 5.0 including a fix for the annoying cursor problem in the Generic XML editor that many of you have probably encountered.


Wednesday, 2 October 2013

MSBuild gotcha in .net Framework 4.5

So I was originally going to put out the first point release of MapGuide Maestro 5.0 earlier this week, but I hit a snag in the build system that completely baffled me.

Since Google failed to reveal anything of substance on this particular issue, I figured I'd do the right and responsible thing and tell you what this problem is and how I fixed it so it can be indexed by Google so anyone else having this problem can just find this post :)

The problem

To illustrate, this is the set of build artifacts for Maestro 5.0

And here's the set of build artifacts of Maestro trunk

How on earth did the release zip file balloon out by 120MB? Well if we look at the build output directory that we then make our installer/zip files from, we see how it got to this size.

The FDO and CS-Map dictionaries for our Local Connection mode addin have been copied to the root of the output directory in addition to the addin's output directory. Our Maestro VS solution file has 48 projects. Some of these projects have unmanaged dlls and content/data files that we need to also copy across into the correct subdirectories of our main output directory.

Our build system wipes out the Local Connection mode addin directory before zipping (the zip release is our multi-platform release, where Local Connection mode is windows-only so we delete this directory), but because the FDO and CS-Map dictionary directories have been duplicated somewhere they're not supposed to be due to this particular issue, they've been inadvertently included in the zip file as a result

So that's the problem, but why did this happen?

The cause

In a nutshell, something changed with the MSBuild that is installed by .net Framework 4.5.

If you built the Maestro solution in the Visual Studio IDE (2010 or 2012) or with the MSBuild that comes with .net Framework 4.0. We got the expected file/directory structure that our build system then makes the installer/zip files from. But when we build Maestro with MSBuild 4.5, we get this strange file/directory structure.

A full verbose file-logged build with MSBuild 4.0 and MSBuild 4.5 and comparing the log files revealed the culprit.

It was these settings I had in my solution file.

I don't remember why the highlighted projects were ticked, but the highlighted items were indirect dependencies of Maestro.exe that I ticked some time in the past on the belief that building Maestro will then "pull in" these indirect project dependencies and cause them to be built as well. I did this because when I want to debug Maestro from Visual Studio for the first time, I want to make sure the addin projects were being built as well but because Maestro.exe does not reference these projects directly (it loads these addins at runtime), I had to use the project dependency mechanism in the solution settings to make sure these projects were being built when I hit F5 in Visual Studio.

It turns out with MSBuild 4.5, that these settings produced an undesirable (or is it desirable?) side-effect of any files marked Copy to output directory = Always from these projects also being copied over to the output directory of Maestro.exe in addition to their project's respective output directory.

The solution (for me)

The solution for me was to simply un-tick these dependent projects. I've conditioned myself to do a full solution build in Visual Studio anyway before I start debugging so when I hit F5, the addins will have already been built and ready to be loaded by the Maestro.exe I'm debugging, so having these projects ticked was not necessary.

Now if this is not an option. There were other options I explored that also worked for me with varying levels of feasibility

  • Use post-build events to copy the relevant content/data files instead of using the Copy to output directory item property. Even if triggered as an indirect dependency project by MSBuild, the post-build events will ensure any content/data files will be copied to their intended location. If you have lots of projects with extra files that need to be copied this may be a painstaking process.
  • Replace the Microsoft.Common.tasks file under %SystemRoot%\Microsoft.NET\Framework\v4.0.30319 with the .net Framework 4.0 copy. Because .net Framework 4.5 is an in-place upgrade over 4.0, the 4.0 copy of Microsoft.Common.tasks is replaced. This is not recommended as a viable solution. I just noted this because this worked for me. I guess the proper way to do this would be to use whatever APIs provided by MSBuild to override the various v4.5 MSBuild tasks/targets with their v4.0 equivalents to get the old behaviour. I'm not an MSBuild expert, so I can't really further elaborate on this or confirm what I just said about using MSBuild APIs is actually possible.

As for whether this behaviour in MSBuild 4.5 a bug or a feature, the jury's still out on that one. At first glance I thought it was a bug (because it sure didn't behave like this in MSBuild 3.5 and 4.0), but on second thought it does seem like a feature. If project A has manually marked dependencies B and C in the solution then logically speaking you would expect any files in projects B or C marked Copy to output directory = Always to be copied to project A's output directory in addition to their project's respective output directory.

I guess this depends on what your definition of "output directory" is. Whether it's the output directory of the referenced project or the output directory of the project doing the referencing. Either way for me, my main release roadblock was removed.

Something to keep in mind should you be moving to VS2012/.net Framework 4.5.

Wednesday, 11 September 2013

Maestro tip: Editing session resources

So ... You know about that resource ID "address bar" which I've introduced to MapGuide Maestro 5.0 since beta 4?

That thing also takes session-based resource IDs. Thus, assuming you connected as an Administrator you can use this address bar to also open session-based resources and view/edit them. A nice way to debug any code you have that works with session-based resources.

Now sadly there's currently no way to open a resource ID from the "address bar" using the Generic XML editor. So for the next release we're going to fix that, by letting you choose which editor you want to open the resource with: The designated one or the Generic XML editor

Credit to Crispin Hoult for the original discovery.

EDIT: Correction. It seems you can only view session resources at the moment with this technique and not be able to edit them as saving will prompt you to save back into the site repository. We're gonna have to do something about that.

Saturday, 7 September 2013

Fresh from the lab

I'm sure we all agree that software releases are generally marketed like a bunch of bullet points.

I think I found one such bullet point for the next post-5.0 release of Maestro!

Tuesday, 3 September 2013

Maestro tip: Re-organizing editor windows

Sometimes, this author himself discovers something useful about the application he built that he himself didn't know was possible but with some reflection and hindsight, it was obviously clear such a thing could be possible due to some important decisions made in the choice of libraries, components and design.

In this particular case: the decision to use the DockPanel Suite library for MapGuide Maestro 5.0.

DockPanel Suite allows Maestro to lay out its top-level UI elements in a flexible manner akin to Visual Studio. So what this means is that if you have a bunch of open editors like this

You can drag one of the editor tabs and pull it out. You'll get a nice visual indicator of where you want to drop the editor tab just like in Visual Studio.

Release the mouse at the desired drop location and presto!

Very useful if you ever want to see 2 or more open resources side-by-side for basic comparison. Something nice to remember if you have a lot of screen real estate to play with

Monday, 2 September 2013

MapGuide tidbits: Coordinate System support in mg-desktop

Here's a quick tidbit about Coordinate Systems in mg-desktop.

Whether you're using the zip distribution of mg-desktop or you installed the cs-map-dictionaries NuGet package, your mg-desktop application will not be supporting the full set of several-thousand-odd coordinate systems that any other application using CS-Map does.

The reason for this is simply: size.

NuGet has a 30mb limit on its package files, so the decision was made to have a stripped-down set of coordinate system dictionary files to support the NuGet user story. Similarly, the zip distribution of mg-desktop contains a stripped-down subset for the same reason: If you're building an mg-desktop application, you probably don't need to support all 4000+ coordinate systems and chances are the coordinate system you're working with will be in this stripped-down subset.

So what coordinate system files did we strip out for mg-desktop? All the country-specific grid files have been stripped out.

So now the question becomes: How can I use a coordinate system that's in one of these country grid files in my mg-desktop application?

The answer is to simply take a copy of the grid file(s) from an equivalent installation of MapGuide Open Source (ie. A MapGuide with the same major.minor version number as your version of mg-desktop). If you don't have MGOS installed, you can take a copy of the grid file(s) from the equivalent MapGuide InstantSetup bundle.

Drop one or more of these folders into your mg-desktop application's Dictionaries folder and your mg-desktop application should now support the coordinate systems defined in this grid files as well.

Monday, 26 August 2013

MapGuide 2.6 feature showcase: New code samples

If you're uncertain how the new CREATERUNTIMEMAP and QUERYMAPFEATURES can help you, then have no fear: For 2.6, we've bundled a whole bunch of new code samples to show you how using everyone's favourite web mapping library: OpenLayers.

When you install the 2.6 preview release, make sure that the OpenLayers Samples feature is enabled.

After installation, load in the Sheboygan sample package using Maestro or the MapGuide Site Administrator and then go to the new samples landing page link on the start menu.

To simplify the installer, all the code samples have been aggregated into this single landing page. Just be aware that some of these links might be broken if you didn't choose to install the respective samples from the installer.

If you look at the bottom of the page you'll see a whole bunch of new samples demonstrating OpenLayers integration with MapGuide. The key thing to note with all these new samples is that none of them involve any .net/Java/PHP code using the MapGuide API. They are all pure client-side HTML/JavaScript communicating with the mapagent.

Have a play around and you may be surprised what you can do with just OpenLayers and jQuery in MapGuide 2.6. Note that mixed map and the Google/OSM examples won't work out of the box.

This is because these samples work with a Map Definition that is not part of the Sheboygan dataset. You can find the required Map Definition XML document in the directory where the sample is actually physically located

Load this document into the specified resource id via Maestro or the mapagent test pages. Reload the sample page and it should now work.

These samples aren't set in stone yet. We could probably automate/simplify this process of setting up example data files somehow.

Nevertheless, hopefully these new samples give you some ideas and/or inspiration.