Skip to content

Commit

Permalink
Merge pull request #1240 from OpenGeoscience/debug-map
Browse files Browse the repository at this point in the history
perf: Easier map debugging
  • Loading branch information
manthey authored Jul 5, 2022
2 parents a1d22cf + ee5be4c commit 9671da2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
2 changes: 2 additions & 0 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9671da2

Please sign in to comment.