Skip to content

Commit

Permalink
fix: Improve my.js entry-point; Fix <my-map> (#40)(#42)(#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfreear committed Oct 16, 2023
1 parent 9c81221 commit c09926d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions my.js
Expand Up @@ -9,8 +9,8 @@ import { elemToClass } from './src/Options.js';

const base = '.';
const url = new URL(import.meta.url);
const USE = url.searchParams.get('use');
const ELEM = USE ? USE.split(',') : [];
const USE = url.search.match(/\?(use=)?(my-[a-z,-]+)/); // url.searchParams.get('use');
const ELEM = USE ? USE[2].split(',') : [];

const KLASS = ELEM.map((el) => {
const klass = elemToClass(el);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -28,7 +28,7 @@
}
},
"scripts": {
"build": "npm run build:feed && npm run build:template",
"build": "npm run build:feed && npm run build:template && npm run copy",
"build:doc": "npx jsdoc -r -c ./jsdoc-conf.json",
"build:feed": "node ./src/build/feed.js > ./src/feed.json",
"build:template": "node ./src/build/template.js > ./src/template.html",
Expand Down
2 changes: 1 addition & 1 deletion src/components/MyMapElement.js
Expand Up @@ -119,7 +119,7 @@ export class MyMapElement extends MyElement {
async _importLeafletLibs () {
await this._importJs(LEAFLET_CDN_LIBS);
const { L } = window;
await this._whenReady(() => L && L.i18n && L.l10n, 'import Leaflet');
await this._whenReady(() => L && L.Map, 'import Leaflet'); // Was: L && L.i18n && L.l10n,
this.$$.L = L;
return L;
}
Expand Down

0 comments on commit c09926d

Please sign in to comment.