zoukankan      html  css  js  c++  java
  • 修改图层的symbol(AE+C#)

    &a

    取出一个图层的symbol 在其基础上对其进行修改

    Code
            private void button1_Click(object sender, EventArgs e)
            {
      mp;nbsp;          
    //设定要改变symbol的图层
                ILayer pLayer=m_mapControl.get_Layer(0);
                IGeoFeatureLayer pGeoFeatLayer 
    = pLayer as IGeoFeatureLayer;

                
    //得到此图层的symbol
                ISimpleMarkerSymbol pMarkerSymbol=new SimpleMarkerSymbolClass();
                pMarkerSymbol
    =GetFeatureLayerSymbol(pLayer) as ISimpleMarkerSymbol;

                
    //对symbol进行改变操作
                pMarkerSymbol.Size=20;    

                
    //把改变后的symbol赋给此图层
                ISimpleRenderer pRenderer=new SimpleRendererClass();
                pRenderer.Symbol
    =pMarkerSymbol as ISymbol;
                pGeoFeatLayer.Renderer 
    = pRenderer as IFeatureRenderer;

              
            }

            
    /// <summary> 得到指定图层的symbol</summary>
            
    /// <param name="layer"></param>
            
    /// <returns></returns>
            public ISymbol GetFeatureLayerSymbol(ILayer layer)
            {
                ISymbol pSymbol 
    = null;

                IGeoFeatureLayer pGeoFeatLayer 
    = (IGeoFeatureLayer)layer;
                IFeatureClass pFeatClass 
    = pGeoFeatLayer.FeatureClass;
                IFeatureCursor pFeatCursor 
    = pFeatClass.Search(nulltrue);
                IFeature pFeature 
    = pFeatCursor.NextFeature();

                
    if (pFeature == null)
                {
                    pFeature 
    = pFeatCursor.NextFeature();
                }
                
    else
                {
                    IFeatureRenderer pFeatRen;
                    pFeatRen 
    = pGeoFeatLayer.Renderer;
                    pSymbol 
    = pFeatRen.get_SymbolByFeature(pFeature);
                }
                
    return pSymbol;
            }
  • 相关阅读:
    PHP底层工作原理
    php WebSocket 简单实现demo
    php部署调优
    php简单随机实现发红包程序
    在Android中调用USB摄像头
    在addroutes后,$router.options.routes没有更新的问题(手摸手,带你用vue撸后台 读后感)
    Vue+elementUI开发中 Cannot read property 'resetFields' of undefined 问题解决以及原因分析
    如何在debug vue-cli建立的项目
    在Node.js使用Promise的方式操作Mysql(续)
    express框架中如何只执行一次res响应操作
  • 原文地址:https://www.cnblogs.com/myparamita/p/1453740.html
Copyright © 2011-2022 走看看