Newer
Older
KaiFengPC / src / views / sponeScreen / gisMF / cesiumPaiShuiArea.js
@jimengfei jimengfei on 25 Jun 4 KB updata
import YSFQ1 from '@/assets/geojson/kaifeng/kaifengPSFQ1.json';
import YSFQ2 from '@/assets/geojson/kaifeng/kaifengPSFQ2.json';
import YSFQ3 from '@/assets/geojson/kaifeng/kaifengPSFQ3.json';

export default class cesiumPaiShuiArea {
  static addCesiumPaishuiArea1(newfiberMap) {
    YSFQ1.features.forEach(
      feature =>
        (feature.properties = Object.assign(feature.properties, {
          style_: {
            type: NewFiberMap.Enum.VectorType.POLYGON,
            options: {
              show: true,
              material: !!feature.properties.fillcolor ? feature.properties.fillcolor : 'rgba(154,104,171,0.4)',
              outline: false,
              // outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)',
              // outlineWidthBottom: 2,
            },
            name: feature.properties.name != ' ' ? feature.properties.name : null,
            id: 'cesiumPaishuiArea1',
            labelOptions: {
              font: '20px PingFang SC',
              color: 'rgba(16, 117, 224, 1)',
              pixelOffset: [0, 0],
              backgroundColor: 'rgba(0,0,0,1)',
              showBackground: false,
              outlineColor: 'rgba(255, 255, 255, 1)',
              outlineWidth: 5,
              style: Cesium.LabelStyle.FILL_AND_OUTLINE,
              distanceDisplayCondition: [Number.MIN_VALUE, 7000000],
            },
          },
        }))
    );
    if (newfiberMap.getLayers('cesiumPaishuiArea1').length > 0) {
      return;
    } else {
      newfiberMap.geojsonToMap(YSFQ1);
    }
  }
  static addCesiumPaishuiArea2(newfiberMap) {
    YSFQ2.features.forEach(
      feature =>
        (feature.properties = Object.assign(feature.properties, {
          style_: {
            type: NewFiberMap.Enum.VectorType.POLYGON,
            options: {
              show: true,
              material: !!feature.properties.fillcolor ? feature.properties.fillcolor : 'rgba(154,104,171,0.4)',
              outline: false,
              // outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)',
              // outlineWidthBottom: 2,
            },
            name: feature.properties.name != ' ' ? feature.properties.name : null,
            id: 'cesiumPaishuiArea2',
            labelOptions: {
              font: '20px PingFang SC',
              color: 'rgba(16, 117, 224, 1)',
              pixelOffset: [0, 0],
              backgroundColor: 'rgba(0,0,0,1)',
              showBackground: false,
              outlineColor: 'rgba(255, 255, 255, 1)',
              outlineWidth: 5,
              style: Cesium.LabelStyle.FILL_AND_OUTLINE,
              distanceDisplayCondition: [Number.MIN_VALUE, 7000000],
            },
          },
        }))
    );
    if (newfiberMap.getLayers('cesiumPaishuiArea2').length > 0) {
      return;
    } else {
      newfiberMap.geojsonToMap(YSFQ2);
    }
  }
  static addCesiumPaishuiArea3(newfiberMap) {
    YSFQ3.features.forEach(
      feature =>
        (feature.properties = Object.assign(feature.properties, {
          style_: {
            type: NewFiberMap.Enum.VectorType.POLYGON,
            options: {
              show: true,
              material: !!feature.properties.fillcolor ? feature.properties.fillcolor : 'rgba(154,104,171,0.4)',
              outline: false,
              // outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)',
              // outlineWidthBottom: 2,
            },
            name: feature.properties.name != ' ' ? feature.properties.name : null,
            id: 'cesiumPaishuiArea3',
            labelOptions: {
              font: '20px PingFang SC',
              color: 'rgba(16, 117, 224, 1)',
              pixelOffset: [0, 0],
              backgroundColor: 'rgba(0,0,0,1)',
              showBackground: false,
              outlineColor: 'rgba(255, 255, 255, 1)',
              outlineWidth: 5,
              style: Cesium.LabelStyle.FILL_AND_OUTLINE,
              distanceDisplayCondition: [Number.MIN_VALUE, 7000000],
            },
          },
        }))
    );
    if (newfiberMap.getLayers('cesiumPaishuiArea3').length > 0) {
      return;
    } else {
      newfiberMap.geojsonToMap(YSFQ3);
    }
  }
}