<?php
class Normal_MapChoose extends netsControl {
	public function Normal_MapChoose(){
		$this->netsControl();
	}
	public function Control($pColumn){
		$tmpControl=$pColumn['stcotName'].'Txt'.$pColumn['NameExtend'];
		$tmpIntroduct='';
		if(strlen($pColumn['stcoctUiIntroduct'])>0 && $pColumn['stcoctUiIntroduct']!='&nbsp;'){
			$tmpIntroduct='<div id="'.$tmpControl.'_Messagebox" class="ControlIntroduct">'.$pColumn['stcoctUiIntroduct'].'</div>';
		}else{
			$tmpIntroduct='<div id="'.$tmpControl.'_Messagebox" class="DHidden">'.$pColumn['stcoctUiIntroduct'].'</div>';
		}
		$tmpParameters=explode($this->sysSPLIT13,$pColumn['Parameter']);
		if(count($tmpParameters)!=5){
			$tmpParameters=array('','','','',);
		}
?>
<!-- #<?php echo ($tmpControl); ?> -->
<?php if ($pColumn['stcoctSingleLine']==0) { ?><tr id="<?php echo($tmpControl); ?>_RowBox" class="<?php echo ($pColumn['LineStyle']); ?>"><?php } ?>
<td id="<?php echo ($tmpControl); ?>_Label" class="PanelTitle"><?php echo ($pColumn['stcoctUiName']); ?>：</td>
<td id="<?php echo ($tmpControl); ?>PanelBox" class="PanelBox <?php if ($pColumn['stcoctSingleLine']==1) { ?>PanelMultiColumn<?php } ?>" <?php if ($pColumn['stcoctSingleLine']==0 && $pColumn['stcoctColspan']>1) { ?>colspan="<?php echo($pColumn['stcoctColspan']); ?>"<?php } ?>>
<!--S.<?php echo ($tmpControl); ?>-->
<div class="MapChoose_0">您可以通过<?php echo($this->sysFileConfig['sysTitle']); ?>提供的地图控件来查看、设置地图。<?php if($this->sysFileConfig['MapControlShowType']==1){ ?><br /><a href="#Here" class="Link1 FBlue3" onclick="tmpMap_<?php echo ($tmpControl); ?>.showMap(); tmpMap_<?php echo ($tmpControl); ?>.ShowInfowindow(-1);">为了提高平台的运行速度，请点击来链接来显示地图；或点击来重新载入地图。</a><?php } ?></div>
<div id="<?php echo ($tmpControl); ?>_Box" class="MapChoose_1"><?php if($this->sysFileConfig['MapControlShowType']==1){ ?>请点击上面的链接来加载地图控件。<?php } ?></div>
<div id="<?php echo ($tmpControl); ?>_SearchBox" class="DHidden"><table><tr>
	<td><input id="<?php echo ($tmpControl); ?>_SearchTxt" name="<?php echo ($tmpControl); ?>_SearchTxt" value="" /></td>
	<td><input type="button" value="查询" onclick="tmpMap_<?php echo ($tmpControl); ?>.searchMap();" /></td>
	</tr></table></div>
<script src="<?php echo ($this->sysFileConfig['MapServiceJscriptPath_A'].$this->sysFileConfig['MapAPIKey']); ?>" type="text/javascript"></script>
<script src="<?php echo ($this->sysFileConfig['MapServiceJscriptPath_B']); ?>" type="text/javascript"></script>
<script src="<?php echo ($this->sysFileConfig['sysUiCoreRoot'].$this->sysFileConfig['MapControlJscriptPath']); ?>" type="text/javascript"></script>

<script type="text/javascript">
var tmpMap_<?php echo ($tmpControl); ?>=new netsMap_Google();
tmpMap_<?php echo ($tmpControl); ?>.sName="<?php echo ($tmpControl); ?>";
tmpMap_<?php echo ($tmpControl); ?>.sCenter_X=<?php echo($this->sysFileConfig['MapPositionX']); ?>;
tmpMap_<?php echo ($tmpControl); ?>.sCenter_Y=<?php echo($this->sysFileConfig['MapPositionY']); ?>;
tmpMap_<?php echo ($tmpControl); ?>.sSize_Width=<?php echo($this->sysFileConfig['MapControlWidth']); ?>;
tmpMap_<?php echo ($tmpControl); ?>.sSize_Height=<?php echo($this->sysFileConfig['MapControlHeight']); ?>;
tmpMap_<?php echo ($tmpControl); ?>.sControl_MapIntroduct="<?php echo($tmpParameters[0]); ?>";
tmpMap_<?php echo ($tmpControl); ?>.sControl_MapX="<?php echo($tmpParameters[1]); ?>";
tmpMap_<?php echo ($tmpControl); ?>.sControl_MapY="<?php echo($tmpParameters[2]); ?>";
tmpMap_<?php echo ($tmpControl); ?>.sImgPath="<?php echo ($this->sysFileConfig['sysUiCoreRoot'].'Ui/Common/Img/Map/'); ?>";

netsMap_Google.prototype.AttachSecretMessage=function(pMarker,pInfowindow){
	google.maps.event.addListener(pMarker,"click",function(){
		tmpAPP=tmpMap_<?php echo ($tmpControl); ?>;
		pInfowindow.open(tmpAPP.sMap,pMarker);
		});
	google.maps.event.addListener(pMarker,"dragend",function(){
		tmpAPP=tmpMap_<?php echo ($tmpControl); ?>;
		tmpAPP.sMap.setCenter(pMarker.getPosition());
		pInfowindow.content=document.getElementById(tmpAPP.sControl_MapIntroduct).value;
		pInfowindow.open(tmpAPP.sMap,pMarker);
		document.getElementById(tmpAPP.sControl_MapX).value=pMarker.getPosition().lat();
		document.getElementById(tmpAPP.sControl_MapY).value=pMarker.getPosition().lng();
		});
		
	return 0;
}

</script>
<?php echo ($tmpIntroduct); ?>
<!--sendRequest--><!--E.<?php echo ($tmpControl); ?>--></td>
<td id="<?php echo ($tmpControl); ?>_ImgIntroduct" class="PanelImgIntroduct">
<?php if(strlen($pColumn['stcoctUiImgIntroduct'])>0 && $pColumn['stcoctUiImgIntroduct']!='&nbsp;'){ ?>
<a href="#Here"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_4.jpg" title="<?php echo($pColumn['stcoctUiImgIntroduct']); ?>" /></a>
<?php }else{ ?>&nbsp;<?php } ?></td><?php if ($pColumn['stcoctSingleLine']==0) { ?></tr><?php } ?>
<?php
	}
}
?>