cesium绘制行政区标注

const drawCity = () => {
      for (let i = 0, l = guangdongCity.length; i < l; i++) {
        let item = guangdongCity[i];
        viewer.entities.add({
          position: Cesium.Cartesian3.fromDegrees(
            item.center[1],
            item.center[0]
          ),
          label: {
            text: item.name,
            color: Cesium.Color.fromCssColorString("#fff"),
            font: "normal 32px MicroSoft YaHei",
            scale: 0.5,
            horizontalOrigin: Cesium.HorizontalOrigin.LEFT_CLICK,
            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
            pixelOffset: new Cesium.Cartesian2(0, -20),
          },
        });
      }
    };

你可能感兴趣的:(cesium绘制行政区标注)