SuperMap.Web.Mapping.DynamicRESTLayer.mapService_Initialized C# (CSharp) Method

mapService_Initialized() private method

private mapService_Initialized ( object sender, SmMapService e ) : void
sender object
e SmMapService
return void
        private void mapService_Initialized(object sender, SmMapService.MapServiceInitalizeArgs e)
        {
            if (e.MapService.MapServiceUrl == this.Url.Trim())
            {
                if (base.Error != null)
                {
                    base.Initialize();
                }
                else
                {
                    if (CRS == null)
                    {
                        CRS = new CoordinateReferenceSystem
                        {

                        };
                        if (this.mapService.MapServiceInfo != null)
                        {
                            CRS.Unit = this.mapService.MapServiceInfo.CoordUnit;
                            if (this.mapService.MapServiceInfo.PrjCoordSys != null)
                            {
                                CRS.WKID = this.mapService.MapServiceInfo.PrjCoordSys.EpsgCode;
                                if (this.mapService.MapServiceInfo.PrjCoordSys.CoordSystem != null
                                    && this.mapService.MapServiceInfo.PrjCoordSys.CoordSystem.Datum != null
                                    && this.mapService.MapServiceInfo.PrjCoordSys.CoordSystem.Datum.Spheroid != null)
                                {
                                    CRS.DatumAxis = this.mapService.MapServiceInfo.PrjCoordSys.CoordSystem.Datum.Spheroid.Axis;
                                }
                            }
                        }
                    }

                    Bounds = this.mapService.MapServiceInfo.Bounds;

                    Dpi = ScaleHelper.GetSmDpi(this.mapService.MapServiceInfo.ViewBounds, this.mapService.MapServiceInfo.Viewer, this.mapService.MapServiceInfo.Scale, CRS.Unit, CRS.DatumAxis);

                    Dpi *= AdjustFactor;
                    base.Initialize();
                }
            }
        }