[ZS1] Re: [mapguide-users] [ZS1] Drawing order of layers in a map

Kenneth, GEOGRAF A/S ks at geograf.dk
Wed Oct 31 03:34:19 EDT 2007


Have you tried calling the "NeedsRefresh" property on the layer?


Im just guessing, but the AJAX viewer is probably creating a new session.
If this is correct, your map is not avalible from within the session 
created by the viewer.

Also, be aware that there are TWO types of maps, one called a 
"MapDefintion" which is XML based, and another called "Runtime Map" 
(sometime just "Map") which is binary.
You cannot use a Runtime map as a mapdefinition in the WebLayout.

Regards, Kenneth, GEOGRAF A/S



m.karam skrev:
> thanks for your reply
> I tried that ..
> but sometimes, the features of the layer that i remove, don't appear unless
> i refresh that layer from the legend
>
>
> i tried another solution ..
> to change the layers order in the map definition and save it in the session.
> And also, update the web layout by changing the ResourceId of the map.
> Now, I have a map definition and web layout in the session
>
> but when i pass the new web layout to the viewer, it gives me an error
> message:
> "MgInvalidMapDefinitionException"
>
> what will i do for this error?
> Is that any error in the XML of the map definition?
> please help ...
> Karam
>
>
>
> Kenneth, GEOGRAF A/S wrote:
>   
>> Hmm, I see... For some reason this property is not avalible in the API.
>>
>> You can remove it from the layers collection (code in C#):
>> MgMap map = ......;
>> MgMapLayerCollection col = map.GetLayers();
>> MgMapLayer layer= (MgMapLayer)col[0];
>> col.RemoveAt(0);
>> col.Insert(col.Count - 1, layer)
>> map.Save(...);
>>
>> That will move the first layer down to the last position.
>>
>>
>>
>> Regards, Kenneth, GEOGRAF A/S
>>
>>
>>
>> m.karam skrev:
>>     
>>> the layers don't have a "DisplayOrder" property...
>>>
>>>
>>>
>>> Kenneth, GEOGRAF A/S wrote:
>>>   
>>>       
>>>> I belive that the layers have a "DisplayOrder" property.
>>>> So do:
>>>>
>>>> 1. Load runtime map
>>>> 2. Change "DisplayOrder" property of layers
>>>> 3. Save runtime map
>>>> 4. Refresh client display
>>>>
>>>> Regards, Kenneth, GEOGRAF A/S
>>>>
>>>>
>>>>
>>>> m.karam skrev:
>>>>     
>>>>         
>>>>> Hi everybody
>>>>>
>>>>> I want to change the (Drawing Order) of the Map Layers at run-time
>>>>> according
>>>>> to a specific conditions
>>>>> How can i do it?
>>>>>
>>>>> Thanks in advance
>>>>> Karam
>>>>>   
>>>>>       
>>>>>           
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> _______________________________________________
>> 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/20071031/cd3565ba/attachment.html


More information about the mapguide-users mailing list