Thursday 31 July 2014

MapGuide / AIMS - drawing order - sorting

We are setting up MapGuide (AIMS) 2013 and TBVIEW as our intranet GIS system.
Our current solution is based on MapGuide 6 and TBWebframe.


In MapGuide 6 we have a map "template" containing all layers we provide. For a single project (we have roughly 30) we just take the template and remove all layers which are not required. The template map contains around 650 layers. I assume we will have more layers with Map/MapGuide as we will offer more display models to our users.

With Map 2013 we publish all required display model to MapGuide. A new map is merged with our template by exporting both as XML and copy/pasting the content. That works quite well. A bigger issue is setting up layer draw order.
Copying an XML fragment (<MapLayer>) at the right position is difficult with 600+ layers. Doing it with MapGuide Studio is not practical.

I have written a little tool which helps sorting layers and layer groups:
- export map as XML (Studio or MapAgent)
- load XML file into tool and create text file with all layers and groups (including current draw order)
- open text file in excel and sort layers/groups as required
- import layer into tool and apply to map - layers and groups get sorted accordingly
- import XML into MapGuide (MapAgent).






I have done a few tests and it seems to work reasonably well. If anyone is interested - drop me an email and I will send you the tool and source code.

2 comments:

  1. Hallo Robert!
    Christian hier von der ReLIS AG.
    Wir sind seit Beginn an bei TBVIEW dabei, und waren das schweizweit
    erste Unternehmen, das TBVIEW in der Schweiz für unsere Kunden einsetzte.

    Durch diese langjährige Zusammenarbeit mit Gerst können wir durchaus auch
    diverse Erfahrungswerte über TBView (inkl. V2) teilen.
    Was das Layer/Gruppen-Reihenfolgen-Problem auf Mapguide betrifft,
    haben wir dies bisher im Maestro XML-Editor manuell gemacht.
    Ich hatte schon länger mal im Sinn, ein kleines .net-Progrämmchen für diese
    Problematik zu schreiben, bin aber nie recht dazugekommen.
    Ansonsten machen wir das mit Vorlagen-Karte etc. relativ gleich,
    vielleicht kann man sich ja trotzdem bei dem einen oder anderen Problem mal
    gegenseitig aushelfen.

    Finde es auf jeden Fall super, endlich mehr TBVIEW-User in der Schweiz begrüssen zu können.
    Gerne würde ich auch dein kleines App mal ausprobieren,
    meine Adresse findest Du letztlich auch auf unserer Webseite,

    Gruess, Chris.

    ReplyDelete
  2. Can you share this? It looks quite clever.

    ReplyDelete