Monday, 16 November 2026

Announcing: MapGuide Open Source 4.0.1-Test

I am pleased to announce the release of MapGuide Open Source 4.0.1-Test

The reason this is a 4.0.1-Test instead of just 4.0.1 is because the volume of changes since 4.0 is such that I wasn't comfortable with going straight to a 4.0.1 release. I needed a -Test release and several weeks of breathing space to collect any issue reports and be able to act on them to make sure we didn't miss anything important.

Before we continue, I want to make this declarative statement crystal clear in no uncertain terms:

This release was (un-repentantly and un-apologetically) made with AI assistance from DeepSeek. I have made no secrets about my AI usage in the lead-up to this release. If the fact that my usage of AI offends your sensibilities and makes MapGuide "AI slop" in your eyes, then I wish you all the best in looking for an alternative GIS web mapping server. I'm not going to expend any efforts to convince you to stay. It is because of AI assistance that I am able to make this release *now* instead of probably ... a year from now if I were to apply regular human effort to implement the volume of changes in this release.

With that statement out of the way, here's what's new in this release. It's a big list, so strap in!

MapGuide changes

  • Updated bundled Apache, Tomcat and PHP (mitigated against php2shell)
    • Apache httpd 2.4.71
    • Tomcat 9.0.123
    • PHP 8.3.36
  • Windows installer migrated to Wix 6.x. If you encounter installer issues, let us know on the mapguide-users mailing list ASAP.
  • New experimental OpenAPI spec + swagger UI for the mapagent. The mapagent is not a RESTful interface, which presented some interesting challenges describing the API surface with OpenAPI, but we've made it work for the most part!
  • New experimental Linux support for MapGuide Portable
    • The OSGeo.MapGuide.Portable nuget package can now be used to build apps for both Windows and Linux. The viewer nuget packages built on top of this are still Windows-only.
  • Ubuntu installer script now optionally lets you install msttcorefonts
  • Linux installer scripts now auto-probe and auto-configure known font directories in serverconfig.ini
  • MultiGeometry/GeometryCollection instances now render and select properly
  • Massive memory leak sweep from ASAN-instrumented test runs
  • Massive hardening sweep to address potential buffer overflows and input validation gaps
  • Fix MgNullPropertyValueException when selecting features and attribute data contains NULL values
  • Fix web tier init failures leaving the process permanently broken and improper web tier teardown
    • Should improve stability if using IIS and reduce the need to force app pool recycling
  • Fix MgDrawingService.EnumerateLayers() API not working on Linux
  • Fix leaking byte arrays when passed to MgByteReader.Read() for Java and PHP
  • Fix incorrect distance measurement on coordinate systems like Web Mercator
  • Fix MgNamedCollection potentially holding stale refs
  • Fix incorrect arc calculations
  • Fix name element duplication for KML elements
  • Fix excess KML placemark elements when Advanced Stylization is enabled
  • Fix correctness of "batch sorted block" feature join algorithm
  • Fix Advanced Stylization area symbolization clipping not applying
  • Fix cases where negative render times could be reported by performance report
  • Fix assorted incorrect mapagent behavior
  • Fix striped raster rendering in some cases
  • Improve error message quality when its localized form cannot be retrieved
  • Improve robust CPU perf counter reading on Linux
  • Document log properties in serverconfig.ini
  • Improved BerkeleyDB error message quality (some were previously masked as "bad memory allocation")
  • Improve handling of bigger selections and properly escape id values with single-quotes

FDO changes

Core/General
  • Massive memory leak sweep across core and various providers. Debug runs of FDO core + provider test suites now produce 0 leaks on both Linux and Windows.
  • Massive hardening sweep to address potential buffer overflows and input validation gaps
  • GenericRdbms: The FDO_TRACE_FILE facility is now available for Linux
  • GenericRdbms: Fix various reported capabilities vs reality mismatches
  • GenericRdbms: Harden against queries referencing non-existent classes and properties
  • Use the safer mkstemp API for temp file name generation
  • Honor indentation settings when writing feature schemas to XML
  • Fix XmlFeatureSerializer not honoring XML flags
  • Fix properties with NULL values not included in XML output
  • Improve handling of large chains of OR conditions
  • GenericRdbms: Each FDO provider is now is own deb package on Ubuntu instead of all being bundled under a monolithic fdo-rdbms package.
SDF
  • Fix incorrect NOT IN behavior when NULL values are involved
  • Gracefully handle unknown ordering fields in extended select command
SHP
  • Fix GetSpatialContexts crash when schema cache is invalidated
SQLite
  • Fix filtering on numbers with more than 5 decimal places
  • Fix filtering on dates returning wrong results
  • A "Default" spatial context is now returned if the data store has no coordinate system metadata
  • Properly fix thread-safety on both Windows and Linux when building internal metadata.
    • The deadlock on Linux (reason for original fix being rolled back) was due to using a non-recursive pthread mutex.
OGR
  • Re-architect provider internals for better stability when consumed from a .net client FDO application
  • MultiGeometry/GeometryCollection instances are now read by the provider properly
  • Fix "Invalid index: -1" errors from missing properties
GDAL
  • Prevent blank horizontal stripes when up-sampling rasters
  • We try to include the underlying GDAL error message in more places where exceptions are thrown
  • Update configuration doc XML schema to cover missing elements
King Oracle
  • Fix issue reading negative int64 values
  • CLOBs are now read properly on Linux
  • Unicode strings now insert properly on Linux
SQL Server Spatial
  • The SQL Server Spatial FDO provider is now available for Linux
    • You will need to install the Microsoft ODBC Driver for SQL Server. The ubuntu installer package will install this for you automatically
  • New experimental environment variable (FDO_SQS_PERF) that improves provider performance in various areas
    • Set =1 to opt-in
  • Provider now prefers Microsoft ODBC driver 17/18 before falling back to SQL Server Native Client.
  • Fix poor error message when inserting a row into a table without a primary key
  • Fix spatial contexts with dots in its name not being destroyable
  • Fix query with explicit property list losing all geometry types on its query result geometry property
  • Queries against geography columns apply polygon vertex ordering fixes if required
PostgreSQL
  • Curve geometries now auto-linearized for versions of PostGIS that do not natively accept curve geometries in their spatial operators
  • Now uses proper bind variables for geometry values, eliminating the ugly wkb->hex->wkb roundtrip in SQL query generation
  • Fix failing queries that involve coalesced geometry expressions
MySQL
  • Fix incorrectly reported column types
  • Fix column aliasing in joined queries
ODBC
  • New experimental Linux support for the ODBC FDO provider
    • Previously, we built the provider but did not vet any supported behavior
    • Vetted ODBC drivers for Linux (based on test suites)
      • mdb-tools
      • ODBC Driver for SQL Server
    • Your mileage may vary for any other drivers
WMS
  • Fix "no data" value reported by provider

Download Links

Trac has been on the fritz lately, so the release notes which has the download links have been mirrored to my mapguide-fdo-docs repo on GitHub.

4.0.1-Test release notes on GitHub

All of this ... just works?

As I am doing my final spot checks on a MapGuide Open Source 4.0.1-Test release, I am lamenting that MapGuide Maestro was still windows-only and even though a multi-platform rewrite is in my plans, that is in the distant future. Meaning that to spot-check functionality on an MGOS Linux installation, I'd have to either:

  1. Make raw HTTP requests to its mapagent (painstaking)
  2. Spin up a Windows VM to run Maestro that connects out to the mapagent on that MGOS Linux installation (less painstaking, but still painful)
But then I thought a bit harder. Thanks to the efforts of Lord Gaben, gaming is now viable on Linux. Most windows games that don't use invasive kernel anti-cheats "just work" now out-of-the-box on Linux. It's part of the reason I was comfortable jumping ship from Windows 10 when it went EOL last year.

But I have been viewing this strictly from a gaming context, maybe we can apply that same logic to windows apps in general?

I go and download the latest zip release of MapGuide Maestro from GitHub, extracted the contents to some folder.

Then I open a terminal in that folder and ran: 

wine Maestro.exe

And ... it just works!





This is on Fedora 44, my daily driver OS and one of the major Linux distros!

Does Maestro under Wine operate flawlessly? Not sure. YMMV. Does this invalidate the need for a multi-platform rewrite of Maestro? Not exactly, that plan is still in place. But this discovery is a nice stop-gap measure to tide the Linux users over until then!

So if your Linux distro can run Steam, it can probably run Maestro as well!

Thursday, 22 October 2026

php2shell and MapGuide

As you all know by now, the php2shell vulnerability was disclosed and is wreaking havoc all across the technology landscape wherever a PHP installation is involved as everybody is frantically patching their PHP installs to mitigate this vulnerability.

Since MapGuide bundles PHP, this vulnerability sadly also affects us as well and I feel obligated to at least post something about this.

So here's the current situation of this vulnerability in the context of MapGuide.

1. The next release

The upcoming 4.0.1 release already bundles PHP 8.3.36 that was released today to address this vulnerability, so no problems there. While that covers future releases, what about mitigating your current MapGuide installation?

Before we continue, I want to make it clear that the following mitigation procedure only applies to MapGuide Open Source 4.0. If you have an older version of MapGuide, its bundled PHP is out of the version range where a fix for php2shell is available, so unfortunately you are on your own.

2. Mitigating your MGOS 4.0 install (Windows)

The good news is that our PHP MapGuide API binding is binary compatible with newer releases of PHP 8.3, so in terms of mitigation. It is as simple as downloading a newer zip binary release of PHP 8.3, unzipping it to the Php directory of your web tier installation and then bringing across the php.ini and the MapGuide dll files from your older PHP install and you're good to go.

So firstly, stop the actively running web server (IIS or Apache httpd)

After that, you want the zip download of the VS16 Non Thread Safe build


Then rename your current Php directory in your web tier installation directory to something like PhpOld.

Then extract your downloaded zip file to the Php directory in your web tier installation directory.

Then you want to bring across the following files from PhpOld to Php, overwriting any files as necessary.

ACE.dll
GEOS.dll
lib_json.dll
MgFoundation.dll
MgGeometry.dll
MgHttpHandler.dll
MgMapGuideCommon.dll
MgMdfModel.dll
MgMdfParser.dll
MgPlatformBase.dll
MgRenderers.dll
MgStylization.dll
MgWebApp.dll
MgWebSupport.dll
php.ini
xerces-c_3_1mg.dll
ext/ACE.dll
ext/GEOS.dll
ext/lib_json.dll
ext/MgFoundation.dll
ext/MgGeometry.dll
ext/MgHttpHandler.dll
ext/MgMapGuideCommon.dll
ext/MgMdfModel.dll
ext/MgMdfParser.dll
ext/MgPlatformBase.dll
ext/MgRenderers.dll
ext/MgStylization.dll
ext/MgWebApp.dll
ext/MgWebSupport.dll
ext/php_MapGuideApi.dll
ext/xerces-c_3_1mg.dll

Then restart your respective web server and you're now using a bundled copy of PHP that is mitigated against php2shell.

3. Mitigating your MGOS 4.0 install (Linux)

The Linux story is a bit harder. We provide binaries for convenience, but binary patches are a different affair.

The main problem in terms of convenience is that PHP is only offered as a source tarball on Linux. MapGuide uses the same bundling strategy on Linux as it does on Windows, so it does not take advantage of any distro-supplied PHP.

As a result, you will have to build everything from source.

For the most painfree build experience, you can use the same docker-based build system that I use to produce binaries for Linux. If you check out the 4.0 svn branch, it will already have the updated PHP tarball.

4. Thoughts on our PHP strategy going forward

This incident has really soured me on the idea of bundling PHP with MapGuide. I'm evaluating several options on reducing the blast damage from such massive PHP vulnerabilities going forward:
  • No longer bundle PHP/httpd for the Linux build of MapGuide at least. Instead we go for integrating with whatever PHP/httpd is offered by the distro (assumed Ubuntu). This way mitigating any future vulnerabilities is now the distro's problem, not ours.
  • Or we retain the PHP bundling strategy, but pivot away from bundled PHP being a near-essential component. Why is it near-essential currently? We have various apps (mapadmin/schemareport/fusion/etc) that are written in PHP, so we require it. So how can we make PHP no longer essential? By rewriting mapadmin/schemareport/fusion/etc in .net which has a much better multi-platform and mitigation story. If there is a vulnerability in some .net version, we can just recompile these apps with a newer .net without said vulnerability and be able to ship these updated apps as easy drop-in replacements. Modern .net lets us publish self-contained apps, which negates the need to bundle a runtime environment (the exact problem we have right now with PHP), which makes .net an attractive option for a rewrite. The only problem is the effort in doing the rewrite itself! 
Either way, whatever option we go with, it won't take effect in the immediate future. So future 4.0.x releases of MapGuide will unfortunately still have to go with bundling PHP.

Wednesday, 23 September 2026

And now for something completely different

For those who don't know ...

I have been (and still am) an avid player of Magic: The Gathering since 1995 when Ice Age was released. There was a solid near-decade-long hiatus starting in the 2010s when making money in my software dev career obviously took higher priority than turning cardboard sideways, but soon went back on the cardboard crack train when this hiatus ended.

Over time, my MTG card and deck collection has obviously grown to levels that mental cataloguing/inventory of the collection in my brain no longer cuts it. I need to know where every playable card is at any given time so that when I build a deck, I can easily know if I have a given card for a given quantity, and not waste $$$ buying singles from my LGS or online when I actually have the cards in question.

Obviously this means looking for a tool for card collection management and tracking, but most of the solutions are for smart phones or are websites. I want to track my collection locally from my desktop computer, not from my phone or some third party website.

So as a software developer by trade, the solution was obvious: Build my own MTG collection tracker!

Since this need for a collection tracker came around the time I had concluded my Avalonia test run, this was also the perfect project to fully dive in to building an actual multi-platform .net GUI application using Avalonia.

So after 2 years of development and strong internal dogfooding tracking a personal collection of over 10000 cards, I am ready to reveal this project to the public.

Introducing ... the MTG collection tracker (totally original name! Yes, I know)

This is a .net multi-platform desktop application using Avalonia. On Linux, which is now my daily driver OS after the forced migration from the (end-of-life) Windows 10, it is shipped as an AppImage, making the app an easy single file you can double-click to run.

Collection data is stored in a SQLite database via EFCore. It uses the Scryfall API for card data/images and downloads price data on-demand from MTGJSON, which lets us do things like tracking price history for every card.


Some other key features of the app include:

Deck management and viewing



Wishlist management, so you know what cards you are intending to buy or trade for.


My most used feature: An easy way to find out if you can build a given deck based on your current tracked collection, with a button to easily add the cards you don't have to your wishlist.


General note taking capabilities


And finally, the end result of early DeepSeek evaluation after the GitHub Copilot rugpull: A crude, but functional play-testing surface for any deck in your collection!


So if you play Magic like me and have a need to track your collection and the existing solutions out there don't cut it for you. Maybe this app will fit the bill for you, like it has for me.

Project on GitHub

Tuesday, 22 September 2026

For the price of a cup of coffee ...

Our DeepSeek credit spend has yielded thus far:

When used properly (let's call it: vibe, but verify), AI is indeed a beneficial force multiplier of one's existing capabilities. I certainly wouldn't have achieved this volume of MapGuide and FDO wins in such a short time-frame otherwise!

And the spend has only been equivalent to a cup of coffee!

And we're just getting started!

Sunday, 13 September 2026

What happened to that plan?

5 months ago, I laid down the plans for what was going to happen going forward with my various open source projects. But after that post, it has been nothing but ... silence! If you were to look at my GitHub contribution graph, there was also a noticeable drop-off there too.

So what happened?

What happened was there was a major rug-pull. GitHub copilot changed their pricing model to usage-based billing on June 1 and that completely threw by GH copilot powered plans into complete disarray. The existing subscription at that point pretty much amounted to ~30 spins on the AI slot machine per month, hoping it will produce the outcome I desire and that was just untenable for something I am paying out of my own pocket!

So come June 1, I terminated my GitHub copilot pro subscription and pondered what my next moves were going to be. I wasn't going to give up on the productivity gains that agentic coding gave me, so the option was clearly to look for alternative AI coding provider. Because try as I might (I religiously keep watch on advancements in LocalLlama), locally hosted AI coding models is not (yet) tenable on my personal hardware. I bought that PC to 6 years ago to last a decade at least, and it will still last a decade as long as you give up on locally hosted AI models as desired workload.

I eventually settled on Deepseek and straight away, its payment model was very attractive to me: Just load up your account on credits and reload when credits start running low. This was a low risk approach where I loaded up $20 $10 USD in credits, give it a spin on my various open source projects. If Deepseek didn't pan out for my use cases, no harm, no foul. I simply don't reload with any more credits. But if it did work out for me, I can just load more credits as I go.

So as my initial $20 $10 load is down to its final dollar after several months of sporadic evaluation. I can confidently say that Deepseek adequately meets my AI coding agent needs while maintaining the "bang for buck" that I used to have with GH copilot before their June 1 rug-pull. I will lose some capabilities from GH copilot (cloud agents was nice), but they are acceptable losses.

So what that means in the grand scheme is that I should start ramping up my OSS dev machinery again and resume the plans that I had stated 5 months ago. Our regular broadcasting will resume shortly!

Thursday, 9 April 2026

New plans and stuff

So after finally getting MapGuide Open Source 4.0 out the door, I took a self-imposed hiatus from all things mapping/GIS related for several months, permanently moved from Windows to Linux as my daily driver OS just in time before the end of Windows 10 support, and also to mentally recharge and savor the relief of having this major burden (of releasing MGOS 4.0) being finally lifted off of my back.

I now return with a renewed vigor and some rough roadmaps for things going forward in MapGuide and my other various projects. Part of that renewed vigor is due to the advent of ...

GitHub Copilot

In the past few months in my day job, I have been exposed to GitHub Copilot and it has changed the way I build and ship software, some changes bad, some changes good. Say what you will about AI (or AI-generated code/content) in general, but GitHub Copilot (or any other AI coding assistant) has ultimately been a net positive for me.

What separates how I use AI coding assistants from most depictions of "vibe coding" is that I know the technical and architectural fundamentals of what I am actually after. So I know when GH Copilot is generating what I'm after and when it's generating garbage, and knowing the right prompts to guide it back on track if it starts going off the rails, or know when to cut my losses if the situation is un-salvageable.

So with several months of GH Copilot usage at work, I have been thoroughly convinced that I should get a GH Copilot pro subscription for my own personal use. So last month, I finally bought a GH Copilot pro subscription and ... proceeded to blow my monthly allowance of usage credits in 2 weeks! ðŸ˜‚

But in those 2 weeks, I was able to make some major progress in mapguide-react-layout, knocking off some long standing technical debt and feature requests, some of which you'll see in future dev diary updates on this blog. The productivity gains were massive and turnaround times were quick! A new month has rolled over and with that, a reset of my monthly allowance and I have since learned to judiciously use GH Copilot in a less wasteful manner.

So, now armed with GH Copilot, I have a rough roadmap of things I want to achieve in my various projects, which are all outlined below. So let's start with MapGuide.

MapGuide Open Source

The next release of MapGuide Open Source will be 4.0.1. It will be a bug fix release and include any updated web tier components and upstream FDO fixes since the 4.0 release.

Since permanently moving to Linux as my daily driver OS and understanding that I will still need to produce Windows builds of MapGuide and FDO, I've been re-establishing my windows dev environments for MapGuide/FDO inside a virtual machine and reinstalling all the necessary dev tools. 

One surprise that caught me off-guard was installing Visual Studio 2026 Community Edition. Even though MSVC 2019 is the standardized windows compiler for building MapGuide/FDO on Windows, we can install older compiler workloads on newer releases of Visual Studio. So as part of reinstalling all the required dev tools, I thought it would be a simple case of installing VS 2026 with the MSVC 2019 compiler workloads and everything should be all good, right?

Well, near the tail end of my first MapGuide windows build inside this new VM, I hit a snag on the Windows Installer portion. It turns out our WiX 3.x installer projects are no longer supported in Visual Studio 2026! I was not going waste time and disk space to install VS 2022, so I looked at what options we have for Visual Studio 2026. The answer was to migrate our installer projects to WiX 6.x.

Before GH Copilot, the migration process would've been tedious, having to read migration docs, assess the impact of any breaking changes, etc, etc. But with GH Copilot, I was able to migrate and iterate rapidly towards a WiX 6.x windows installer project that successfully builds and produces a MSI installer.

Now here comes the tedious part that GH Copilot cannot help me with. I still have to manually test this Windows installer, making sure all the feature toggles, custom actions, registry and start menu registrations still work as before and I expect this to take several weeks.

Once this updated Windows installer has been verified as working, there'll be a 1-2 week window of incorporating any bug fixes and updated web tier components before putting out the 4.0.1 release.

mapguide-rest

We will start wrapping up various loose ends on this project. The next release will be 1.0 RC7 and will:
  • Drop support for versions of MapGuide Open Source older than 4.0.
  • Represent mapguide-rest as being feature complete. RC7 to final will be bug fixes only.
I expect GH Copilot to pull heavy duty in helping me knock off all of these long standing items.

mapguide-react-layout

The next release will be 0.15. It will have some exciting new features that you'll see in future dev diary entries on this blog, but the main feature will be to fully decouple ourselves from the Blueprint UI toolkit. Blueprint gave us a nice cohesive set of UI building blocks, but our production bundle sizes have paid a price for this convenience, not to mention that integrating this viewer into other projects that use other UI libraries is problematic as Blueprint is always included, whether you like it or not.

As part of this dev cycle, I've been taking inventory of everything in Blueprint that we actually use and refactoring their usages through a layer of indirection of "abstract UI components" so that we can supply an alternative implementation that is more bare metal and whose appearance and styling can be customized through good ol' CSS.

0.15 will be on the horizon upon the completion of this Blueprint replacement. GH Copilot has paying massive dividends in terms of progress and momentum on this particular project, so I am hoping for a fast turnaround on these remaining items.

MapGuide Maestro

Finally we come to MapGuide Maestro. I will finally bite the bullet and put an end to this endless series of 6.0mSomeNumber releases by putting a final MapGuide Maestro 6.0 release. This 6.0 final release represents the end of MapGuide Maestro in its current form as a Windows Forms based MapGuide authoring and administration tool.

After the 6.0 final release is out. MapGuide Maestro will be rebuilt from the ground-up as a true cross platform MapGuide authoring and administration tool. It will be built on modern .net (and all of its patterns and practices) and our ability to have a true cross-platform UI will be achieved through the use of Avalonia as our UI toolkit. 

A little experiment some years ago plus experience from building/maintaining a separate personal project that uses Avalonia for the UI (not yet announced/revealed on this blog, maybe I will someday) and once again armed with GH Copilot, I have great confidence in pulling off a ground-up rewrite.



And that is a peek into what's in store in the near future. Exciting times are ahead!

Sunday, 12 October 2025

Announcing: MapGuide Open Source 4.0 Final (yes, you read it right!)

I am pleased to announce to final release of MapGuide Open Source 4.0!

It has been 6 years, 6 months and 14 days since the last major stable release (3.1.2). What started as something that was supposed to be the 3.3 release stretched out to what is now the 4.0 release. Maybe some things could've been done better to not make this release gap so big, but things transpired the way they did and what's done is done.

Download

Wednesday, 10 September 2025

Announcing: MapGuide Open Source 4.0 RC1 and MapGuide Portable

We're on the home stretch now!

The first (and hopefully only) release candidate of MapGuide Open Source 4.0 is now available.

Changes since Beta 3

This release has the following changes since Beta 3:

  • A new .net repository admin tool that replaces the existing series of PHP scripts that required a super-ancient PHP binary.
  • Apache httpd updated to 2.4.65
  • PHP updated to 8.3.25
  • Tomcat updated to 9.0.108
  • Plugged a memory leak in selection processing if it throws an FDO exception
  • The .net bindings now have experimental support for Linux

New nuget packages

As a test run for the final release, the .net bindings have also been published to nuget.
To get started building a .net MapGuide application for 4.0 RC1, install the above packages (ver 4.0.0.10185) via the nuget package manager or via the dotnet CLI.

Need an idea or example of how to build a MapGuide application using these packages in modern asp.net core? Have a look at the mvc core sample.

As already stated, these bindings also have experimental support for Linux, meaning you can publish your .net application to run on Linux as opposed to Windows. Here's a screenshot of the mvc core sample application published to and running on Linux, talking to a MapGuide Server also on Linux being contacted from a web browser on Windows.


MapGuide Portable

The sub-project formerly known as mg-desktop is now known as MapGuide Portable (or mg-portable).

Why the name change? The "desktop" moniker felt too constricting. You're not exclusively tied to building just desktop applications. You could build "headless" console applications or maybe even MapGuide Server-free web applications with this library. As such, "portable" is the better moniker as it is a MapGuide Platform that goes with your application, in effect being portable.

Why are we mentioning MapGuide Portable in a 4.0 RC1 announcement? Because our extensive work on generating API bindings with vanilla SWIG had some minor splash damage. As MapGuide Portable builds on top of the shared Foundation/Geometry/PlatformBase series of libraries, we'd be leaving this in the lurch if we got these new fancy .net bindings for MapGuide proper, but still had to resort to the old crufty legacy bindings for MapGuide Portable, so extra effort was spent to get the .net bindings for MapGuide Portable to not only be generated through vanilla SWIG as well, but also retain package modularity by being able to depend on the new Foundation/Geometry/PlatformBase nuget packages.

The end result is a new series of nuget packages that you can use either in a legacy .net Framework 4.8 WinForms application or a WinForms application in the new modern .net!


Unlike the proper MapGuide API nuget packages, the MapGuide Portable packages are still Windows-only (since WinForms is tied to Windows). The new MapGuide Portable packages are:
The older mg-desktop-* packages on nuget should be considered deprecated and you should move over to these new MapGuide Portable nuget packages as these packages support modern .net while the mg-desktop-* packages can only be used in legacy .net Framework.

The final stretch

Between RC1 and the Final release I will be primarily focusing on an API documentation sweep, getting functional API documentation up and ready. Only bugs of a show-stopping nature will be addressed and only if such bugs have easy means of reproducing (I can only do so much). I am allowing for up to a month for this development window before the Final release, so that we can wrap things up before Windows 10 reaches end of life, just over a month from now.

This long and arduous journey is almost at an end!

Friday, 6 June 2025

Announcing: MapGuide Open Source 4.0 Beta 3

A new beta release of MapGuide Open Source 4.0 is now available.

The main driver for this release is updating an assortment of bundled components:

  • PHP updated to 8.3.20
  • Apache httpd updated to 2.4.63
  • Tomcat updated to 9.0.104
Sticking with PHP 8.1 would've meant that come November this year we would be bundling something that would've been end-of-life. Updating our bundled PHP to 8.3 gives us the maximum possible runway in terms of support (on the PHP side) as its end-of-life is 2.5 years from now.

This release also plugs an assortment of memory leaks found in:
  • The King Oracle FDO provider
  • Rendering of tiles from tile sets
  • Rendering of watermarks
  • In-memory feature joins
  • Render profiling

Thursday, 16 January 2025

Announcing: mapguide-react-layout 0.14.10 and MapGuide Maestro 6.0m13

We start the new year with a double-header release of:

  • MapGuide Maestro 6.0m13
  • mapguide-react-layout 0.14.10
What prompted these new releases other than (it's long overdue)?

Namely, it is to do with a notification I received about the coming deprecation (and eventual shutdown) of the epsg.io service that both pieces of software use to do proj4 projection lookups for any given EPSG code. This service will shutdown in Feburary (next month) and transition over to the MapTiler coordinates API. This new API requires an API key to use their services.

In the context of these 2 projects, the API key requirement introduces too much friction.
  • If I take up the offer to use MapTiler, I have to register and bake my API key into both Maestro and mapguide-react-layout and am now responsible for API usage/monitoring under this key from users I have no control over. Last thing I want to deal with is bug reports from users because, let's say for example: proj4 lookup is broken because the API is no longer accessible for my API key due to quota exceeded. I just don't want to deal with such a scenario.
  • Which means the alternative is to change the code to the extent that users can "bring their own API key", taking such API key usage/monitoring concerns out of my hands. This too is also too much hassle. I just want to do EPSG code to proj4 lookups nothing more nothing less!
If I was building a bespoke/custom mapping application for a client with EPSG > proj4 lookup functionality, then this API key requirement would not have been an issue, but this is not the case here.

So in light of these concerns, instead of moving to MapTiler coordinates. Instead I have opted to use spatialreference.org to do EPSG -> proj4 lookups. No API keys are required there.

So since this was the main driver for needing to put out new releases of MapGuide Maestro and mapguide-react-layout, we might as well take this opportunity to lump in some other fixes and minor changes, which are detailed below.

mapguide-react-layout changes

(reworked) Stamen and (new) StadiaMaps support

Stamen tiled layer support was broken for some time since it was taken over by Stadia Maps. I had already taken care of this in the VSCode map preview extension which had the same problem. But for mapguide-react-layout, the fix was a bit different due to it not using the latest version of OpenLayers and it is too much work right now to update to the latest OpenLayers in mapguide-react-layout.

So what was done for mapguide-react-layout instead is to create these Stamen tile layers as XYZ layers  instead of using the (now broken for that OL release) Stamen tile source. This works because Stamen tiles are ultimately tilesets using the XYZ web mercator scheme. The only other changes is that a Stadia Maps API key is required. So if your appdef defines one or more Stamen tile layers and you didn't specify an API key, you'll get the same startup warning you get when you have Bing Maps layers and didn't specify a Bing Maps API key


But if you do provide a Stadia Maps API key, you'll get the Stamen layers you've seen before.


Since a Stadia Maps API key is now required, we've also added support for other tilesets provided by Stadia Maps, like:

Alidade Smooth


Alidade Smooth Dark


Alidade Satellite


Outdoors


So if you are loading your mapguide-react-layout viewer from a Flexible Layout document, where do you need to specify this new Stadia Maps API key?

That's where the new release of MapGuide Maestro comes in to help!

MapGuide Maestro Changes

Stamen Maps (changed) and Stadia Maps (new) support

The Fusion Editor has reworked Stamen Maps support and added support for Stadia Maps


You'll notice that Stamen and Stadia Maps have 2 variants for every layer.
  • A specialized version
  • An XYZ layer variant ("... as XYZ")
What is the deal with this?

This was done so that if you are still authoring Flexible Layouts for Fusion instead of mapguide-react-layout, you can still view Stamen and Stadia Maps layers in Fusion through the existing XYZ layer support that is available in Fusion as demonstrated in the screenshot below, using the Stadia Maps alidade_smooth_dark tileset + API key.


So depending on the context:

If you are authoring a Flexible Layout for Fusion, choose the "... as XYZ" version and enter the Stadia Maps API key when prompted.

Otherwise, if you are authoring a Flexible Layout for mapguide-react-layout, choose the specialized version and enter the Stadia Maps API key in the provided field


This release of mapguide-react-layout will read the Stadia Maps API key from this new setting in the Flexible Layout when initializing with Stamen and Stadia Maps tile layers.

Using spatialreference.org for EPSG > proj4 lookups

As stated above, the projection management dialog of the Fusion Editor now uses spatialreference.org for resolving proj4 strings from EPSG codes


Other changes

  • WMS Feature Source Editor: Improved the responsiveness and usability of the Advanced Configuration Dialog
  • You can finally copy (ctrl-c) content in the IronPython console!!! You can now truly iterate on automation scripts by finally being able to copy the snippets of working Python code you just entered and eval-ed.

Download

Wednesday, 13 November 2024

Announcing: mapguide-rest 1.0 RC6.1

I've taken a momentary break from our (admittedly) glacial pace of MapGuide development to put out another release of mapguide-rest 

This release includes the following changes:

  • Fix missing reverse routing on selection overview
  • Fix bad feature query preparation when querying against watermarked layers
  • Relax strict-typing on MgReaderToGeoJsonWriter::FeatureToGeoJson() so that it can work with MgPaginatedFeatureReader allowing pagination to work again
  • Added missing properties parameter to swagger defn for session-based feature selection route

We now return to regularly-scheduled programming of trying to get MapGuide Open Source 4.0 to the finish line.

As for mapguide-rest, I envision at least once more major RC *after* the final release of MapGuide Open Source 4.0 before finally wrapping things up on development work and pulling the trigger on the mapguide-rest 1.0 final release. Enough of this RC-after-RC business!

Friday, 18 October 2024

Announcing: vscode-map-preview 0.7.0

It has been brought to my attention that my vscode-map-preview extension now produces 401 responses for stamen map tiles, which has prompted me to put out a new release of this extension to better handle this situation.

This new release updates OpenLayers to 10.2.1 and now hides stamen tile layers from the base layer switcher if you don't have a Stadia Maps API key in your extension settings as this API key is now a requirement for viewing stamen tile layers.

Thursday, 15 August 2024

Announcing: MapGuide Open Source 4.0 Beta 2

This took way longer than expected, but the 2nd beta release of MapGuide Open Source is now available.

The main driver for this release is to update our various web tier components to their latest respective versions:

  • PHP 8.1.29
  • Apache httpd 2.4.62
  • Apache Tomcat 9.0.89
In addition to that, the Beta 2 release includes the following changes:

  • Installer
    • Newer libpq.dll (PostgreSQL 16.3) bundled with Windows installer
  • Server Tier
    • Fix instability on Linux due to criss-crossed resolution of sqlite3 and geos symbols to our shared libraries instead of the distro-provided versions
    • Repository admin tools have been momentarily pulled from this and future beta releases until the admin scripts have been updated and/or rewritten. As a workaround, use MapGuide Package files to backup/restore repository content
    • Removed immature MVT tile rendering support. If you want to produce Mapbox Vector Tiles, use any tool from this list
  • Web Tier
    • Fix QUERYMAPFEATURES SelectionKey containing a newline char, breaking client-side reconciliation of selected features
    • More PHP8 compatibility fixes in PHP AJAX Viewer
    • Fix bad instanceof exception checks in PHP AJAX Viewer
    • More PHP8 compatibility fixes in Site Administrator
    • Buffer overflow fixes in WMS/WFS service layer
    • New optional --bind-to parameter for MgDevHttpServer
  • InstantSetup
    • Fix crash if no setup log path specified when configuring
  • Samples
    • Fix bad extents in SheboyganXYZ tileset
So with this release out the door, what is next? Well unfortunately, there is still lots of work to do on the API binding and API documentation front, and so in the interests of not having you wait another year between releases, I am now adopting the policy of "however many beta/rc releases required" which implies more frequent beta/rc releases. As one of the major remaining items is completed and/or newer versions of any of our web tier components are available, that will be the trigger for a new beta/rc release.

Download

Note: Trac is a bit flaky right now, so the release notes page may not display. If that happens just retry with browser refreshes. Failing that, you can find all the necessary download links in my release announcement email

Thursday, 21 March 2024

Avalonia UI Test Drive

As the title implies, this blog post is about my experience test driving Avalonia UI.

So why am I doing this?

I've been getting growing questions lately about whether MapGuide Maestro works on Linux via Mono. 

Sadly I no longer emphasize anything regarding Mono compatibility because.

  • WinForms support (in legacy .net Framework 4.x) on Mono is pretty much a hack.
  • And since we've moved away from legacy .net Framework to .net 6.0, the combination of WinForms + .net 6.0 is probably an unsupported combination (you don't use Mono to run .net core/5.0+ applications, you use Microsoft's official SDK/runtime). I'm also not too keen to waste time and resources to test and find out.
The best and practical approach for a multi-platform MapGuide Maestro would be to at a minimum to rewrite the UI in a library/framework where support on non-Windows platforms is a first-class citizen.

And in terms of .net multi-platform UI frameworks, there's only one logical choice: Avalonia UI

While it is not in my immediate plans to rewrite MapGuide Maestro's UI in Avalonia, I wanted to at least explore the feasibility of building such a UI even if all the actual functionality is mocked up, just to see how easy or difficult the whole process is.

Hence the motivation for this post.

So why Avalonia?

Avalonia is effectively the "spiritual successor" to WPF, and adopts most of the same patterns and practices when building UIs for Avalonia.

I had first heard about Avalonia when it was formerly known as Perspex and at the time, from the screenshots of example Perspex applications on Windows and non-Windows platforms, it was clear at that point in time the range of possible applications one can build with Perspex was quite limited and building an application like Maestro on top of Perspex was not feasible.

Just recently, I had heard about the framework now known as Avalonia again and this time round there was a lot more positive buzz around it, so I gave it another look and was much more impressed at its capabilities and richer suite of UI controls to build applications with.

Our objective 

My objective with this Avalonia learning exercise was to build a minimal multi-document interface skeleton application, mimicking the primary functionality (UI-wise) of MapGuide Maestro.

  • Being able to present a login UI to connect to a MapGuide Server
  • Present MapGuide Server resources in a tree view
  • Open resources in a region of tabbed editor panels and being able to close them.
This is a crude wireframe of the kind of UI I wanted to build.
If this kind of UI looks familiar, yes it's basically the UI for tools like:
MapGuide Maestro is an IDE-like application (in terms of UI), so my first instinct is to look for a Visual Studio like docking library for Avalonia. However, I've been using Visual Studio Code more often than full Visual Studio as my daily driver for coding and the VSCode UI has become my default UI that I want to replicate for any IDE-like application with a multi-document interface.

The benefit of such a UI, is that it doesn't require an explicit VS-style window docking control like I have for the current WinForms-based MapGuide Maestro. I can already see the controls needed to build such a UI

Any UI toolkit worth its salt should to able to provide these basic controls.

This is a proof-of-concept, so we won't be using the existing Maestro API to talk to actual MapGuide Servers. Instead such functionality will be mocked up for this application. The main purpose of this exercise is to see if Avalonia provides enough of the base UI elements to build a hypothetical version of MapGuide Maestro on top of.

It turns out this exercise was fraught with several challenges

Challenge #1: Getting familiar with Avalonia concepts

The first challenge was simply getting familiar with Avalonia concepts. Being someone who did .net desktop app development primarily in Windows Forms, I skipped over WPF, and its XAML-based variants/successors like Silverlight, Xamarin Forms, UWP, and MAUI, and Avalonia being a "spiritual successor" to WPF meant that I didn't have a potential conceptual head start on Avalonia that one might have if they already had experience with WPF and its XAML-based derivatives.

However, I was familiar with the MVVM pattern and data-binding, which is used heavily in Avalonia. I already had experience in knockout.js building/maintaining some of our web apps in my day job, and these concepts learned from knockout.js mostly translate cleanly 1:1 to Avalonia.

The other Avalonia concepts I'll have to figure out as we go along.

Challenge #2: WebAssembly (WASM) support

Before I begin, I must take the MapGuide-knowledgable readers of this post back in time, way back to when MapGuide Open Source 1.0 was released.

Do you remember how this new (at the time), re-invented version of MapGuide was released, but the only authoring option at the time was to buy a license of Autodesk MapGuide Studio? Not a pretty look if you are offering a free and open source web map GIS server, but the authoring tools are not?

Some members of the MapGuide community were aware of this glaring discrepancy and created a web-based equivalent of MapGuide Studio called Web Studio built fully with HTML/JS/CSS. Unfortunately, Web Studio was really bare-bones in terms of authoring capabilities and the code being written in the pre-historic era of javascript (this was circa 2006-2007) which did not make it conductive to external contribution. React, TypeScript and friends weren't around then, so trying to enhance Web Studio with new features was extremely challenging. I once tried to add at least a generic XML text editor fallback for Web Studio so you had something to edit various resources where Web Studio did not provide a dedicated editor UI for, but alas this was just too challenging for me and I gave up on such an idea.

But eventually another user of the MapGuide community solved this problem more directly by developing and releasing a v1.0 of a windows .net desktop application that you all know as MapGuide Maestro. As an aside, I am not the original author of MapGuide Maestro in case you're wondering, I merely took over development and maintenance of Maestro from the 2.1 release onwards.

Anyways, back to the topic at hand, when I created the new Avalonia application with the provided project template, I was most surprised to see that the generated solution came with a project that compiled to WebAssembly (WASM) that was ready to run in your web browser!

This was a mind-blowing revelation for me from a conceptual standpoint. It means our hypothetical MapGuide Maestro built on Avalonia could not only exist as a regular desktop application, but the WASM build of this application could be dropped in the the wwwroot of a MapGuide Web tier installation and you would now have a modern version of Web Studio, but much more powerful and capable, because it is just MapGuide Maestro ... now in your web browser!

Since our starter project template includes a functioning WASM browser target. I now had a strong incentive to keep this target active and working, because the prospect of being able to run MapGuide Maestro in a web browser is a very tempting proposition. Therefore, the choice of libraries and APIs I use is constrained by my new requirement of being able to work in a browser/WASM environment.

For example, I originally wanted to use MVVMDialogs to simplify working with dialogs (Maestro has lots of dialogs, so I figure such a library could be useful), but I couldn't get this library to work in a WASM environment with some of my testing dialogs, so this was a no-go. Since this was just a proof-of-concept, there wasn't a need to have working dialog system, but it does mean if this were to go beyond a proof-of-concept and into an actual application where we will inevitably have to present a dialog of some sort, I'd have to come with a paradigm that can work in both desktop and browsers.

Another problem with this WASM target is that I can't seem to debug it in Visual Studio. You can launch the WASM target in the debugger and spawn a new browser window to launch your app, but any breakpoints you stick in your C# code are not being hit. I'm not sure if this a shortcoming or a broken feature, but it is somewhat concerning if we were to go full steam ahead with support WASM as a compilation/deployment target.

Challenge #3: "Large scale" MVVM

Although I already knew the MVVM pattern from knockout.js, my scope of usage was mostly limited to using knockout.js to building "islands" of interactive client-side content on primarily server-generated web pages. So I didn't really have an idea of how to apply such a pattern on a full blown Single Page Application (SPA), which is pretty much what we're trying to achieve (conceptually) in Avalonia. By the time I was building SPAs proper, I had moved on the popular stuff like React, which is how I gained the knowledge needed to build a modern replacement map viewer for MapGuide and my usage of knockout.js fell by the wayside as a result, so I never figured out the answer for how to do large scale MVVM.

The main problem was that in a large scale MVVM, how do view models communicate with each other without a tight parent-child coupling?

I deduced that for starters, we definitely need to use dependency injection. Various view models will need to access different services and if we had a root view model with explicit nested child view models (each with their own service requirements), it would be an absolute pain to have to setup these various view models. Using a DI container means we can offload this concern to it and we can focus on just asking the DI container for a particular view model and it will setup all the required services for it for us provided we register everything properly with the DI container.

For better WASM support, I wanted a dependency injection container that is not driven by reflection to make the code more friendlier to app trimming. We want to be able to app trim on publish so that we can eliminate unused code and reduce the final binary size. This is most desirable for the WASM target as app trimming means smaller binaries, which means smaller payloads to download in a web browser. StrongInject was chosen for this reason as it was a "compile-time" DI container that can verify all your dependencies are registered properly before running the application through the magic of source generators, generating all the necessary registration and validation code for you.

Finally, to be able to communicate between view models without necessary parent-child coupling, the messenger facility of the MVVM toolkit can be used. With this messenger facility, we simply:
  • Have select view models be recipients of certain messages
  • Have our application services (that various view model commands call) send these messages.
  • Relevant recipients get notified and update themselves (and their bound UIs) accordingly as a result.
I don't know if this is the proper usage of MVVM pattern in a "large scale" application, but it makes sense internally in my mind.

Challenge #4: TabControl binding of heterogenous/polymorphic content

Our proof-of-concept app has a main tab region where tabs of various document content are shown. I figured out easily that their TabControl component is supposed to be data-bound to an observable collection of view models, but what really stumped me was how bind this control to an observable collection of polymorphic editor view models?

The reason is because the tab content we want to show is not homogenous. One open editor tab could be for a layer, one for a map, one for a feature source, etc, etc. So we need to be able to show different tabs on the same tab control. 

Avalonia documentation is pretty scant on this topic. All examples I found assume homogenous series of tab content, which is not our case.

Just for laughs, since AI has been hyped for soon taking away everyone's jobs (even us devs), I figured I'd ask huggingface chat (as a guest), how would you solve this problem?


Unfortunately, the provided code sample does not work out of the box. It clearly assumed Avalonia = WPF and gave me a WPF-based solution. The giveaway was the Avalonia TabControl does not have an ItemTemplateSelector, but the WPF TabControl does.

But Avalonia sharing many conceptual similarities with WPF meant that although the answer provided wasn't correct, parts of the answer were applicable and did lead me down to further avenues of inquiry and eventually I found the solution: It was to define a data template for every possible derived tab view model class in the same UserControl where the TabControl was specified.

Final challenge: Avalonia VS designer

This wasn't so much a challenge, rather an annoyance. The Avalonia designer in Visual Studio has some teething issues
  • Intellisense/autocomplete is somewhat flaky when writing binding expressions and when you're doing a lot of data-binding, having the editor giving you and incomplete or outdated list of properties you can bind to becomes annoying. A full project build generally fixes this, but it is annoying having to do this every time I add new observable properties or commands to an existing view model class.
  • It's also not rename-aware, so observable property or command renames will result in stale binding expressions, causing havoc with the designer and have to be manually fixed up in the XAML. Choose your observable property names wisely I suppose, because renaming them afterwards is painful.

The end result and overall thoughts

A week later from that post, after addressing and/or navigating around these various challenges, we have a functional skeleton application!





And if these screenshots don't convince you, thanks to being able to deploy as a WASM target, I deployed a copy to GitHub pages, so you can see this app for yourself right in your WASM-enabled web browser!


The source code for this app can be found here. One day this may form the basis of a new (true) multi-platform version of MapGuide Maestro, but for now this lies as a potentially useful starting point for building a tabbed-multi-document editor application with Avalonia.

So what did I think of Avalonia from this little experiment? 
  • I like it mostly. My pre-existing experience on knockout.js helped greatly with picking up MVVM and data-binding. My initial prediction of a VSCode-style UI layout being buildable turned out to be true.
  • I like the default (project template provided) choice of MVVM Toolkit for applying the MVVM pattern. I like their heavy use of source generators to make adding new observable properties and commands to a view model being a simple case of tacking [ObservableProperty] on a field or tacking [RelayCommand] to a private method and having the source generator generate all of the boilerplate code for you (and it's a lot of boilerplate!).
  • The revelation that Avalonia has a WASM deployment target was both exciting and "cramping my style". It meant that certain libraries I wanted to use (eg. The MVVM dialogs library) could not be used and it wasn't clear what would work in a WASM browser environment and what wouldn't. Which leads to ...
  • Documentation is lacking in some areas. What really stumped me for a while was how do a TabControl bound to a collection of polymorphic or heterogenous tab view models. Their provided examples completely failed to tell me how to do this. I suppose if I came into this with existing WPF experience, this wouldn't have been so difficult as most of the concepts and patterns seem to be mostly transferable, but I happened to have skipped WPF and its bajillion XAML-based derivatives, so I didn't have this pre-existing knowledge to fall back on. Through perseverance and looking at the source code for many existing Avalonia applications on GitHub, I was finally able to determine that data templates was the solution.
So all-in-all, this was a fun and useful exercise and you get a useful starting point app from this effort!

Now I better get back onto this MapGuide/FDO work.