/// <summary> /// 获取地图切片信息 /// </summary> /// <param name="extent"></param> /// <param name="zoom">地图级别</param> /// <returns>切信息,切片行列号起止信息</returns> public TitlesInfo getTitlesInfo(Extent extent, int zoom) { TitlesInfo titleInfos = new TitlesInfo(); titleInfos.minRow = (int)Math.Floor((extent.minX + maxExtent) / (maxResolution / (Math.Pow(2, zoom)) * 256.0)); titleInfos.maxRow = (int)Math.Ceiling((extent.maxX + maxExtent) / (maxResolution / (Math.Pow(2, zoom)) * 256.0)); titleInfos.minCol = (int)Math.Floor((maxExtent - extent.maxY) / (maxResolution / (Math.Pow(2, zoom)) * 256.0)); titleInfos.maxCol = (int)Math.Ceiling((maxExtent - extent.minY) / (maxResolution / (Math.Pow(2, zoom)) * 256.0)); return(titleInfos); }
/// <summary> /// 获取地图切片信息 /// </summary> /// <param name="extent">区域</param> /// <param name="zoom"></param> /// <returns>切片范围信息</returns> public TitlesInfo GetTitlesInfo(Extent extent, int zoom) { TitlesInfo titleInfo = new TitlesInfo(); double resolution = Math.Pow(2, 18 - zoom); titleInfo.minRow = (int)(Math.Round((extent.minX - 0) / (resolution * 256))); titleInfo.minCol = (int)(Math.Round((extent.minY - 23000) / (resolution * 256))); titleInfo.maxRow = (int)(Math.Round((extent.maxX - 0) / (resolution * 256))); titleInfo.maxCol = (int)(Math.Round((extent.maxY - 23000) / (resolution * 256))); return(titleInfo); }
/// <summary> /// 获取地图切片信息 /// </summary> /// <param name="extent">区域</param> /// <returns>切片范围信息</returns> public TitlesInfo getTitlesInfo(Extent extent, int zoom) { double resolution = this.resolutions[zoom]; TitlesInfo titleInfo = new TitlesInfo(); titleInfo.minRow = (int)(Math.Floor((extent.minX + maxExtent) / (resolution * 256))); titleInfo.maxCol = (int)(Math.Ceiling((maxExtent - extent.minY) / (resolution * 256))); titleInfo.maxRow = (int)(Math.Ceiling((extent.maxX + maxExtent) / (resolution * 256))); titleInfo.minCol = (int)(Math.Floor((maxExtent - extent.maxY) / (resolution * 256))); return(titleInfo); }