-
Notifications
You must be signed in to change notification settings - Fork 305
Expand file tree
/
Copy pathDemo.aspx.cs
More file actions
28 lines (26 loc) · 843 Bytes
/
Demo.aspx.cs
File metadata and controls
28 lines (26 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;
namespace SharpMapServer
{
public partial class Demo : System.Web.UI.Page
{
public string layerName;
public string parameters;
protected void Page_Load(object sender, EventArgs e)
{
layerName = Request.QueryString["layerName"];
var lay = WMSServer.m_Map.GetLayerByName(layerName);
var ext = lay.Envelope;
parameters = new JavaScriptSerializer().Serialize(new
{
projection = "EPSG:4326",
maxExtent = new double[] { ext.MinX, ext.MinY, ext.MaxX, ext.MaxY }
});
}
}
}