Newer
Older
KaiFengPC / src / views / sponeScreen / gisMF / cesiumPaiShuiArea.js
@jimengfei jimengfei on 20 Jun 4 KB updata
import YSFQ1 from '@/assets/geojson/kaifeng/kaifengPSFQ1.json';
import YSFQlabel1 from '@/assets/geojson/kaifeng/kaifengPSFQlabel1.json';
import YSFQline1 from '@/assets/geojson/kaifeng/kaifengPSFQline1.json';

import YSFQ2 from '@/assets/geojson/kaifeng/kaifengPSFQ2.json';
import YSFQlabel2 from '@/assets/geojson/kaifeng/kaifengPSFQlabel2.json';
import YSFQline2 from '@/assets/geojson/kaifeng/kaifengPSFQline2.json';

import YSFQ3 from '@/assets/geojson/kaifeng/kaifengPSFQ3.json';
import YSFQlabel3 from '@/assets/geojson/kaifeng/kaifengPSFQlabel3.json';
import YSFQline3 from '@/assets/geojson/kaifeng/kaifengPSFQline3.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: true,
              outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)',
              outlineWidthBottom: 3,
            },
            name: feature.properties.name != ' ' ? feature.properties.name : null,
            id: 'cesiumPaishuiArea1',
            labelOptions: {
              font: '16px PingFang SC',
              color: 'rgba(175, 50, 50,1)',
              pixelOffset: [0, 0],
              backgroundColor: 'rgba(0,0,0,1)',
              showBackground: false,
              outlineColor: 'rgba(0, 0, 0, 0.8)',
              outlineWidth: 6,
              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: true,
              outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)',
              outlineWidthBottom: 3,
            },
            name: feature.properties.name != ' ' ? feature.properties.name : null,
            id: 'cesiumPaishuiArea1',
            labelOptions: {
              font: '16px PingFang SC',
              color: 'rgba(175, 50, 50,1)',
              pixelOffset: [0, 0],
              backgroundColor: 'rgba(0,0,0,1)',
              showBackground: false,
              outlineColor: 'rgba(0, 0, 0, 0.8)',
              outlineWidth: 6,
              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: true,
              outlineColorBottom: !!feature.properties.outcolor ? feature.properties.outcolor : 'rgba(189,127,171,0.75)',
              outlineWidthBottom: 3,
            },
            name: feature.properties.name != ' ' ? feature.properties.name : null,
            id: 'cesiumPaishuiArea1',
            labelOptions: {
              font: '16px PingFang SC',
              color: 'rgba(175, 50, 50,1)',
              pixelOffset: [0, 0],
              backgroundColor: 'rgba(0,0,0,1)',
              showBackground: false,
              outlineColor: 'rgba(0, 0, 0, 0.8)',
              outlineWidth: 6,
              style: Cesium.LabelStyle.FILL_AND_OUTLINE,
              distanceDisplayCondition: [Number.MIN_VALUE, 7000000],
            },
          },
        }))
    );
    if (newfiberMap.getLayers('cesiumPaishuiArea3').length > 0) {
      return;
    } else {
      newfiberMap.geojsonToMap(YSFQ3);
    }
  }
}