qinbo
2021-12-23 e1c3d0f9135e9790fe1aa77a0927c29844f78117
add  mask
2个文件已修改
33 ■■■■■ 已修改文件
js/function.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
js/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
js/function.js
@@ -183,3 +183,30 @@
  }
}
function mask_selection(userid){
    //geojson 各行政区边界线
    if(userid != null || userid != undefined){
      geoJsonLayer = new mars3d.layer.GeoJsonLayer({
        url: "./data/"+userid+".geojson",
        mask: true, //标识为遮罩层【重点参数】
        symbol: {
          styleOptions: {
            fill: true,
            color: "rgb(2,26,79)",
            opacity: 0.9,
            outline: true,
            outlineColor: "#39E09B",
            outlineWidth: 8,
            outlineOpacity: 0.8,
            arcType: Cesium.ArcType.GEODESIC,
            clampToGround: true,
          },
        },
      });
      map.addLayer(geoJsonLayer);
    }else{
      return
    }
}
js/index.js
@@ -17,7 +17,7 @@
    //有父级
    request = $.extend(request, haoutil.system.getRequest(window.top));
  }
  debugger;
  // debugger;
  try {
    var jwtstr = request.JWT;
    var strs_ = jwtstr.split('.');
@@ -49,7 +49,7 @@
    window.top.location = mars3d.global_variables.un_authorization_url;
  }
  mars3d.global_variables.userid = request?.userid || 2;
  // mars3d.global_variables.userid = request?.userid || 2;
  var configfile = "config/config.json"; //默认地址
  if (request.config) {
@@ -105,6 +105,8 @@
  initLayersByUserid();
  mask_selection(mars3d.global_variables.userid)
  //如果有xyz传参,进行定位
  if (haoutil.isutil.isNotNull(request.x) && haoutil.isutil.isNotNull(request.y)) {
    map.setCameraView(request, { duration: 0, isWgs84: true });