perf: Easier map debugging
Expose a global function to examine the current map object.
MODIFY
src/index.js
src/index.js
@@ -108,3 +108,9 @@ if (window && !window.$) {
if (window && !window.jQuery) {
window.jQuery = $;
}
+if (window && !window.geojsMap) {
+ window.geojsMap = () => {
+ const maps = $('.geojs-map').map((idx, m) => $(m).data('data-geojs-map'));
+ return maps.length === 0 ? undefined : maps.length === 1 ? maps[0] : maps;
+ };
+}

MODIFY
src/map.js
src/map.js
@@ -1966,6 +1966,8 @@ var map = function (arg) {
/* Report the current version on the map object. */
this._version = require('./version');
+ /* Link to the main library */
+ this._geo = require('./index');
/**
* Draw a layer image to a canvas context. The layer's opacity and transform

perf: Easier map debugging

Expose a global function to examine the current map object.