---
title: "学习GIS"
author: "qj200040"
date: "2011-09-02T16:01:20Z"
tags: []
categories: ["Web前端"]
slug: "gis"
draft: false
lastmod: "2011-09-02T16:01:20Z"
id: 1164416
url: "https://qj200040.iteye.com/blog/1164416"
---

/******************************************************专题图*******************************************************/

	
/**
*添加单值专题
*/
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);

};