Thursday, 20 November 2014

log.io is a real-time log monitoring solution that runs in your web browser. It is powered by node.js and socket.io.

Just a note before we dive in, this post is geared towards Linux-specific installations of MapGuide. This may or may not work for Windows. The log.io install instructions assume Linux, so we're rolling with that.

To install log.io you will first have to install node.js, there's a bajillion different links out there on how to install node.js, so here's one for:

Now browse to http://localhost:28778 and watch your MapGuide log files in real time.

NOTE: The above install instructions were pilfered from the log.io website itself, however I found the global install option to be problematic on my Ubuntu test VM. For some reason it always insists on building the native modules as the "root" user and not the user I designated from the npm install command. So I went for a local install instead, which means the following commands have been changed to the following:

Friday, 7 November 2014

Here's another release of mapguide-rest. There was some issues that cropped up after pushing the original 0.11 release that necessitated 2 emergency point releases to fix. As a result, 0.11.2 is the official release.

Here's what's new in this release.

KML Service Support

mapguide-rest now provides RESTful routes that wrap the existing KML Service APIs in MapGuide:

/library/{resourcePath}.MapDefinition/kml

/library/{resourcePath}.LayerDefinition/kml

/library/{resourcePath}.LayerDefinition/kmlfeatures

These routes respectively wrap or replicate:

GetMapKml (re-implemented in PHP to write the correct RESTful URLs for NetworkLink) elements)

GetLayerKml (re-implemented in PHP to write the correct RESTful URLs for NetworkLink)

GetFeaturesKml (wraps existing API)

Pagination support for feature data routes

These following routes that return feature data now support pagination:

Pagination will work for any supported representation except for CZML. The implementation of CZML output is not compatible with our pagination and errors will be thrown if attempting to pass in pagination parameters for CZML output.

Where {type} can now be html in addition to the existing supported representations.

For example, a html representation of a Layer Definition would look like this

Apply pagination, and you now have a page-able view of your feature data

The real payoff for implementing this feature is that you also get this support for selected features. For selected features, we support changing the display orientation in the HTML representation as well.

Tweak the page size and orientation parameters for this route and you have what is now effectively a selected feature property palette for your custom map viewer for free, as demonstrated in a new sample that is bundled with this release.

The palette in this sample is just an iframe to this new HTML representation URL.

Improved HTML repository view

The HTML repository representation has been cleaned up

You'll notice each resource no longer show all actionable links. That's because these have been moved to a separate page that is loaded when you click on the resource link.

Clicking on any actionable link will show the result in the space below

We've also added more actionable links for the following resource types:

Feature Sources: View features as HTML

Map Definitions: Export as KML

Various other HTML representations have also cleaned up css.

Localization-ready

mapguide-rest is now localization ready. If you want to translate mapguide-rest to your language of choice, you just have to do the following:

Translate and copy the strings in app\res\lang\en.php to app\res\lang\{locale}.php. A small caveat with translating these strings is that you will have to translate the content in a way that respects the ordering of placeholder tokens as we use sprintf to fetch and format localizable strings.

Translate and copy the system templates under app\res\templates\en to app\res\templates\{locale}

Translate and copy the XSLT templates under app\res\xsl\en to app\res\xsl\{locale}

Once you have translated these files, simply change the Locale property to {locale} in app\config.php and mapguide-rest will use the translated strings and templates

Other changes/fixes

Client agent and IP addresses are now recorded when creating a site connection, ensuring all API access from mapguide-rest will be properly logged in the server's access.log

Fix layered PDF plotting for maps with base layer groups

Added various bits of missing REST API documentation

Error messages will now be returned in the appropriate requested format where applicable (eg. If an error occurs when making a request to a URL expecting an XML response, the error will be returned as XML). If no applicable request format can be determined, then the default error response will be in HTML.