Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESRI i3s layer with API key #2614

Open
davidfungf opened this issue Sep 3, 2023 · 4 comments
Open

ESRI i3s layer with API key #2614

davidfungf opened this issue Sep 3, 2023 · 4 comments
Labels
ActionEngine The issue is on ActionEngine controll

Comments

@davidfungf
Copy link

Currently, we are publishing i3s scene layer in public on ArcGIS online to bypass the API key. If the layer is published in private mode, how do I place the ESRI API key in the code. Thanks.

this.layers = sublayers.filter((sublayer) => sublayer.visibility)
    .map((sublayer) => {
      let elevationInfo = null;
      let i3SLayer = new MapboxLayer({
        id: this.layerId + sublayer.id,
        data: sublayer.url,
        type: Tile3DLayer,
        loader: I3SLoader,
        loadOptions,
        onTilesetLoad: (tileset) => {
          elevationInfo = tileset.tileset?.elevationInfo;
        },
        ...
      });
      this.map.addLayer(i3SLayer)
@ibgreen
Copy link
Collaborator

ibgreen commented Sep 3, 2023

Not sure if we have tested this scenario. @belom88 should know more.

Out of interest, how do you typically provide the key? E.g. as a URL query parameter or a request header? We do support both of those scenarios for Google 3D Tiles (which are 3D Tiles based rather than I3S based, but it would make sense to support similar approach for I3S if that is what ArcGIS accepts).

@davidfungf
Copy link
Author

davidfungf commented Sep 4, 2023

ESRI provides an API to access the scene layer if the layer is configured in non-public mode. Like Cesium https://developers.arcgis.com/cesiumjs/layers/add-3d-objects/. May I know any similar parameter is given to state the API key?

const i3sProvider = await Cesium.I3SDataProvider.fromUrl(i3sLayer, {
    geoidTiledTerrainProvider: geoidService,
    token: apiKey
})

@ibgreen
Copy link
Collaborator

ibgreen commented Sep 4, 2023

@davidfungf

  • Yes it makes sense that Cesium offers an API to let you provide that token. loaders.gl would do the same.
  • But that does however not give us information about how loaders.gl should pass that token to the ArcGIS services.
  • You should be able to see it in the browsers network tab. Either as part of the URL, or as part of request headers.

@belom88
Copy link
Collaborator

belom88 commented Sep 4, 2023

#1377 (comment) that worked previously. If it doesn't work now let me know. It could be broken because we don't have test datasets with permanent tokens and rarely test this usecase.

@belom88 belom88 added the ActionEngine The issue is on ActionEngine controll label Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ActionEngine The issue is on ActionEngine controll
Projects
None yet
Development

No branches or pull requests

3 participants