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;
this.ReferScale = this.mapService.MapServiceInfo.Scale;
this.ReferViewBounds = this.mapService.MapServiceInfo.ViewBounds;
this.ReferViewer = this.mapService.MapServiceInfo.Viewer;
base.Initialize();
}
}
}