コード例 #1
0
        private void RenderMarker(PredefinedSymbol customSymbol, MapMarker mapMarker)
        {
            MapMarkerStyle markerStyle = MapMapper.GetMarkerStyle(mapMarker, true);

            if (markerStyle != MapMarkerStyle.Image)
            {
                customSymbol.MarkerStyle = MapMapper.GetMarkerStyle(markerStyle);
            }
            else
            {
                MapMarkerImage mapMarkerImage = mapMarker.MapMarkerImage;
                if (mapMarkerImage == null)
                {
                    throw new RenderingObjectModelException(RPRes.rsMapLayerMissingProperty(RPRes.rsObjectTypeMap, base.m_mapRule.MapDef.Name, base.m_mapVectorLayer.Name, "MapMarkerImage"));
                }
                customSymbol.Image           = base.m_mapMapper.AddImage(mapMarkerImage);
                customSymbol.ImageResizeMode = base.m_mapMapper.GetImageResizeMode(mapMarkerImage);
                customSymbol.ImageTransColor = base.m_mapMapper.GetImageTransColor(mapMarkerImage);
            }
        }
コード例 #2
0
 protected override void RenderPointTemplate(MapPointTemplate mapPointTemplate, Symbol coreSymbol, bool customTemplate, bool ignoreBackgoundColor, bool ignoreSize, bool ignoreMarker, bool hasScope)
 {
     base.RenderPointTemplate(mapPointTemplate, coreSymbol, customTemplate, ignoreBackgoundColor, ignoreSize, ignoreMarker, hasScope);
     if (!ignoreMarker)
     {
         MapMarker      mapMarker   = ((MapMarkerTemplate)mapPointTemplate).MapMarker;
         MapMarkerStyle markerStyle = MapMapper.GetMarkerStyle(mapMarker, hasScope);
         if (markerStyle != MapMarkerStyle.Image)
         {
             coreSymbol.MarkerStyle = MapMapper.GetMarkerStyle(markerStyle);
         }
         else
         {
             MapMarkerImage mapMarkerImage = mapMarker.MapMarkerImage;
             if (mapMarkerImage == null)
             {
                 throw new RenderingObjectModelException(RPRes.rsMapLayerMissingProperty(RPRes.rsObjectTypeMap, base.m_mapVectorLayer.MapDef.Name, base.m_mapVectorLayer.Name, "MapMarkerImage"));
             }
             string image;
             if (this.CanShareMarkerImage(mapMarkerImage, customTemplate))
             {
                 if (this.sharedImageName == null)
                 {
                     this.sharedImageName = base.m_mapMapper.AddImage(mapMarkerImage);
                 }
                 image = this.sharedImageName;
             }
             else
             {
                 image = base.m_mapMapper.AddImage(mapMarkerImage);
             }
             coreSymbol.Image           = image;
             coreSymbol.ImageResizeMode = base.m_mapMapper.GetImageResizeMode(mapMarkerImage);
             coreSymbol.ImageTransColor = base.m_mapMapper.GetImageTransColor(mapMarkerImage);
         }
     }
 }