[mapguide-users] Bypassing initial view at startup - and adding a layer

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Sep 4 06:13:16 EDT 2008


You must add your layer to the MapDefinition in step 1.
In step 2, you must point the WebLayout to the temporary MapDefinition.
Remember to make the layer visible in the map, as well as in the initial 
scale range.

Regards, Kenneth Skovhede, GEOGRAF A/S



gingerbbm skrev:
> Having solved the first issue of altering the web layout, I now need a
> polygon to appear in the initial view.
>
> I have working code to create a polygon based on a passed-in WKT string but
> again am struggling conceptually with how to integrate this into the initial
> view code.
>
> At the moment this is what I'm doing:
> 1. Load the Map Definition from the Library as XML then save it to the
> Session.
> 2. Load the Web Layout from the Library as XML, change the x, y, scale and
> <ResourceId/> values (the latter to point to my Session Map Definition),
> then save it to the Session.
> 3. Create a new map using the Session Map Definition and invoke my
> polygon-creation code.
> 4. Save the map to the Session.
> 5. Direct the Ajax Viewer to the Session Web Layout.
>
> The code runs and the map opens but the polygon isn't there. From reading
> various threads I think what's happening is that the runtime map I'm
> creating is simply being discarded (despite saving it to the session). I'd
> appreciate any advice on this.
>
> Thanks
> Stuart
>   


More information about the mapguide-users mailing list