Skip to content

Commit

Permalink
conditionally imports leaflet
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Jul 17, 2020
1 parent a34abe0 commit 91f39dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
"no-console": "off",
"no-debugger": "off",
"no-unused-vars": "off",
"no-constant-condition": "off",
// "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
// "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
// "no-unused-vars": process.env.NODE_ENV === "production" ? "error" : "off",
Expand Down
12 changes: 11 additions & 1 deletion src/clients/esri-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ import explode from '@turf/explode';
import nearest from '@turf/nearest-point';

import proj4 from 'proj4';

let L;
if (1 === 1) {
import('leaflet')
.then((module) => {
// Do something with the module.
L = module;
});
}

// import * as L from 'leaflet';
// import { query as Query } from 'esri-leaflet';
import BaseClient from './base-client';
Expand Down Expand Up @@ -61,7 +71,7 @@ class EsriClient extends BaseClient {
}

fetchNearby(feature, dataSource, dataSourceKey) {
// console.log('esri fetchNearby running, dataSource:', dataSource, 'dataSourceKey:', dataSourceKey);
console.log('esri fetchNearby running, dataSource:', dataSource, 'dataSourceKey:', dataSourceKey);
const projection4326 = utils.projection4326;
const projection2272 = utils.projection2272;

Expand Down

0 comments on commit 91f39dd

Please sign in to comment.