iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
623 stars 211 forks source link

Display MapBox Background #3215

Closed lmborione closed 2 years ago

lmborione commented 2 years ago

I tried to had a map provider public key with the following code in the viewer but the map is not displayed:

<Viewer
  mapLayerOptions={{
    MapBoxImagery: {
      key: 'mapBoxKey',
      value: process.env.MAPBOX_PUBLIC_KEY // 'pk.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxx'
    }
  }}
  iTwinId={iTwinId}
  iModelId={iModelId}
  authClient={authClient}
  enablePerformanceMonitors={true}
/>

Thanks.

aruniverse commented 2 years ago

@lmborione The key should be access_token, see this unit test or this test app for an example

lmborione commented 2 years ago

Hi thanks for the reply. Hi update my viewer with the following :

<Viewer
  mapLayerOptions={{
    MapBoxImagery: {
      key: 'access_token',
      value: process.env.MAPBOX_PUBLIC_KEY // 'pk.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxx'
    }
  }}
  iTwinId={iTwinId}
  iModelId={iModelId}
  authClient={authClient}
  enablePerformanceMonitors={true}
/>

And the map is still not displayed on screen. Furthermore there are no usage on my MapBox account statistics page.

aruniverse commented 2 years ago

Sorry @lmborione , we found an issue with our support for MapBox imagery in our core packages. A fix has been made and will be available in iTwin.js 3.0.1

aruniverse commented 2 years ago

Hi @lmborione , 3.0.1 is now available and you should be all set. If you continue to run into issues we can re-open this issue.