Skip to content

Commit

Permalink
Merge branch 'docs-redesign' into publisher-staging
Browse files Browse the repository at this point in the history
* docs-redesign:
  add docs for workerCount and maxParallelImageRequests (#7812)
  • Loading branch information
Katy DeCorah committed Jan 25, 2019
2 parents 274ba8a + a6c69f5 commit 7ca014c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ const exported = {
set accessToken(token: string) {
config.ACCESS_TOKEN = token;
},

/**
* Gets and sets the map's default API URL for requesting tiles, styles, sprites, and glyphs
*
* @var {string} url
* @var {string} baseApiUrl
* @example
* mapboxgl.baseApiUrl = 'https://api.mapbox.com';
*/
Expand All @@ -72,6 +73,15 @@ const exported = {
config.API_URL = url;
},

/**
* Gets and sets the number of web workers instantiated on a page with GL JS maps.
* By default, it is set to half the number of CPU cores (capped at 6).
* Make sure to set this property before creating any map instances for it to have effect.
*
* @var {string} workerCount
* @example
* mapboxgl.workerCount = 2;
*/
get workerCount(): number {
return WorkerPool.workerCount;
},
Expand All @@ -80,6 +90,14 @@ const exported = {
WorkerPool.workerCount = count;
},

/**
* Gets and sets the maximum number of images (raster tiles, sprites, icons) to load in parallel,
* which affects performance in raster-heavy maps. 16 by default.
*
* @var {string} maxParallelImageRequests
* @example
* mapboxgl.maxParallelImageRequests = 10;
*/
get maxParallelImageRequests(): number {
return config.MAX_PARALLEL_IMAGE_REQUESTS;
},
Expand Down

0 comments on commit 7ca014c

Please sign in to comment.