Friday, 21 June 2013

The baby is talking

Can we init this thing?

So far so good. That exception text is a nonsense error outputted by MgCoordinateSystemCatalog trying to initialize from default paths that don't exist (the above path in the screenshot and the non-existent MENTOR_DICTIONARY_PATH), MgInitializeWebTier will set the dictionary path correctly based on webconfig.ini

Can we make some objects?

Does the JS instanceof operator check out?

Now the big one, can we make some services?

Do these services have a class hierarchy?

Do these services work?

Aw yeah!

This baby still needs time to grow up though.

  • MgExceptions de-stabilize the whole thing, even though we are internally catching them and re-throwing as JS Error objects
  • This thing could be leaking memory like a broken water pipe
  • Who knows what other Node/V8-isms could be catching me off-guard?

Saturday, 15 June 2013

Taking baby steps

This doesn't actually work yet. But seeing output like this gives you the motivation to carry on.

Thursday, 6 June 2013

Changing the default redline style in Fusion

So as you know, we've vastly streamlined the Fusion redlining widget so you don't have to wade through so many pages of setup in order to start drawing lines and squiggles.

You might also be aware that all redlines drawn will have the same style applied to them, and if you want to change this, you have to go back to the Redline Management page to edit the layer style for that redline layer.

You might also be wondering if we can change this default style so the above doesn't have be done for every redline layer you create. Yes you can. Here's how.

From the root directory of your Fusion installation. Open defaultstyle.php under the widgets\Redline\classes directory.

This file defines the default layer style settings to use when creating a new redline layer on the map.

Edit the values in this file to suit your desired default style. Save the file, reload the viewer and the Redline widget will be using your new values.

MapGuide tidbits: The GDAL and OGR FDO providers

Here's a some tidbits about the GDAL and OGR FDO providers that come with MapGuide Open Source.

What version of GDAL/OGR?

If the name of the dll didn't give it away, the latest stable release of MapGuide Open Source (2.5) uses GDAL and OGR FDO providers compiled with GDAL 1.9. For older releases, just looking at the name of the gdal dll in the FDO directory should easily tell you what version we're working with.

What drivers/formats are supported?

When building FDO, GDAL/OGR is built with default settings, so whatever format that GDAL or OGR says it's compiled by default, said formats will probably also work out of the box with the GDAL and OGR providers that come with MapGuide.

For the OGR provider, what do you put in for the "DataSource" connection parameter?

The same thing you would put in for a data source in ogrinfo.exe, ogr2ogr.exe, etc. Some examples:

  • MapInfo:  The directory containing your tab files
  • ESRI Shapefiles: The directory containing your shapefiles. (arguments about why you're not using the SHP FDO provider aside)
  • GeoJSON: The GeoJSON file path or URL
When in doubt, consult the OGR drivers page to see how to build the OGR connection string for your particular data source.

Test the connectivity with ogrinfo.exe, if it gives you the all clear, that's what you plug in as the DataSource parameter for the OGR provider.

It goes without saying that having a separate standalone GDAL/OGR installation present will greatly help in this matter. If the OGR FDO provider has issues accessing a given data source, you can run the same data source through ogrinfo.exe to see if it has the same issues.

I need support for a format/driver that's not compiled by default

Hop on over to gisinternals and grab the equivalent GDAL binary package. Make sure that it's for the same GDAL/OGR version that MapGuide is using and is built with the same MSVC compiler that was used to build MapGuide and FDO. For the current stable release of FDO (3.8), you need a MSVC2010 compiled version of GDAL 1.9

For raster formats like ECW, you need to make sure any GDAL plugins paths are set up properly. There's wiki-fied instructions for MapGuide Open Source 2.2 and an updated discussion thread for MapGuide Open Source 2.4. 2.5 uses the same GDAL version so instructions should be pretty much the same.

Hope this helps