You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
3 years ago
|
using System.Text;
|
||
|
using System.Web.Mvc;
|
||
|
|
||
|
using Pingchuan.BeijingSafeguard.BLL;
|
||
|
using Pingchuan.BeijingSafeguard.Model;
|
||
|
|
||
|
namespace Pingchuan.BeijingSafeguard.App.Controllers
|
||
|
{
|
||
|
public class TiananmenController : BaseController
|
||
|
{
|
||
|
// GET: Forecast
|
||
|
public ActionResult Index()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
[HttpGet]
|
||
|
public void GetMap(int type, int zoom, int x, int y)
|
||
|
{
|
||
|
GmapNetCache map = GmapNetCacheBLL.Get(type, zoom, x, y);
|
||
|
if (map != null)
|
||
|
{
|
||
|
Response.StatusCode = 200;
|
||
|
Response.AddHeader("Content-Type", "image/png");
|
||
|
Response.BinaryWrite(map.Tile);
|
||
|
Response.End();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Response.StatusCode = 404;
|
||
|
Response.AddHeader("Content-Type", "text/plain");
|
||
|
Response.BinaryWrite(Encoding.UTF8.GetBytes("Tile not found."));
|
||
|
Response.End();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|