[mapguide-trac] #1811: Maestro UI Does Not Respect Fields for

MapGuide Open Source trac_mapguide at osgeo.org
Fri Sep 16 09:22:16 EDT 2011


#1811: Maestro UI Does Not Respect Fields for
----------------------------+-----------------------------------------------
   Reporter:  crispinatime  |       Owner:  jng        
       Type:  defect        |      Status:  new        
   Priority:  low           |   Milestone:  Maestro-4.0
  Component:  Maestro       |     Version:             
   Severity:  minor         |    Keywords:             
External_id:                |  
----------------------------+-----------------------------------------------
 MapGuide supports field properties for <ForegroundColor> and
 <BackgroundColor> but Maestro 4b1 throws an error when opening this XML in
 the UI - by trying an HTML colour conversion.

  * Full fix: update the colour selection UI to support fields

  * Partial fix: prevent exception (shown below)

 Current workaround is to use XML editor.



 {{{
 <?xml version="1.0" encoding="utf-8"?>
 <LayerDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.3.0"
 xsi:noNamespaceSchemaLocation="LayerDefinition-1.3.0.xsd">
   <VectorLayerDefinition>
 <ResourceId>Library://ABC/Data/SQLite_Redline.FeatureSource</ResourceId>
     <FeatureName>Default:Redline_Polygon</FeatureName>
     <FeatureNameType>FeatureClass</FeatureNameType>
     <Filter />
     <PropertyMapping>
       <Name>ID</Name>
       <Value>ID</Value>
     </PropertyMapping>
     <PropertyMapping>
       <Name>SessionID</Name>
       <Value>SessionID</Value>
     </PropertyMapping>
     <PropertyMapping>
       <Name>Style_Colour</Name>
       <Value>Style_Colour</Value>
     </PropertyMapping>
     <PropertyMapping>
       <Name>Style_Linetype</Name>
       <Value>Style_Linetype</Value>
     </PropertyMapping>
     <PropertyMapping>
       <Name>Style_Weight</Name>
       <Value>Style_Weight</Value>
     </PropertyMapping>
     <PropertyMapping>
       <Name>Style_Colour_Background</Name>
       <Value>Style_Colour_Background</Value>
     </PropertyMapping>
     <PropertyMapping>
       <Name>Style_Fill</Name>
       <Value>Style_Fill</Value>
     </PropertyMapping>
     <Geometry>Geometry</Geometry>
     <Url />
     <ToolTip />
     <VectorScaleRange>
       <AreaTypeStyle>
         <AreaRule>
           <LegendLabel />
           <Filter>Style_Fill = 'LINE'</Filter>
           <AreaSymbolization2D>
             <Fill>
               <FillPattern>LINE</FillPattern>
               <ForegroundColor>Style_Colour</ForegroundColor>
               <BackgroundColor>Style_Colour_Background</BackgroundColor>
             </Fill>
             <Stroke>
               <LineStyle>Solid</LineStyle>
               <Thickness>1</Thickness>
               <Color>Style_Colour</Color>
               <Unit>Points</Unit>
               <SizeContext>DeviceUnits</SizeContext>
             </Stroke>
           </AreaSymbolization2D>
         </AreaRule>
         <AreaRule>
           <LegendLabel />
           <Filter>Style_Fill = 'LINE_90'</Filter>
           <AreaSymbolization2D>
             <Fill>
               <FillPattern>LINE_90</FillPattern>
               <ForegroundColor>Style_Colour</ForegroundColor>
               <BackgroundColor>Style_Colour_Background</BackgroundColor>
             </Fill>
             <Stroke>
               <LineStyle>Solid</LineStyle>
               <Thickness>1</Thickness>
               <Color>Style_Colour</Color>
               <Unit>Points</Unit>
               <SizeContext>DeviceUnits</SizeContext>
             </Stroke>
           </AreaSymbolization2D>
         </AreaRule>
       </AreaTypeStyle>
     </VectorScaleRange>
   </VectorLayerDefinition>
 </LayerDefinition>
 }}}





 {{{
 System.Exception: Bad HTML color: "Style_Colour_Background"
    at OSGeo.MapGuide.MaestroAPI.Utility.ParseHTMLColor(String color) in
 e:\Projects\Maestro\OSGeo.MapGuide.MaestroAPI\Utility.cs:line 107
    at
 Maestro.Editors.LayerDefinition.Vector.FeaturePreviewRender.RenderPreviewArea(Graphics
 g, Rectangle size, IAreaSymbolizationFill item) in
 e:\Projects\Maestro\Maestro.Editors\LayerDefinition\Vector\FeaturePreviewRender.cs:line
 99
    at
 Maestro.Editors.LayerDefinition.Vector.Scales.ItemStyle.previewPicture_Paint(Object
 sender, PaintEventArgs e) in
 e:\Projects\Maestro\Maestro.Editors\LayerDefinition\Vector\Scales\ItemStyle.cs:line
 152
    at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
    at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
    at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs
 e, Int16 layer, Boolean disposeEventArgs)
    at System.Windows.Forms.Control.WmPaint(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
 m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
 IntPtr wparam, IntPtr lparam)
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1811>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list