<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>加载百度地图测试</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css' rel='stylesheet' />
<script src='../js/turf.min.js'></script>
<script type="text/javascript" src="coordtransform.js"></script>
<style>
body {
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 20px;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<script>
function SetOpacity() {
var opacitySelect = document.getElementById("opacitySelect");
mapboxBaidu.setOpacity(opacitySelect.value);
//map.setPaintProperty('chicago', 'raster-opacity', parseInt(e.target.value, 10) / 100);
}
function SetLevel() {
}
</script>
<div>
<select onchange="SetOpacity()" style="width:100px;height:20px;z-index:100000" id="opacitySelect">
<option value="0.1">0.1</option>
<option value="0.2">0.2</option>
<option value="0.3">0.3</option>
<option value="0.4">0.4</option>
<option value="0.5">0.5</option>
<option value="0.6">0.6</option>
<option value="0.7">0.7</option>
<option value="0.8">0.8</option>
<option value="0.9">0.9</option>
<option value="1">1</option>
</select>
<select onchange="SetLevel()" style="width:100px;height:20px;z-index:100000" id="LevelSelecty">
<option value="19">19</option>
<option value="18">18</option>
<option value="17">17</option>
<option value="16">16</option>
<option value="15">15</option>
<option value="14">14</option>
<option value="13">13</option>
<option value="12">12</option>
<option value="11">11</option>
<option value="10">10</option>
<option value="9">9</option>
<option value="19">19</option>
</select>
<div id="zoom" style=" position: absolute; top: 0px; left: 100px; width: 100px; height: 20px;"></div>
</div>
<div id='map'></div>
<script>
function Xa(a) {
return "function" === typeof a
}
function Wa(a) {
return "number" === typeof a
}
function Za(a) {
return "string" == typeof a
}
function Db(a) {
return "undefined" != typeof a
}
function Eb(a) {
return "object" == typeof a
}
function H(a, b) {
isNaN(a) && (a = Hb(a), a = isNaN(a) ? 0 : a);
Za(a) && (a = parseFloat(a));
isNaN(b) && (b = Hb(b), b = isNaN(b) ? 0 : b);
Za(b) && (b = parseFloat(b));
this.lng = a;
this.lat = b
}
H.eM = function (a) {
return a && 180 >= a.lng && -180 <= a.lng && 74 >= a.lat && -74 <= a.lat
};
H.prototype.nb = function (a) {
return a && this.lat == a.lat && this.lng == a.lng
};
var p = null;
var j = undefined;
function S() {
this.lP = 6370996.81;
this.tG = [1.289059486E7, 8362377.87, 5591021, 3481989.83, 1678043.12, 0];
this.Eu = [75, 60, 45, 30, 15, 0];
this.rP = [
[1.410526172116255E-8, 8.98305509648872E-6, -1.9939833816331, 200.9824383106796, -187.2403703815547, 91.6087516669843, -23.38765649603339, 2.57121317296198, -0.03801003308653, 1.73379812E7],
[-7.435856389565537E-9, 8.983055097726239E-6, -0.78625201886289, 96.32687599759846, -1.85204757529826, -59.36935905485877, 47.40033549296737, -16.50741931063887, 2.28786674699375, 1.026014486E7],
[-3.030883460898826E-8, 8.98305509983578E-6, 0.30071316287616, 59.74293618442277, 7.357984074871, -25.38371002664745, 13.45380521110908, -3.29883767235584, 0.32710905363475, 6856817.37],
[-1.981981304930552E-8, 8.983055099779535E-6, 0.03278182852591, 40.31678527705744, 0.65659298677277, -4.44255534477492, 0.85341911805263, 0.12923347998204, -0.04625736007561, 4482777.06],
[3.09191371068437E-9, 8.983055096812155E-6, 6.995724062E-5, 23.10934304144901, -2.3663490511E-4, -0.6321817810242, -0.00663494467273, 0.03430082397953, -0.00466043876332, 2555164.4],
[2.890871144776878E-9, 8.983055095805407E-6, -3.068298E-8, 7.47137025468032, -3.53937994E-6, -0.02145144861037, -1.234426596E-5, 1.0322952773E-4, -3.23890364E-6, 826088.5]
];
this.qG = [
[-0.0015702102444, 111320.7020616939, 1704480524535203, -10338987376042340, 26112667856603880, -35149669176653700, 26595700718403920, -10725012454188240, 1800819912950474, 82.5],
[8.277824516172526E-4, 111320.7020463578, 6.477955746671607E8, -4.082003173641316E9, 1.077490566351142E10, -1.517187553151559E10, 1.205306533862167E10, -5.124939663577472E9, 9.133119359512032E8, 67.5],
[0.00337398766765, 111320.7020202162, 4481351.045890365, -2.339375119931662E7, 7.968221547186455E7, -1.159649932797253E8, 9.723671115602145E7, -4.366194633752821E7, 8477230.501135234, 52.5],
[0.00220636496208, 111320.7020209128, 51751.86112841131, 3796837.749470245, 992013.7397791013, -1221952.21711287, 1340652.697009075, -620943.6990984312, 144416.9293806241, 37.5],
[-3.441963504368392E-4, 111320.7020576856, 278.2353980772752, 2485758.690035394, 6070.750963243378, 54821.18345352118, 9540.606633304236, -2710.55326746645, 1405.483844121726, 22.5],
[-3.218135878613132E-4, 111320.7020701615, 0.00369383431289, 823725.6402795718, 0.46104986909093, 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238884252424, 7.45]
];
this.w2 = function (a, b) {
if (!a || !b) return 0;
var c, d, a = this.Ab(a);
if (!a) return 0;
c = this.Tk(a.lng);
d = this.Tk(a.lat);
b = this.Ab(b);
return !b ? 0 : this.Re(c, this.Tk(b.lng), d, this.Tk(b.lat))
};
this.Zo = function (a, b) {
if (!a || !b) return 0;
a.lng = this.OD(a.lng, -180, 180);
a.lat = this.SD(a.lat, -74, 74);
b.lng = this.OD(b.lng, -180, 180);
b.lat = this.SD(b.lat, -74, 74);
return this.Re(this.Tk(a.lng), this.Tk(b.lng), this.Tk(a.lat), this.Tk(b.lat))
};
this.Ab = function (a) {
if (a === p || a === j) return new H(0, 0);
var b, c;
b = new H(Math.abs(a.lng), Math.abs(a.lat));
for (var d = 0; d < this.tG.length; d++) if (b.lat >= this.tG[d]) {
c = this.rP[d];
break
}
a = this.qK(a, c);
return a = new H(a.lng.toFixed(6), a.lat.toFixed(6))
};
this.zb = function (a) {
if (a === p || a === j || 180 < a.lng || -180 > a.lng || 90 < a.lat || -90 > a.lat) return new H(0, 0);
var b, c;
a.lng = this.OD(a.lng, -180, 180);
a.lat = this.SD(a.lat, -74, 74);
b = new H(a.lng, a.lat);
for (var d = 0; d < this.Eu.length; d++) if (b.lat >= this.Eu[d]) {
c = this.qG[d];
break
}