private Layout.GxdEnvelope ToPrjEnvelope(Envelope env, Layout.IGxdDataFrame gxdDataFrame, Layout.IDataFrame dataFrame) { if (env == null) { return(null); } GeoDo.Project.IProjectionTransform tran = GetProjectionTransform(gxdDataFrame.SpatialRef); if (tran == null) { return(null); } double[] xs = new double[] { env.MinX, env.MaxX }; double[] ys = new double[] { env.MaxY, env.MinY }; try { tran.Transform(xs, ys); return(new Layout.GxdEnvelope(xs[0], xs[1], ys[1], ys[0])); } catch { return(null); } }
protected override void ApplyAttributesOfDataFrame(Layout.IGxdDataFrame gxdDataFrame, Layout.IDataFrame dataFrame, ILayout layout) { Layout.GxdEnvelope evp = ToPrjEnvelope(_env, gxdDataFrame.SpatialRef); if (evp != null) { FitTemplateWidth(layout, (float)(evp.MaxX - evp.MinX), (float)(evp.MaxY - evp.MinY)); gxdDataFrame.Envelope = evp; } base.ApplyAttributesOfDataFrame(gxdDataFrame, dataFrame, layout); }