本文整理汇总了C#中IConfig.CreateTileSource方法的典型用法代码示例。如果您正苦于以下问题:C# IConfig.CreateTileSource方法的具体用法?C# IConfig.CreateTileSource怎么用?C# IConfig.CreateTileSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfig
的用法示例。
在下文中一共展示了IConfig.CreateTileSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFileCache
public static FileCache GetFileCache(string baseCacheDir, IConfig config,EnumBruTileLayer enumBruTileLayer)
{
var schema = config.CreateTileSource().Schema;
var cacheDirType = GetCacheDirectory(config, enumBruTileLayer, baseCacheDir);
var format = schema.Format;
if (format.Contains(@"image/"))
{
format = format.Substring(6, schema.Format.Length - 6);
}
if (format.Contains("png8"))
{
format = format.Replace("png8", "png");
}
var fileCache = new FileCache(cacheDirType, format);
return fileCache;
}
示例2: DoMainTask
public void DoMainTask(DateTime time,string _extent,string basePath,string tileDir,string csv)
{
this.basePath = basePath;
this.csv = csv;
extent = _extent.Split(new[] { ',' }).Select(Convert.ToDouble).ToList();
_config = ConfigHelper.GetConfig(EnumBruTileLayer.OSM);
_tileSource = _config.CreateTileSource();
_tileProvider = (WebTileProvider)_tileSource.Provider;
_cacheDir = CacheSettings.GetCacheFolder(tileDir);
while (true)
{
try
{
DeleteDirectory(_cacheDir);
break;
}
catch (Exception ex)
{
LogManager.LogPath = AppDomain.CurrentDomain.BaseDirectory + "\\log\\";
LogManager.WriteLog("error", ex.Message);
}
}
_fileCache = CacheDirectory.GetFileCache(_cacheDir, _config, EnumBruTileLayer.OSM);
Draw();
var map = mosaicImage();
DirectoryInfo directory =
new DirectoryInfo(basePath + time.ToString("yyyy") + "\\" + time.ToString("yyyyMMdd") + "\\" +
time.ToString("yyyyMMddHHmm"));
if(!directory.Exists)
directory.Create();
map.Save(directory.FullName + "\\traffic.png");
CreateTrafficCsv(directory);
}
示例3: ProcessRequest
public void ProcessRequest(HttpContext context)
{
RuntimeManager.BindLicense(ProductCode.EngineOrDesktop);
extent = context.Request.QueryString["Extent"].Split(new[] { ',' }).Select(Convert.ToDouble).ToList();
level = double.Parse(context.Request.QueryString["level"]);
_config = ConfigHelper.GetConfig(EnumBruTileLayer.OSM);
_tileSource = _config.CreateTileSource();
_tileProvider = (WebTileProvider)_tileSource.Provider;
_cacheDir = CacheSettings.GetCacheFolder();
_fileCache = CacheDirectory.GetFileCache(_cacheDir, _config, EnumBruTileLayer.OSM);
Draw();
//using (Bitmap map = new Bitmap(@"D:\我的文件\天津师大切片解决方案\DownloadTiles\DownloadTiles\bin\Debug\p.png"))
using (Bitmap map = mosaicImage())
{
using (MemoryStream mem = new MemoryStream())
{
map.Save(mem, ImageFormat.Png);
mem.Seek(0, SeekOrigin.Begin);
context.Response.ContentType = "image/png";
mem.CopyTo(context.Response.OutputStream, 4096);
context.Response.Flush();
}
}
}