A convenient way to define scheme/protocol of the URL and it's replacement. This can be defined by the user in the MapOptions urlMap property.
urlMap
The default replacement key-values are:
Let's say I want to add a skybox to the scene:
"skybox": { "path": "baseURL://backgrounds/milkyway", "loadingBackground": "rgb(9, 8, 17)", "size": 2048, "type": "webp",} Copy
"skybox": { "path": "baseURL://backgrounds/milkyway", "loadingBackground": "rgb(9, 8, 17)", "size": 2048, "type": "webp",}
Then we can modify the baseURL to point to the correct location:
import { S2Map } from 's2maps-gpu';import type { MapOptions } from 's2maps-gpu';const urlMap: UrlMap = { baseURL: 'http://localhost:3000',};const map = new S2Map({ ..., urlMap }); Copy
import { S2Map } from 's2maps-gpu';import type { MapOptions } from 's2maps-gpu';const urlMap: UrlMap = { baseURL: 'http://localhost:3000',};const map = new S2Map({ ..., urlMap });
This is obviously more useful when working with environment variables to point to development and production servers without having to change the code.
adjustURL for details on implementation
{ schemeName: href }
URL Map
A convenient way to define scheme/protocol of the URL and it's replacement. This can be defined by the user in the MapOptions
urlMap
property.The default replacement key-values are:
Let's say I want to add a skybox to the scene:
Then we can modify the baseURL to point to the correct location:
This is obviously more useful when working with environment variables to point to development and production servers without having to change the code.
See
adjustURL for details on implementation