keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.12k stars 1.71k forks source link

[Bug]: Cannot add a custom mapStyle #2523

Open MoustafaWehbe opened 4 months ago

MoustafaWehbe commented 4 months ago

Describe the bug I have a public mapStyle hosted on Mapbox studio. When I try to load it inside Kepler's UI using the style url and by clicking on the "Add Map Style" button from the sidebar or using the addDataToMap inside the code, the style does not load. The error message I am getting:

URL scheme "mapbox" is not supported.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://kepler.gl/demo
  2. Click on Add Map Style from the side bar tab
  3. Past the Map style Url
  4. See error in console: URL scheme "mapbox" is not supported.

In addition you can reproduce the issue with code as follows:

dispatch(
      addDataToMap({
        config: {
          mapStyle: {
            mapStyles: {
              "style_slug": {
                id: "style_id",
                label: "Map style label",
                url: "mapbox://styles/myOrg/{style_id}",
                icon: "https://api.maptiler.com/maps/voyager/256/0/0/0.png?key=ySQ0fIYn7eSl3ppOeEJd",
                accessToken: {YOUR_ACCESS_TOKEN},
                custom: true,
              },
            }
          },
        },
        datasets: [],
      }),
    );

Expected behavior The map style should load over the map

Screenshots

image

Desktop (please complete the following information):

MoustafaWehbe commented 4 months ago

@heshan0131 Could someone please confirm this bug exists? I am happy to give more context about it if needed

warforterritory commented 3 months ago

i'm having the same trouble, can u fix it?

MoustafaWehbe commented 3 months ago

i'm having the same trouble, can u fix it?

I sticked to v2.5.5 since no one answered.