From 7a76f297e76fe0fde9a7dc5cf95a84fe24a5ec55 Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期一, 24 十月 2022 10:49:42 +0800
Subject: [PATCH] 添加权限
---
js/function.js | 152 +++++++++++++++++++++-----------------------------
1 files changed, 64 insertions(+), 88 deletions(-)
diff --git a/js/function.js b/js/function.js
index 06ad5a1..19f935c 100644
--- a/js/function.js
+++ b/js/function.js
@@ -25,13 +25,13 @@
var day = date.getDate(); //鏃�
var hours = date.getHours(); //鏃�
var min = date.getMinutes(); //鍒�
- if(min >= 0 && min < 15){
+ if (min >= 0 && min < 15) {
min = 0
- }else if(min >=15 && min < 30){
+ } else if (min >= 15 && min < 30) {
min = 15
- }else if(min >=30 && min < 45){
+ } else if (min >= 30 && min < 45) {
min = 30
- }else{
+ } else {
min = 45
}
return year + "-" +
@@ -49,19 +49,19 @@
var day = date.getDate();//鏃�
var hours = date.getHours();//鏃�
var min = date.getMinutes(); //鍒�
- if(min >= 0 && min < 15){
+ if (min >= 0 && min < 15) {
min = 0
- }else if(min >= 15 && min < 30){
+ } else if (min >= 15 && min < 30) {
min = 15
- }else if(min >= 30 && min < 45){
+ } else if (min >= 30 && min < 45) {
min = 30
- }else{
+ } else {
min = 45
}
return year + "-" +
((month + 1) > 9 ? (month + 1) : "0" + (month + 1)) + "-" +
(day > 9 ? day : ("0" + day)) + " " +
- (hours > 9 ? hours : ("0" + hours )) + ":"+
+ (hours > 9 ? hours : ("0" + hours)) + ":" +
(min > 9 ? min : ("0" + min)) + ":00";
}
@@ -85,13 +85,13 @@
var month = date.getMonth();//鏈�
var day = date.getDate();//鏃�
var hours = date.getHours();//鏃�
- return (year +"")+
+ return (year + "") +
((month + 1) > 9 ? (month + 1) : "0" + (month + 1)) +
(day > 9 ? day : ("0" + day)) +
(hours > 9 ? hours : ("0" + hours)) + "0000";
}
mars3d.global_variables = default_system_params;
-mars3d.global_variables.grid_camerview =default_grid_camerview;
+mars3d.global_variables.grid_camerview = default_grid_camerview;
mars3d.global_variables.queryDataTStart = getDefaultDateTime();
mars3d.global_variables.queryDataTStartGeo = getDefaultDateTimeGeo();
mars3d.global_variables.queryDataTStartTaxi = getDefaultDateTimeTaxi();
@@ -102,13 +102,13 @@
//addMaskShanghai();
let d_context_menu = map.getDefaultContextMenu();
- map.bindContextMenu(d_context_menu.slice(0,3).concat(d_context_menu.slice(6,8)));
+ map.bindContextMenu(d_context_menu.slice(0, 3).concat(d_context_menu.slice(6, 8)));
addTDTAnnoLayer();
addHighlightLayerClearButton();
addTmpHighlightGraphicLayer();
mask_selection(regionCode);
-
+
//TODO
$.getJSON("data/getLayerListByUserid.json", { userid: mars3d.global_variables.userid }, (result) => {
result.data.forEach((item) => {
@@ -139,26 +139,26 @@
layer.options.parameters.viewparams = "userid:" + mars3d.global_variables.userid + ";regiontype:" + layer.options.regiontype + ";datetime:" + mars3d.global_variables.queryDataTStartGeo
layer.options.getFeatureInfoParameters.viewparams = "userid:" + mars3d.global_variables.userid + ";regiontype:" + layer.options.regiontype + ";datetime:" + mars3d.global_variables.queryDataTStartGeo
layer.reload();
- // } else if ([layer.id] == 1001 && layer.options.show) {
+ // } else if ([layer.id] == 1001 && layer.options.show) {
} else if ([layer.id] == 1001) {
var tmpguokong = map.getLayerById(1001);
tmpguokong.clear(true);
getGuokongPointFromServer(tmpguokong);
//graphiclayer.eachGraphic
- // } else if ([layer.id] == 1004 && layer.options.show) {
- // var tmpTaxi = map.getLayerById(1004);
- // tmpTaxi.clear(true);
- // setTaxiLayerMapClock();
- // for (var i = 0, len = data_list_1004.length; i < len; i++) {
- // getTaxiPathFromServerbySN(data_list_1004[i], tmpTaxi);
- // }
+ // } else if ([layer.id] == 1004 && layer.options.show) {
+ // var tmpTaxi = map.getLayerById(1004);
+ // tmpTaxi.clear(true);
+ // setTaxiLayerMapClock();
+ // for (var i = 0, len = data_list_1004.length; i < len; i++) {
+ // getTaxiPathFromServerbySN(data_list_1004[i], tmpTaxi);
+ // }
}
});
}
function taxi_reLoadLayers() {
var layers = map.getLayers({ layers: true });
layers.forEach((layer) => {
- if ([layer.id] == 1004 && layer.options.show) {
+ if ([layer.id] == 1004 && layer.options.show) {
var tmpTaxi = map.getLayerById(1004);
tmpTaxi.clear(true);
setTaxiLayerMapClock();
@@ -230,70 +230,46 @@
}
}
-function mask_selection(regionCode){
- if(regionCode == 0){
- geoJsonLayer = new mars3d.layer.GeoJsonLayer({
- id:9999,
- url: "./data/shanghai.json",
- mask: true, //鏍囪瘑涓洪伄缃╁眰銆愰噸鐐瑰弬鏁般��
- symbol: {
- styleOptions: {
- fill: true,
- color: "rgb(2,26,79)",
- outline: true,
- outlineColor: "#39E09B",
- outlineWidth: 3,
- outlineOpacity: 0.8,
- arcType: Cesium.ArcType.GEODESIC,
- clampToGround: true,
- },
- }
- });
- map.addLayer(geoJsonLayer);
- // return
- }else{
- //geojson 鍚勮鏀垮尯杈圭晫绾�
- geoJsonLayer = new mars3d.layer.GeoJsonLayer({
- id:9999,
- url: "./data/"+regionCode+".geojson",
- mask: true, //鏍囪瘑涓洪伄缃╁眰銆愰噸鐐瑰弬鏁般��
- symbol: {
- styleOptions: {
- fill: true,
- color: "rgb(2,26,79)",
- outline: true,
- outlineColor: "#39E09B",
- outlineWidth: 3,
- outlineOpacity: 0.5,
- arcType: Cesium.ArcType.GEODESIC,
- clampToGround: true,
- },
- },
-});
-map.addLayer(geoJsonLayer);
- }
-<<<<<<< HEAD
- debugger;
- //geojson 鍚勮鏀垮尯杈圭晫绾�
- geoJsonLayer = new mars3d.layer.GeoJsonLayer({
- url: "./data/"+regionCode+".geojson",
- mask: true, //鏍囪瘑涓洪伄缃╁眰銆愰噸鐐瑰弬鏁般��
- symbol: {
- styleOptions: {
- fill: true,
- color: "rgb(2,26,79)",
- outline: true,
- outlineColor: "#39E09B",
- outlineWidth: 3,
- outlineOpacity: 0.5,
- arcType: Cesium.ArcType.GEODESIC,
- clampToGround: true,
- },
+function mask_selection(regionCode) {
+ if (regionCode == 0) {
+ geoJsonLayer = new mars3d.layer.GeoJsonLayer({
+ id: 9999,
+ url: "./data/shanghai.json",
+ mask: true, //鏍囪瘑涓洪伄缃╁眰銆愰噸鐐瑰弬鏁般��
+ symbol: {
+ styleOptions: {
+ fill: true,
+ color: "rgb(2,26,79)",
+ outline: true,
+ outlineColor: "#39E09B",
+ outlineWidth: 3,
+ outlineOpacity: 0.8,
+ arcType: Cesium.ArcType.GEODESIC,
+ clampToGround: true,
},
- });
- map.addLayer(geoJsonLayer);
-=======
-
->>>>>>> 165c834d414f2c5f56ad6d259b5f18c26921cc94
-}
-
+ }
+ });
+ map.addLayer(geoJsonLayer);
+ // return
+ } else {
+ //geojson 鍚勮鏀垮尯杈圭晫绾�
+ geoJsonLayer = new mars3d.layer.GeoJsonLayer({
+ id: 9999,
+ url: "./data/" + regionCode + ".geojson",
+ mask: true, //鏍囪瘑涓洪伄缃╁眰銆愰噸鐐瑰弬鏁般��
+ symbol: {
+ styleOptions: {
+ fill: true,
+ color: "rgb(2,26,79)",
+ outline: true,
+ outlineColor: "#39E09B",
+ outlineWidth: 3,
+ outlineOpacity: 0.5,
+ arcType: Cesium.ArcType.GEODESIC,
+ clampToGround: true,
+ },
+ },
+ });
+ map.addLayer(geoJsonLayer);
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.1