[mapguide-internals] RFC 60 questions about ComputeUsedColors

Walt Welton-Lair walt.welton-lair at autodesk.com
Tue Mar 24 13:30:32 EDT 2009

Hi UV,

I like the change you've made in your RFC about not storing user stored palettes.  It simplifies things significantly.

The updated RFC suggests adding a new ComputeUsedColors method to VectorLayerDefinition.  Just to be sure I understand, the purpose of the method is to iterate through the layer definition data model and build a list of all colors reference by the styles?  If so, I have a couple of questions:

1/ How will the new method work with colors which are set to expressions?  While not a very common use case - color variation is generally done via theming - MapGuide does support it.  Getting that use case to fully work with your RFC seems like it would require two passes through the features - one pass to evaluate the color expression(s) against all the features which want to be rendered, and the second pass to do the actual rendering using the updated tile palette.  I'm not suggesting we actually do this, but I think it needs to be pointed out as a limitation with your updated approach.

2/ With the new enhanced stylization (RFC 14) the layer definition can reference symbol definitions (in addition to inlining them).  The symbols, of course, define colors which need to be accounted for.  Accessing referenced symbol definitions requires the resource service - we need to get the symbol definition resource from the service.  The MdfModel project (where VectorLayerDefinition is stored) does not have access (nor want access) to the resource service.  So if you want to properly support the new enhanced stylization with your RFC (you should) then we'll probably have to move this ComputeUsedColors method somewhere else.  There's a method - MgMappingUtil::ComputeStylizationOffset - which does something analogous to ComputeUsedColors, so possibly we can add ComputeUsedColors to MgMappingUtil.


 W       E         @__   __o
   A   T   R   @___    _ \<,_
     L           @_   (*)/ (*)

More information about the mapguide-internals mailing list