以下是我运行包含地图框的 Angular 应用程序时的错误。它不会在 stackblitz 中显示地图,而在本地机器上运行时会显示。我在 mapbox 中添加了访问令牌。有没有其他人遇到过这个问题?
AppComponent_Host.ngfactory.js? [sm]:1 ERROR Error: An API access token is required to use Mapbox GL. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes
at N._makeAPIURL (mapbox.js:184)
at N.normalizeStyleURL (mapbox.js:74)
at i.loadURL (style.js:214)
at r._updateStyle (map.js:1262)
at r.setStyle (map.js:1233)
at new r (map.js:449)
at AppComponent.ngOnInit (VM13107 app.component.ts:38)
at checkAndUpdateDirectiveInline (provider.ts:212)
at checkAndUpdateNodeInline (view.ts:429)
at checkAndUpdateNode (view.ts:389)