-
-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit - not working... * Fixing initializing with esm exports (#3600) * Fixed custom define AMD function in order work with esm exports * Refactored custom define function to be a bit more stable for changes It still fragile to changes of dependencies order tho * Fix lint * Fix lint * Fix tests - missing return * Update test/integration/render/run_render_tests.ts Co-authored-by: Evgeniy Timokhov <timocov@gmail.com> * Update test/integration/render/run_render_tests.ts Co-authored-by: Evgeniy Timokhov <timocov@gmail.com> * Fixes to the docs, change back to umd, add pmtiles image * Fix lint and missing files * A few small corrections * Updated changelog, reduced complexity in prelude, update docs * Revert control changes * Revert changes to navigation control * remove file that is fixed in another PR. * Revert changes in docs images generator script * Remove unused types * Add expelicitly export reference types * Rename control options to reduce name collision * Improve docs generation, export everything that is needed for the docs * Remove debug additions to API --------- Co-authored-by: Evgeniy Timokhov <timocov@gmail.com>
- Loading branch information
Showing
33 changed files
with
429 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
/* eslint-disable */ | ||
|
||
var shared, worker, maplibregl; | ||
// define gets called three times: one for each chunk. we rely on the order | ||
// they're imported to know which is which | ||
function define(_, chunk) { | ||
if (!shared) { | ||
shared = chunk; | ||
} else if (!worker) { | ||
worker = chunk; | ||
} else { | ||
var workerBundleString = 'var sharedChunk = {}; (' + shared + ')(sharedChunk); (' + worker + ')(sharedChunk);' | ||
var maplibregl = {}; | ||
var modules = {}; | ||
function define(moduleName, _dependencies, moduleFactory) { | ||
modules[moduleName] = moduleFactory; | ||
|
||
var sharedChunk = {}; | ||
shared(sharedChunk); | ||
maplibregl = chunk(sharedChunk); | ||
if (typeof window !== 'undefined') { | ||
maplibregl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' })); | ||
} | ||
// to get the list of modules see generated dist/maplibre-gl-dev.js file (look for `define(` calls) | ||
if (moduleName !== 'index') { | ||
return; | ||
} | ||
} | ||
|
||
// we assume that when an index module is initializing then other modules are loaded already | ||
var workerBundleString = 'var sharedModule = {}; (' + modules.shared + ')(sharedModule); (' + modules.worker + ')(sharedModule);' | ||
|
||
var sharedModule = {}; | ||
// the order of arguments of a module factory depends on rollup (it decides who is whose dependency) | ||
// to check the correct order, see dist/maplibre-gl-dev.js file (look for `define(` calls) | ||
// we assume that for our 3 chunks it will generate 3 modules and their order is predefined like the following | ||
modules.shared(sharedModule); | ||
modules.index(maplibregl, sharedModule); | ||
|
||
if (typeof window !== 'undefined') { | ||
maplibregl.setWorkerUrl(window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }))); | ||
} | ||
|
||
return maplibregl; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.