map.html 22.8 KB
Newer Older
Five-菜鸟级's avatar
init  
Five-菜鸟级 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Baidu Maps</title>

<script charset="utf-8" src="https://api.map.baidu.com/api?v=3.0&ak=ONwdanPtvCDLHBSm184T2ynP"></script>
<script src="https://api.map.baidu.com/library/InfoBox/1.2/src/InfoBox_min.js"></script>

</head>
<body onload="initialize();">
	<style>
		html { height:100%; }
		body { height:100%;margin:0;padding:0;background-color:#fff; }
		.bigBox{height: 100vh;width: 100%; overflow: hidden;position: relative;}
		#search_box{position:fixed;top:5px;right:5px;z-index:9999;}
		#search_box input{
			-webkit-appearance: none;
			border-radius:3px;
			box-sizing:border-box;
			outline:0;
			box-shadow:0 0 3px rgba(0,0,0,0.4);
		}
		#search_box input[type="text"]{
			background-color:#fff;
			border:1px solid #ccc;
			color:#000;
			width:180px;
			padding:5px;
			font-size:16px;
			opacity:0.7;
			box-shadow:0 0 3px rgba(0,0,0,0.4);
		}
		#search_box input[type="button"]{
			margin-left:5px;
			background-color:#207ab7;
			border:1px solid #207ab7;
			color:#fff;
			padding:4px 6px;
			font-size:14px;
		}
		.setBox{ width: 100%; height: 26vh; position: absolute;left: 0;transition: all 0.6s;-webkit-transition: all 0.6s; bottom: -26vh;z-index: 99;background: #fff; }
		.setBox.on{  bottom: 0; }
	
		.tox .tox-form__controls-h-stack {
		align-items: center;
		display: flex;
		}
		
	.tox .tox-form__group {
		box-sizing: border-box;
		margin-bottom: 4px;
		margin-right:5px;
	}
	.tox .tox-label, .tox .tox-toolbar-label {
		color: rgba(34,47,62,.7);
		display: block;
		font-size: 14px;
		font-style: normal;
		font-weight: 400;
		line-height: 1.3;
		padding: 0 8px 0 0;
		text-transform: none;
		white-space: nowrap;
		}
		.tox .tox-selectfield select, .tox .tox-textarea, .tox .tox-textfield, .tox .tox-toolbar-textfield {
		-webkit-appearance: none;
		-moz-appearance: none;
		appearance: none;
		background-color: #fff;
		border-color: #ccc;
		border-radius: 3px;
		border-style: solid;
		border-width: 1px;
		box-shadow: none;
		box-sizing: border-box;
		color: #222f3e;
		font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
		font-size: 16px;
		line-height: 24px;
		margin: 0;
		min-height: 34px;
		outline: 0;
		padding: 5px 4.75px;
		resize: none;
		width: 100%;
	}
	.tox .tox-textfield:focus,
	.tox .tox-selectfield select:focus,
	.tox .tox-textarea:focus {
	  border-color: #207ab7;
	  box-shadow: none;
	  outline: none;
	}
	.tox .tox-textfield:focus,
	.tox .tox-selectfield select:focus,
	.tox .tox-textarea:focus {
	  border-color: #207ab7;
	  box-shadow: none;
	  outline: none;
	  padding: 4px;
	}
	.tox .tox-button--icon .tox-icon svg, .tox .tox-button.tox-button--icon .tox-icon svg, .tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg {
		display: block;
		fill: currentColor;
		outline: none;
	}
	.tox .tox-lock.tox-locked .tox-lock-icon__unlock, .tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock {
		display: none;
	}
	.tox .tox-button--naked {
		background-color: transparent;
		border-color: transparent;
		box-shadow: unset;
		color: #222f3e;
		padding: 4px;
	}
	.tox .tox-button--naked[disabled] {
	  background-color: #f0f0f0;
	  border-color: #f0f0f0;
	  box-shadow: none;
	  outline: none;
	  color: rgba(34, 47, 62, 0.5);
	}
	.tox .tox-button--naked:hover:not(:disabled) {
	  background-color: #e3e3e3;
	  border-color: #e3e3e3;
	  box-shadow: none;
	  color: #222f3e;
	  outline: none;
		  
	}
	.tox .tox-button--naked:focus:not(:disabled) {
	  background-color: #e3e3e3;
	  border-color: #e3e3e3;
	  box-shadow: none;
	  outline: none;
	
	  color: #222f3e;
	}
	.tox .tox-button--naked:active:not(:disabled) {
	  background-color: #d6d6d6;
	  border-color: #d6d6d6;
	  box-shadow: none;
	  color: #222f3e;
	}
	.tox .tox-button--naked .tox-icon svg {
	  fill: currentColor;
	}
	.tox .tox-button--naked.tox-button--icon:hover:not(:disabled) {
	  color: #222f3e;
	}
	
	.tox :not(svg):not(rect) {
		box-sizing: inherit;
		color: inherit;
		cursor: inherit;
		direction: inherit;
		font-family: inherit;
		font-size: inherit;
		font-style: inherit;
		font-weight: inherit;
		line-height: inherit;
		-webkit-tap-highlight-color: inherit;
		text-align: inherit;
		text-decoration: inherit;
		text-shadow: inherit;
		text-transform: inherit;
		vertical-align: inherit;
		white-space: inherit;
	}
	.tox .tox-button {
		
		background-color: transparent;
		background-image: none;
		background-position: 0 0;
		background-repeat: repeat;
		/* border-color: #207ab7; */
		border-radius: 3px;
		border-style: solid;
		border-width: 1px;
		box-shadow: none;
		box-sizing: border-box;
		color: #333;
		cursor: pointer;
		display: inline-block;
		font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
		font-size: 14px;
		font-weight: 700;
		letter-spacing: normal;
		line-height: 24px;
		margin: 0;
		outline: 0;
		padding: 4px 16px;
		text-align: center;
		text-decoration: none;
		text-transform: capitalize;
		white-space: nowrap;
	}
	.textareaBox{ width: 26%;padding: 2% 0%; display: inline-block;vertical-align: top!important;margin-left:2%;}
	.setCheck{vertical-align: top!important; width: 9%;min-width: 100px; padding: 2% 0%; display: inline-block;margin-left:2%;}
	.setsize{vertical-align: top!important; width: 35%;padding: 2% 0%;  display: inline-block;margin-left:2%; }
	.openBtn{ display: block;transition: all 0.3s; margin: 0 auto; width: 30px;height: 30px; margin-top: -30px; cursor: pointer; transform: rotate(180deg); }
	
	.setBox.on .openBtn{transform: rotate(0deg);}
	.infoBoxContent{font-size:12px;padding:10px 8px;margin-bottom:3px; line-height: 1.5;letter-spacing: 1px;background: rgba(255,255,255,0.95); border: none; box-sizing: border-box;-moz-box-sizing:border-box; /* Firefox */-webkit-box-sizing:border-box; /* Safari */ }
		.infoBoxContent>i:last-child{display: block; content: ""; width: 15px;transform: rotate(45deg); height: 15px;position: absolute;bottom:-5px;left: 50%; margin-left:-8px;z-index: -1; background:inherit ;}
		.infoBoxContent *{line-height: 1.5; margin: 0;padding: 0; }
		.BMap_cpyCtrl.BMap_noprint.anchorBL{display: none!important;}
		.anchorBL{display: none!important;}
		.showBox{ pointer-events: none; opacity: 0.5;}
		.showBox[name="show"]{ pointer-events: all; opacity:1;}
		
		.infoBox>img{display: none!important;}
	</style>
   <div class="bigBox">
	<div id="search_box"><input id="kw" type="text" value="" autocomplete="off" placeholder="输入要搜索的地点" /><input type="button" value="搜索" onclick="searchByStationName()"></div>
	<div id="map_canvas" style="width:100%; height:100%"></div>
	<div class="setBox tox" id="setBoxID">
		<a href="javascript:openBox()" class="openBtn" ><svg t="1604471043166" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7209" width="30" height="30">
			<path d="M992.27 339.723l-466.975 216.039c-4.432 2.77-9.417 4.431-14.957 4.43100001l-1.662 0c-5.54 0-10.525-1.662-14.402-4.43100001l-466.976-216.03999999c-12.741-5.539-18.83499999-18.833-12.741-30.46600001s21.04999999-16.618 34.345-11.079l460.882 213.27 460.883-213.27c12.74-5.54 28.25100001 0 34.345 11.079 6.093 11.633 0.553 25.481-12.741 30.467z" fill="#1C6CA1"></path>
			<path d="M48.902 470.45399999l460.882 213.27000001 460.883-213.27c12.74-5.54 28.25100001 0 34.345 11.079 6.093 11.633 0 24.928-12.741 30.467l-466.97599999 216.039c-4.432 2.77-9.417 4.431-14.95700001 4.431l-1.662 0c-5.54 0-10.525-1.662-14.402-4.431L27.29800001 512c-12.741-5.54-18.835-18.834-12.74100001-30.467s21.604-16.618 34.345-11.07900001z" fill="#1C6CA1"></path></svg>
		</a>
		 <div class="setsize " style="width: 18%; display: none;">
			<label class="tox-label" for="form-field_597838573111604453101745" style="font-size: 18px; padding-left:0px; letter-spacing: 1px;margin-bottom:10px; border-bottom: 1px solid #d6d6d6;">设置地图宽高</label>
			<div class="tox-form__controls-h-stack" style="padding-left:10px;">
				<div class="tox-form__group">
					<label class="tox-label" for="form-field_597838573111604453101745"></label>
					<input type="text" tabindex="-1" id="wInputID"   onBlur="setWHsize(0)" data-alloy-tabstop="true" class="tox-textfield" id="">
				</div>
				<div class="tox-form__group">
					<label class="tox-label" for=""></label>
					<input type="text" tabindex="-1" id="hInputID"   onBlur="setWHsize(1)" data-alloy-tabstop="true" class="tox-textfield" >
				</div>
				<div class="tox-form__group"><label class="tox-label">&nbsp;</label>
					 <button title="保持宽高比" type="button" data-alloy-tabstop="true" tabindex="-1" class="tox-lock tox-button tox-button--naked tox-button--icon tox-locked" aria-pressed="true">
						 <span class="tox-icon tox-lock-icon__lock" id="lockID" style="display: none;"  onclick="lock(true)"><svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" fill-rule="evenodd"></path></svg></span>
						 <span class="tox-icon tox-lock-icon__unlock" id="unlockID" style="display: block;"  onclick="lock(false)"><svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"></path></svg></span>
					</button>
				</div>
				 
				
			</div>
			<!-- <div class="tox-form__group"  style="padding-left:10px;" >
				<input type="text" tabindex="-1" id="bdDNameID"  style="display: none; height: 28px;min-height: 28px;" onBlur="setbdDName()" placeholder="请输入导航目的名称" data-alloy-tabstop="true" class="tox-textfield" >
			</div> -->
		</div> 
		<div class="setCheck">
			<div class="tox-form__group">
				<label class="tox-label" style="font-size: 18px; padding-left:0px; letter-spacing: 1px;margin-bottom:10px; border-bottom: 1px solid #d6d6d6;">控件设置</label>
				<label class="tox-checkbox" onclick="showBOX()">
				 <input type="checkbox" data-alloy-tabstop="true" tabindex="-1" class="tox-checkbox__input" id="openboxID">
				 <span unselectable="on" class="tox-checkbox__label tox-label"  for="form-field_6689627266931604472573007" style="user-select: none; display: inline!important;">信息弹框</span>
			   </label><br>
				<label class="tox-checkbox" onclick="openSF()">
						<input type="checkbox" data-alloy-tabstop="true" tabindex="-1" class="tox-checkbox__input" id="openSFID">
						<span unselectable="on" class="tox-checkbox__label tox-label"  for="form-field_6689627266931604472573007" style="user-select: none; display: inline!important;">缩放控件</span>
				</label>
				<label class="tox-checkbox" onclick="openDH()">
					<input type="checkbox" data-alloy-tabstop="true" tabindex="-1" class="tox-checkbox__input" id="openDHID">
					<span unselectable="on" class="tox-checkbox__label tox-label"  for="form-field_6689627266931604472573007" style="user-select: none; display: inline!important;">导航功能</span>
				</label><br>
				<div class="tox-form__group"  style="padding-left:10px;" >
					<input type="text" tabindex="-1" id="bdDNameID"  style="display: none; height: 24px;min-height: 24px; min-width: 200px;" onBlur="setbdDName()" placeholder="请输入导航目的名称" data-alloy-tabstop="true" class="tox-textfield" >
				</div>
			</div>
		</div>
		<div class="setsize showBox">
				<label class="tox-label" for="form-field_597838573111604453101745" style="font-size: 18px; padding-left:0px; letter-spacing: 1px;margin-bottom:10px; border-bottom: 1px solid #d6d6d6;">设置信息弹框</label>
				<div class="tox-form__controls-h-stack" style="padding-left:10px;">
					<div class="tox-form__group" style="flex: 1;">
						<label class="tox-label" for="form-field_597838573111604453101745"></label>
						<input type="text" tabindex="-1" id="boxwInputID"   onBlur="setboxWHsize(0)" data-alloy-tabstop="true" class="tox-textfield" id="">
					</div>
					<div class="tox-form__group" style="flex: 1;">
						<label class="tox-label" for=""></label>
						<input type="text" tabindex="-1" id="boxhInputID"   onBlur="setboxWHsize(1)" data-alloy-tabstop="true" class="tox-textfield" >
					</div>
						<div class="tox-form__group" style="flex: 0.5;"><label class="tox-label">&nbsp;</label>
						 <button title="保持宽高比" type="button" data-alloy-tabstop="true" tabindex="-1" class="tox-lock tox-button tox-button--naked tox-button--icon tox-locked" aria-pressed="true">
							 <span class="tox-icon tox-lock-icon__lock" id="boxlockID"  style="display: none;"  onclick="boxlock(true)"><svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7z" fill-rule="evenodd"></path></svg></span>
							 <span class="tox-icon tox-lock-icon__unlock" id="boxunlockID" style="display: block;"  onclick="boxlock(false)"><svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"></path></svg></span>
						</button>
					</div>
					<div class="tox-form__group" style="flex: 2;">
							<label class="tox-label" for="form-field_597838573111604453101745">设置背景颜色(#666)</label>
							<input type="text" tabindex="-1"   onBlur="setboxbg()" data-alloy-tabstop="true" class="tox-textfield" id="boxBgID">
					</div>
				</div>
			</div>
       <div class="textareaBox showBox">
		 <div class="tox-form__group tox-form__group--stretched">
			 <label class="tox-label" style="font-size: 18px; padding-left:0px; letter-spacing: 1px;margin-bottom:10px; border-bottom: 1px solid #d6d6d6;" for="form-field_1311027803221604462469765">信息编辑(支持html,禁用【】¥^)</label>
			 <textarea type="text"  class="tox-textarea"  onchange="setBoxHtml()" placeholder="信息标签" id="textID"></textarea>
		</div>
	  </div>
	</div>
  </div>
  <script>
	  function openBox(){
		 if( document.getElementById("setBoxID").className=="setBox tox on") document.getElementById("setBoxID").className="setBox tox";
		  else document.getElementById("setBoxID").className="setBox tox on";
	  }
		var editor=parent.tinymce.activeEditor;
		function insCnt(txt){
			editor.insertContent(txt);
			parent.tinymce.activeEditor.windowManager.close();
		}
	
		var map, geocoder;
		var marker; 
		var lng,lat;
		var infoBox;
		function initialize() {
			parent.tinymceBDBoxHtml=""
			map = new BMap.Map('map_canvas');
			var point = new BMap.Point(116.331398,39.897445);
			map.centerAndZoom(point, 14);
			map.addControl(new BMap.NavigationControl());
			map.enableScrollWheelZoom();
	
			//根据IP定位
			var myCity = new BMap.LocalCity();
			myCity.get(function(result){
				  map.setCenter(result.name);
				  lng = result.center.lng;
					lat = result.center.lat;
					var marker = new BMap.Marker(new BMap.Point(lng, lat));
					map.clearOverlays();
					map.addOverlay(marker);
					parent.tinymceLng = lng;
					parent.tinymceLat = lat;	
				});
	
			var gc = new BMap.Geocoder();
			gc.getLocation(point, function(rs){
				var addComp = rs.addressComponents;
				var address = [addComp.city].join('');
				//console.log(address);
			});
				
		 
		
			map.addEventListener('click',function(e){
				//alert(e.point.lng + "," + e.point.lat);
				lng=e.point.lng;
				lat=e.point.lat;
				marker = new BMap.Marker(new BMap.Point(e.point.lng, e.point.lat));
				// console.log( map.getZoom())
				// console.log( map)

				parent.tinymceBDZoom = map.getZoom()
				map.clearOverlays();
				map.addOverlay(marker);
				//insCnt(lng+','+lat);
				parent.tinymceLng=lng;
				parent.tinymceLat=lat;
				// parent.tinymceLat=lat;
				map.addOverlay(marker); // 将标注添加到地图中
				 if(!infoBox){setInfoBox();}
				 else{
					infoBox.remove();
					setInfoBox();
					openCheck.checked ?infoBox.show():'';
				 }

			});

		
			document.getElementById('kw').addEventListener('keypress',function(e){
				if(e.keyCode=='13'){
					e.preventDefault();
					searchByStationName();
				}
			});
		}

		function setboxbg(){
			parent.tinymceBDBgColor = document.getElementById("boxBgID").value;
			if(parent.tinymceBDBgColor) document.getElementById("infoBoxContentID").style.background = parent.tinymceBDBgColor|| "rgba(255,255,255,0.95)";
			// console.log(parent.tinymceBDBgColor)
		}
		function setbdDName(){
			parent.tinymceBDDName = document.getElementById("bdDNameID").value;
		}
		function setInfoBox(){
				let temHtml = parent.tinymceBDBoxHtml? '<div class="infoBoxContent" id="infoBoxContentID">'+parent.tinymceBDBoxHtml+'<i></i></div>' : '<div class="infoBoxContent" id="infoBoxContentID"><p>信息标签</p> <i></i></div>'
				infoBox = new BMapLib.InfoBox(map,temHtml,{
					boxStyle:{
					background:"rgba(255,255,255,0)"
					,width: parent.tinymceBDBoxW || "270px"
					,closeIconMargin: "1px 1px 0 0"
					,enableAutoPan: true
					,align: INFOBOX_AT_TOP
				}
				})
			
				infoBox.open(marker); 
				infoBox.hide();
				if(parent.tinymceBDBgColor) document.getElementById("infoBoxContentID").style.background = parent.tinymceBDBgColor|| "rgba(255,255,255,0.95)";
			}
		parent.tinymceBDDH = false;
		function openDH(){
			if(document.getElementById("openDHID").checked){
				parent.tinymceBDDH = document.getElementById("openDHID").checked;
				document.getElementById("bdDNameID").style.display="block";
			}else{document.getElementById("bdDNameID").style.display="none";}
			
		}
		parent.tinymceBDSF = false;
		function openSF(){
			parent.tinymceBDSF = document.getElementById("openSFID").checked;
		}
		
		let openCheck = document.getElementById('openboxID');
		function showBOX(){
			// infoBox.show();
			if(infoBox){
				if(openCheck.checked ){
					 infoBox.show();
					 document.getElementsByClassName("showBox")[0].setAttribute("name", "show")
					 document.getElementsByClassName("showBox")[1].setAttribute("name", "show")
					
				}else{ 
					infoBox.hide();
					document.getElementsByClassName("showBox")[0].setAttribute("name", "hide")
					 document.getElementsByClassName("showBox")[1].setAttribute("name", "hide")
				}
			}else{
				alert("请先标记地点");
				openCheck.checked= false;
			}
		}
		function setBoxHtml(){
			parent.tinymceBDBoxHtml = document.getElementById("textID").value;
			infoBox.setContent('<div class="infoBoxContent" id="infoBoxContentID"><p>'+parent.tinymceBDBoxHtml+'</p><i></i></div>');
			if(parent.tinymceBDBgColor) document.getElementById("infoBoxContentID").style.background = parent.tinymceBDBgColor|| "rgba(255,255,255,0.95)";
		}
		function searchByStationName() {
			var localSearch = new BMap.LocalSearch(map);
			localSearch.enableAutoViewport(); //允许自动调节窗体大小
			map.clearOverlays();//清空原来的标注
			var keyword = document.getElementById("kw").value;
			localSearch.setSearchCompleteCallback(function (searchResult) {
				console.log(searchResult);
				if(searchResult.Ir?.length==0){
					alert('搜索不到该地区');
					return false;
				}
				var poi = searchResult.Ir[0];
				map.centerAndZoom(poi.point, 14);
			    marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point.lat));
				parent.tinymceLng=poi.point.lng;
				parent.tinymceLat=poi.point.lat;
				map.addOverlay(marker);
				if(!infoBox){setInfoBox();}
				 else{
					infoBox.remove();
					setInfoBox();
					openCheck.checked ?infoBox.show():'';
				 }

			});
			localSearch.search(keyword);
			return false;
		}
	
		var unFlog = false;
		let wInput = document.getElementById("wInputID");
		let hInput = document.getElementById("hInputID");
		parent.tinymceBDW = wInput.value="400px";
		parent.tinymceBDH = hInput.value="200px";
		var boxunFlog = false;
		let boxwInput = document.getElementById("boxwInputID");
		let boxhInput = document.getElementById("boxhInputID");
		parent.tinymceBDBoxW = boxwInput.value="270px";
		parent.tinymceBDBoxH = boxhInput.value="auto";
		function lock(o){
			if(o){
				document.getElementById("lockID").style.display="none";
				document.getElementById("unlockID").style.display="block";
			   unFlog = false;
			}else{
			   document.getElementById("unlockID").style.display="none";
			   document.getElementById("lockID").style.display="block";	
			   unFlog = true;
			}
		}
		function boxlock(o){
			if(o){
				document.getElementById("boxlockID").style.display="none";
				document.getElementById("boxunlockID").style.display="block";
			    boxunFlog = false;
			}else{
			   document.getElementById("boxunlockID").style.display="none";
			   document.getElementById("boxlockID").style.display="block";	
			   boxunFlog = true;
			}
		}
	    function proportion(o1,o2,n1,n2){
			if(!(/^[0-9]+.?[0-9]*$/.test(n2.value.replace(/px/i,'').replace(/%/,'')))){n2.value="100%"}
			let proportion = (parseInt(o1)/parseInt(o2))*parseInt(n2.value);
			!proportion? proportion = 100:'';
			// console.log(proportion);
               if(n2.value.match("%")){
                    n1.value= proportion + '%';
			   }else{
				  n1.value= proportion + 'px';
				  n2.value.match('px')?'':n2.value = n2.value+'px'
			  }
		}
		function setWHsize(i){
			if(unFlog){
				i ? proportion(parent.tinymceBDW,parent.tinymceBDH, wInput, hInput,i) : proportion(parent.tinymceBDH,parent.tinymceBDW, hInput , wInput);
			}
			parent.tinymceBDW = wInput.value;
			parent.tinymceBDH = hInput.value;
		}
		function setboxWHsize(i){
			if(boxunFlog){
				i ? proportion(parent.tinymceBDBoxW,parent.tinymceBDBoxH, boxwInput, boxhInput,i) : proportion(parent.tinymceBDBoxH,parent.tinymceBDBoxW, boxhInput , boxwInput);
			}
			parent.tinymceBDBoxW = boxwInput.value;
			parent.tinymceBDBoxH = boxhInput.value;
			infoBox.remove()
			setInfoBox();
			infoBox.show();
			document.getElementById("infoBoxContentID").style.width =  parent.tinymceBDBoxW;
			document.getElementById("infoBoxContentID").style.height = parent.tinymceBDBoxH;
			
		}
	
		onbeforeunload = function(){
			// console.log("1212")
			parent.tinymceBDW = wInput.value;
			parent.tinymceBDH = hInput.value;
			parent.tinymceBDBoxW = boxwInput.value;
			parent.tinymceBDBoxH = boxhInput.value;
			parent.tinymceBDBoxHtml = document.getElementById("textID").value;
			parent.tinymceBDDH = document.getElementById("openDHID").checked;
			parent.tinymceBDBgColor = document.getElementById("boxBgID").value;
			parent.tinymceBDSF = document.getElementById("openSFID").checked;
			parent.tinymceBDDName = document.getElementById("bdDNameID").value;
		}
	</script>
</body>
</html>