help! *-*

d d jihong3630 at yahoo.com.cn
Sun Jun 11 21:02:43 EDT 2006


  Dear Mr or Mrs:
   
  
  My name is Jihong, the GIS department of Tianjin ,I use mapguide 7.0,Now I meet a question .I want to know the difference of MgCurveRing,MgCurveStringCollection,MgCurveRing.
How do I use those function?
When I draw a circle or Polygon in map, what should I do? 
for example ,where is wrong?
  
        MgUserInformation cred = new MgUserInformation(sessionId); //????
        MgSiteConnection site = new MgSiteConnection(); //connect to the site and get a feature service and a resource             service instances
        site.Open(cred);

            MgFeatureService featureSrvc = site.CreateService(MgServiceType.FeatureService) as MgFeatureService;
        MgResourceService resourceSrvc = site.CreateService(MgServiceType.ResourceService) as MgResourceService;

            MgResourceIdentifier layerDefId = new MgResourceIdentifier(layerDef);

            MgMap map = new MgMap();
        map.Open(resourceSrvc,mapName);
        MgLayerCollection layers = map.GetLayers();

            srs = GetMapSrs(map); //????×öʲôÓÃ
        MgLayer layer = FindLayer(layers,layerDef);

            MgGeometryFactory geomFactory = new MgGeometryFactory();
        MgCoordinateCollection coordinates = new MgCoordinateCollection();

            String[] pArray = p.Split(',');
        coordinates.Add(geomFactory.CreateCoordinateXY(Double.Parse(pArray[0]), Double.Parse(pArray[1])));
        MgCurveString geom = geomFactory.CreateMultiCurveString(pArray); // what's wrong???
      
        MgPropertyCollection measureProps = new MgPropertyCollection();
        MgInt32Property partialProps = new MgInt32Property("TYPE",1);
        measureProps.Add(partialProps);
     
        MgAgfReaderWriter agf = new MgAgfReaderWriter();
        MgByteReader geomReader = agf.Write(geom);
        MgGeometryProperty geometryProp = new MgGeometryProperty(geomProperty, geomReader);
        measureProps.Add(geometryProp);

            MgInsertFeatures cmd = new MgInsertFeatures("Edit_layer_polyline",measureProps);
        MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
        commands.Add(cmd);

    I'm looking forware to your quick reply,thank you !!! if you reply ,Mailto:jihong3630 at yahoo.com.cn

    Yours sincerely,

    Jihong


 __________________________________________________
¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä?
http://cn.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-internals/attachments/20060612/85bd7524/attachment.html


More information about the Mapguide-internals mailing list