Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Easier map debugging #1240

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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