maplibregl geojson feature id为undefined解决

错误示例:

const features = [
  {
    id: "a12e1",
    type: "Feature",
    geometry: {
      type: "Point",
      coordinates: [112, 30],
    },
  },
];

解决示例:

const features = [
  {
    id: 1, // id必须为数字类型
    type: "Feature",
    geometry: {
      type: "Point",
      coordinates: [112, 30],
    },
  }
];
PS:写作不易,如要转裁,请标明转载出处。
%{ comment.page.total }条评论

微信小程序:前端开发宝典

相关笔记
工具操作
  • 内容截图
  • 全屏
登录
注册
回顶部