/// <summary>
/// MapPageBase 处理了 // onload="initialize()" onunload="GUnload()" 这两个事件, 如果不使用继承, 请自行处理该事件!
/// </summary>
public partial class Example : MapPageBase
{
protected void Page_Load(object sender, EventArgs e)
{
// 在这里申请你的 AppKey
// http://code.google.com/apis/maps/signup.html
string AppId = "ABQIAAAAT2TW27KPpzTcS3Av9rRZ8xTMc_QNvQYPZO4F6J-ygmVXuqkocRS6gkKMvUKO2am7UGh-wFKm8McGSQ";
//默认初始化
//Init inits = new Init("showmymap",15);
Init inits = new Init("showmymap") { Maptype = MapType.G_PHYSICAL_MAP};
// 定义经纬度坐标点
List<Label> labels = new List<Label>()
{
new Label()
{
X = 23.134391,
Y = 113.287550,
// ------------- 以下是可选项, 可以不设置, 使用系统的默认值 ------------
IsCenter = true, // 设置中心点, 存在多点只设置一点即可
Msg = "一起飞国际机票网",
MsgMaxContent = "信息框放大显示的内容,可以为空,不设置!",
MsgMaxTitle = "显示的标题, 可以为空,不设置!"
// ------------------------------------------------------------------
}
};
// 设置地图入参
Maps map = new Maps(AppId, inits, labels);
// 生成地图
MapScript.Text = map.ToString();
// 生成图片地图
ShowStaticMap.ImageUrl = map.ToImagePath(500, 500);
}
}