gis-map-szdp 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a.js +44 -0
- package/dist/china_full.json +26527 -0
- package/dist/gismap.es.js +9430 -6077
- package/dist/gismap.umd.js +14 -14
- package/dist/index.css +1 -1
- package/package.json +1 -1
package/dist/a.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
getLongTime() {
|
|
2
|
+
let nowDate = new Date();
|
|
3
|
+
let year = nowDate.getFullYear();
|
|
4
|
+
let month = nowDate.getMonth() + 1;
|
|
5
|
+
let today = nowDate.getDate();
|
|
6
|
+
let hours = nowDate.getHours();
|
|
7
|
+
let minutes = nowDate.getMinutes();
|
|
8
|
+
let seconds = nowDate.getSeconds();
|
|
9
|
+
if (month >= 1 && month <= 9) {
|
|
10
|
+
month = "0" + month;
|
|
11
|
+
}
|
|
12
|
+
if (today >= 1 && today <= 9) {
|
|
13
|
+
today = "0" + today;
|
|
14
|
+
}
|
|
15
|
+
let currentdate =
|
|
16
|
+
year +
|
|
17
|
+
"-" +
|
|
18
|
+
month +
|
|
19
|
+
"-" +
|
|
20
|
+
today +
|
|
21
|
+
" " +
|
|
22
|
+
hours +
|
|
23
|
+
":" +
|
|
24
|
+
minutes +
|
|
25
|
+
":" +
|
|
26
|
+
seconds;
|
|
27
|
+
let longTime = new Date(
|
|
28
|
+
currentdate.replace(new RegExp("-", "gm"), "/")
|
|
29
|
+
).getTime();
|
|
30
|
+
return longTime;
|
|
31
|
+
}
|
|
32
|
+
initGaodeLayer() {
|
|
33
|
+
//加载高德路况
|
|
34
|
+
let gaodeLayer = new TileLayer({
|
|
35
|
+
layerName: "gaodeLayer",
|
|
36
|
+
source: new XYZ({
|
|
37
|
+
url:
|
|
38
|
+
"http://tm.amap.com/trafficengine/mapabc/traffictile?v=1.0&;t=1&x={x}&y={y}&z={z}&&t=" +
|
|
39
|
+
getLongTime(),
|
|
40
|
+
}),
|
|
41
|
+
zIndex: 2,
|
|
42
|
+
});
|
|
43
|
+
this.map.addLayer(gaodeLayer);
|
|
44
|
+
}
|