hongfaqiu / MVTImageryProvider

Mapbox vector tiles(pbf) visulization on cesium
https://mvt-provider.opendde.com/
MIT License
58 stars 19 forks source link

Method `_preLoad` add `access_token` two times to queryParameters #19

Closed nonlinearthink closed 9 months ago

nonlinearthink commented 9 months ago
 if (typeof data === 'string') {
      data = new Resource({
        url: data,
        queryParameters: {
          access_token: this._accessToken
        }
      })
    }
...

    if (this._accessToken)
        data.appendQueryParameters({
          access_token: this._accessToken
        })

The Resource class in CesiumJS will handle queryParameters automatically. And the next step, you've explicitly handled it again.

I think it's probably fine for most services, but unfortunately api.mapbox.com doesn't seem to split the access_token by &. All query parameters after the first access_token are considered as the access_token.

hongfaqiu commented 9 months ago

我感觉把上面这部分改一下会更好

if (typeof data === 'string') {
  data = new Resource({
    url: data
  })
}
nonlinearthink commented 9 months ago

我改好了

hongfaqiu commented 9 months ago

非常感谢!已合并