学习GIS

/******************************************************专题图*******************************************************/


/**
*添加单值专题
*/
function addThemeUnique(){
//首先应该创建地图
//map.map = $create(SuperMap.Web.Mapping.Map, {} , null, null, $get('mapDiv'));

//创建单例
var themeUnique = new SuperMap.Web.iServerJava2.ThemeUnique();
themeUnique.uniqueExpression = "FLICMNM";
themeUnique.makeDefaultParam.layerName = "wiestop101@main";
themeUnique.makeDefaultParam.colorGradientType = SuperMap.Web.iServerJava2.ColorGradientType.YELLOWBLACK;//黄/黑色渐变
themeUnique.defaultStyle = null;

var ThemeParameters = new SuperMap.Web.iServerJava2.ThemeParameters("main");
ThemeParameters.layerName = "wisetop101@main";
ThemeParameters.theme = themeUnique;

/***
* 在这里添加域问题说明
**/
var ThemeService = new SuperMap.Web.iServerJava2.ThemeService(mapApp.href);
ThemeService.add_processCompleted(onThemeComplete);
ThemeService.processAsync(ThemeParameters);

};

/**
*范围专题图
*/

function addThemeRange(){
//map.map = $create(SuperMap.Web.Mapping.Map,{}, null, null, $get('mapDiv'));

var themeRange = new SuperMap.Web.iServerJava2.ThemeRange();
themeRange.rangeExpression = "FLICMNO";//要是的数值类型的字段;字段:string
themeRange.makeDefaultParam.rangeParameter = 3;//分成3段
themeRange.makeDefaultParam.layerName = "wisetop101@main";

var themeParameter = new SuperMap.Web.iServerJava2.ThemeParameters("main");
themeParameter.layerName ="wisetop101@main";
themeParameter.theme =themeRange;


var themeService = new SuperMap.Web.iServerJava2.ThemeService(mapApp.href);
themeService.add_processCompleted(onThemeComplete);
themeService.processAsync(themeParameter);

};


/**
*添加标签专题
*/
function addThemeLabel(){
//salert("Go,Go,Go");
//创建地图控件
//map.map = $create(SuperMap.Web.Mapping.Map, {}, null, null, $get('mapDiv'));


var themeLabel = new SuperMap.Web.iServerJava2.ThemeLabel();
themeLabel.labelExpression = "FENTITYNM";
themeLabel.labelBackShape = SuperMap.Web.iServerJava2.LabelBackShape.RECT;//矩形背景标签

var ThemeParameters = new SuperMap.Web.iServerJava2.ThemeParameters("main");
ThemeParameters.layerName = "wisetop101@main";
ThemeParameters.theme = themeLabel;

/**
*在这里添加域说明
*/
var ThemeService = new SuperMap.Web.iServerJava2.ThemeService(mapApp.href);
ThemeService.add_processCompleted(onThemeComplete);
ThemeService.processAsync(ThemeParameters);


};

/**
*统计专题图
*/
function addThemeGraph(){
//创建地图控件
//map.map = $create(SuperMap.Web.Mapping.Map, {}, null, null, $get('mapDiv'));

var typeArray = new Array();//新建一个列表

var graphItem1 = new SuperMap.Web.iServerJava2.ThemeGraphItem();
graphItem1.graphExpression = "FLICMNO";
graphItem1.uniformStyle = new SuperMap.Web.iServerJava2.ServerStyle();
alert("come here");
graphItem1.uniformStyle.fillForeColor = new SuperMap.Web.iServerJava2.ServerColor(0,0,255);//蓝色
graphItem1.caption = "工厂分布";//标题 ,分布情况
typeArray.push(graphItem1);//将子项放入typeArray中

var graphItem2 = new SuperMap.Web.iServerJava2.ThemeGraphItem();
graphItem2.graphExpression = "FLICDNO";//加入统计字段
graphItem2.uniformStyle = new SuperMap.Web.iServerJava2.ServerStyle();
graphItem2.uniformStyle.fillForeColor = new SuperMap.Web.iServerJava2.ServerColor(255,0,0);//红色
graphItem2.caption = "";//标题 ,分布情况
typeArray.push(graphItem2);//将子项放入typeArray中


var themeGraph = new SuperMap.Web.iServerJava2.ThemeGraph();
themeGraph.items = typeArray;//将子项都添加到统计列表里

themeGraph.graphType = SuperMap.Web.iServerJava2.GraphType.PIE;//饼状,对应值为六,2D平面;3D对应为PIE3D

themeGraph.barWidth = 0;

themeGraph.graduatedMode = SuperMap.Web.iServerJava2.GraduatedMode.CONSTANT;//常量分级模式
themeGraph.minGraphSize = 4;
themeGraph.maxGraphSize = 10;

var themeParameters = new SuperMap.Web.iServerJava2.ThemeParameters("main");
themeParameters.layerName = "wisetop101@map";
themeParameters.theme = themeGraph;

var themeService = new SuperMap.Web.iServerJava2.ThemeService(mapApp.href);
themeService.add_processCompleted(onThemeComplete);
themeService.processAsync(themeParameters);

};
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值