[mapguide-users] MapDefinition from runtime map

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Wed Jul 29 03:38:16 EDT 2009


The dummy resource can be any type, eg. MapDefinition or FeatureSource.

Unless you frequently change resource names, schemas or geometry column 
names,
I think you can do fine without validation.

The only problem I can see, is that it is very difficult to edit the 
runtime map,
if it is broken and needs to be fixed, where the MapDefinition is just xml.

Regards, Kenneth Skovhede, GEOGRAF A/S



Gunter Becker skrev:
> Your second approach sounds good to me.
>  
> I think that it don't take much time to save the map that way in opposition
> to the first approach.
> What ResourceType does the dummy resource should have?
>
> The only concern I have is that I can't do much validation (eg. resources
> exists) before displaying the map. But I don't know if validation makes
> sense at all because of the time it takes to validate all layers
> in a map. I'm talking of 100 - 200 layers. What do you think!
>
> Gunter  
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>> I don't think such a method exists.
>> It should be fairly straightforward to itterate the layers
>> and construct a MapDefinition though.
>>
>> An alternative approach is to simply save the runtime map.
>> Just create a dummy resource in the repository,
>> and save the runtime map as "resource data".
>>
>> You can use MaestroAPI to get the runtime map as a binary.
>>
>> The tricky part is loading the runtime map.
>> If you use the AJAX viewer, you must edit the file and skip the
>> part where it creates the runtime map, and then load the map instead.
>>
>> The drawback to this approach is that primary keys etc. are saved, and
>> won't be updated when you load the runtime map.
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Gunter Becker skrev:
>>     
>>> Hi all,
>>>
>>> what ist the easiest way to get an MapDefinition from an users runtime
>>> map.
>>> My purpose is to save the users runtime map in Library after he has added
>>> some layers to the map and maybe has changed the visibility of the
>>> layers.
>>>
>>> Until now I had static maps and it was easy to compare the runtime map
>>> with
>>> the mapdefinition and set only the visibility. But the more I give the
>>> user
>>> the chance to change the runtime map (add layers) the more it will become
>>> complicated.
>>>
>>> So, is there somewhere (maybe in MaestroAPI) such an methode or are there
>>> somewhere examples to achieve that?
>>>
>>> Thanks in advance,
>>> Gunter
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090729/83b25857/attachment.html


More information about the mapguide-users mailing list