2

我正在处理 kepler.gl 地图并且我有自定义地图样式,尝试使用更新默认地图样式addCustomMapStyleloadCustomMapStyle但是这两种方法没有更新我的配置的地图样式

    {
  "version": "v1",
  "config": {
    "visState": {

    },
    "mapState": {
      "bearing": -14.78125,
      "dragRotate": true,
      "latitude": 50.15584222999782,
      "longitude": 8.73812510739856,
      "pitch": 55.64219672692688,
      "zoom": 6.249643007871772,
      "isSplit": false
    },
    "mapStyle": {
      "styleType": "0.ek919ez82er",
      "topLayerGroups": {},
      "visibleLayerGroups": {
        "border": false,
        "building": true,
        "label": true,
        "land": true,
        "road": true,
        "water": true
      },
      "buildingLayer": {
        "color": [
          18,
          25,
          38
        ],
        "isVisible": false,
        "opacity": 0.7
      },
      "mapStyles": {
        "0.ek919ez82er": {
          "accessToken": "accessToken",
          "custom": true,
          "icon": "BASE64IMAGE",
          "id": "0.ek919ez82er",
          "label": "Basic Template New",
          "url": "mapbox://styles/stephanefoulard/cjnvki2i00s9v2sjrbzpssze0"
        }
      }
    }
  }
}

我如何加载这个自定义地图样式,它现在正在加载深色地图样式,请帮助

4

1 回答 1

1

嗨,经过长时间的 redux 调试后,我发现了参数addCustomMapStyleloadCustomMapStyle需要什么

this.props.dispatch(loadCustomMapStyle({ style: {},  error: false});
this.props.dispatch(addCustomMapStyle());

由于堆栈上的字符串限制,我没有发布样式,我稍后会在其他地方发布它们并更新答案

于 2018-11-14T08:20:47.717 回答