From ecb5c15c627743f942eed0820a2735dc1f298990 Mon Sep 17 00:00:00 2001 From: Alinux Date: Wed, 20 Sep 2017 10:33:43 +0800 Subject: [PATCH] =?UTF-8?q?baidu.js=E5=A2=9E=E5=8A=A0=E5=BA=95=E5=9B=BE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/js/layer/Baidu.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/js/layer/Baidu.js b/examples/js/layer/Baidu.js index 22e1d91..a190bc1 100644 --- a/examples/js/layer/Baidu.js +++ b/examples/js/layer/Baidu.js @@ -46,15 +46,25 @@ SuperMap.Layer.Baidu = SuperMap.Class(SuperMap.CanvasLayer, { * Example: * (code) * - * var baiduLayer = new SuperMap.Layer.Baidu(); + * var baiduLayer = new SuperMap.Layer.Baidu(type); * (end) */ - initialize: function (options) { + initialize: function (type,options) { var me = this; me.name = "Baidu"; - me.url = "http://online${num}.map.bdimg.com/onlinelabel/?qt=tile&x=${x}&y=${y}&z=${z}&styles=pl&udt=20150815&scaler=1"; +// me.url = "http://online${num}.map.bdimg.com/onlinelabel/?qt=tile&x=${x}&y=${y}&z=${z}&styles=pl&udt=20150815&scaler=1"; // me.url = "http://shangetu${num}.map.bdimg.com/it/u=x=${x};y=${y};z=${z};v=017;type=web&fm=44&udt=20130712"; + if (type =="PHYSICAL")//普通 + me.url = "http://online${num}.map.bdimg.com/onlinelabel/?qt=tile&x=${x}&y=${y}&z=${z}&styles=pl&udt=20150815&scaler=1"; + else if (type=="SATELLITE")//卫星 + me.url = "http://shangetu1.map.bdimg.com/it/u=x=${x};y=${y};z=${z};v=009;type=sate&fm=46&udt=20130506"; + else if (type=="DARK")//夜视 + me.url = "http://api1.map.bdimg.com/customimage/tile?&x=${x}&y=${y}&z=${z}&udt=20170908&scale=1&ak=E4805d16520de693a3fe707cdc962045&customid=dark" + else if (type=="ROUTE")//道路 + me.url = "http://online${num}.map.bdimg.com/tile/?qt=tile&x=${x}&y=${y}&z=${z}&styles=sl&udt=20170908" + else + me.url = "http://online${num}.map.bdimg.com/onlinelabel/?qt=tile&x=${x}&y=${y}&z=${z}&styles=pl&udt=20150815&scaler=1"; /* offsetXY = []; offsetXY.push({x:-3,y:1});//3 @@ -176,4 +186,4 @@ SuperMap.Layer.Baidu = SuperMap.Class(SuperMap.CanvasLayer, { }, CLASS_NAME: 'SuperMap.Layer.Baidu' -}); \ No newline at end of file +});