
/********************************************************************/
/*****************MapsApp*****新增方法***************************/
//热量图启用
MapsApp.prototype.setHeadLoad = function(flag){
	if(!flag){
		$(this.heatContainer).remove();
		this.heatContainer=null;
	}
	this.map.showHeat = flag;
};
MapsApp.prototype.clearHeadLoad = function(){
	$(this.heatContainer).remove();
	this.heatContainer=null;
};
MapsApp.prototype.getHeadLoad = function(){
	return this.map.showHeat||false;
};
//热量图
MapsApp.prototype.AddHeat=function(path){	
	var mapCon = this;	
	 //热力图容器
	if(mapCon.heatContainer){
	   $(mapCon.heatContainer).css("left",-($(mapCon.map.div).offset().left)).css("top",-($(mapCon.map.div).offset().top));
	   $(mapCon.heatContainer).find("img").attr("src",path);
   	}else{
	   mapCon.heatContainer = $("<div style='position: absolute;top: 0px;left:0px;z-index:1;' class='heat'><img ></img><div>");
	   $(mapCon.heatContainer).css("left",-($(mapCon.map.div).offset().left)).css("top",-($(mapCon.map.div).offset().top));
	   $(mapCon.heatContainer).width($(mapCon.mapContainer).width()).height($(mapCon.mapContainer).height());
	   $(mapCon.heatContainer).find("img").attr("src",path);
	   $(mapCon.map.div).append(mapCon.heatContainer);
   	}	
   	/*
	MainFrame.prototype.heatLoad = function(bounds,zoom){
		params.bounds = bounds.minX+","+bounds.minY+","+bounds.maxX+","+bounds.maxY;
		params.zoom=zoom;
		var path = map_kjsj.getHotPath(params);
		//热力图容器
		if(mapCon.heatContainer){
		   $(mapCon.heatContainer).css("left",-($(mapCon.map.div).offset().left)).css("top",-($(mapCon.map.div).offset().top));
		   $(mapCon.heatContainer).find("img").attr("src",path);
	   }else{
		   mapCon.heatContainer = $("<div style='position: absolute;top: 0px;left:0px;z-index:1;' class='heat'><img></img><div>");
		   $(mapCon.heatContainer).css("left",-($(mapCon.map.div).offset().left)).css("top",-($(mapCon.map.div).offset().top));
		   $(mapCon.heatContainer).width($(mapCon.mapContainer).width()).height($(mapCon.mapContainer).height());
		   $(mapCon.heatContainer).find("img").attr("src",path);
		   $(mapCon.map.div).append(mapCon.heatContainer);
	   }
	}
	*/
};
//获取亮点之间距离
MapsApp.prototype.getLength = function(point1,point2){
   var pointArr = [];
   pointArr.push(point1);
   pointArr.push(point2);
	var b=CalculateLength( pointArr);
	b=Math.floor(b);
	return b;
};
//获取线路长度
MapsApp.prototype.getLinesLength = function(points){
	var b=CalculateLength(trans2Points(points));
	b=Math.floor(b);
	return b;
};
/*
//重写拖动结束事件
MainFrame.prototype.onDragEnd = function(c) {
	if (this.bIsOutOfBorder() == true) {
		this.centerAtLatLng(this.saveStartPoint);
	}
	this.onStateChanged("onDragEnd");
	var g = new Point(this.getMouseMapX(), this.getMouseMapY());
	var d = new EzEventListener(this, EzEvent.MAP_PANEND);
	var f = {
		mapPoint : g,
		screenPoint : this.mapCoord2container(g),
		eventType : "mappanend"
	};
	EzEvent.trigger(d, f);
	// 加载图片结束
	if (this.showHeat) {
		if (this.heatLoad)
			this.heatLoad(this.getBoundsLatLng(),this.getZoomLevel());
	}
};
//重写滚动条结束事件
MainFrame.prototype.flatZoom=function(j){
	var _this = this;
	if (j < 0 || j > _MaxLevel) {
		return false;
	}
	if (this.bIsZooming) {
		return false;
	}
	this.bIsZooming = true;
	var h = 5;
	var c = 0;
	if (EzServerClient.GlobeParams.ZoomLevelSequence == 0
			|| EzServerClient.GlobeParams.ZoomLevelSequence == 3) {
		var d = _m_MapSpan[j] / _m_MapSpan[this.getZoomLevel()];
		var f = (d - 1) / h;
	} else {
		var d = _m_MapSpan[j] / _m_MapSpan[this.getZoomLevel()];
		if (d > 1) {
			var f = (1 - d) / h / 2;
		} else {
			var f = (1 - d) / h * 2;
		}
	}
	this.iOldLeft = parseInt(this.div.style.left);
	this.iOldTop = parseInt(this.div.style.top);
	if (typeof ezmap_overlay_div != "undefined") {
		for ( var g = 0; g < ezmap_overlay_div.length; g++) {
			ezmap_overlay_div[g].style.filter = "";
		}
	}
	if (this.infoWindow.isVisible()) {
		this.hideInfoWind();
		this.bInfoHasOpen = true;
	} else {
		this.bInfoHasOpen = false;
	}
	var b = this;
	_TmrModeFlatZoom = setInterval(function() {
		c++;
		if (c < (h + 1)) {
			b.styleZoom(1 + f * c);
		} else {
			window.clearInterval(_TmrModeFlatZoom);
			_TmrModeFlatZoom = null;
			b.styleZoom(j, true);
			b.zoomTo(j);
			if (b.bInfoHasOpen && !b.bInfoHasCloseClick) {
				b.openInfoWindow(b.pWinInfo.point.x, b.pWinInfo.point.y,
						b.pWinInfo.xml, false);
			}
			// 滚动结束后加载图片
			if (_this.showHeat) {
				if (_this.heatLoad)
					_this.heatLoad(_this.getBoundsLatLng(),_this.getZoomLevel());
			}
		}
	
	}, 10);
	return true;
} ;
*/
