Skip to content

Commit

Permalink
Loading npm library.
Browse files Browse the repository at this point in the history
  • Loading branch information
jedgar1mx committed Apr 4, 2024
1 parent c2377ec commit baae1a3
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build/assets/js/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/assets/js/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/assets/js/runtime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/assets/js/vendors.turf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Local Services Lookup</title><meta name="description" content="D6 Business Directroy"><meta name="author" content="Edgar Montes"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=5"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet"><link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet"/><script defer="defer" src="assets/js/runtime.js"></script><script defer="defer" src="assets/js/vendors.turf.js"></script><script defer="defer" src="assets/js/main.js"></script></head><body><d6-business-map data-map-mode="map-panel" data-language="en" data-app-state="start" data-map-state="loaded"><p class="no-wc">Please turn on javascript to use this feature. Thanks!</p></d6-business-map><script src="./build/assets/js/main.js"></script><script src="./build/assets/js/runtime.js"></script><script src="./build/assets/js/vendors.babel.js"></script><script src="./build/assets/js/vendors.maplibre-gl.js"></script><script src="index.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Local Services Lookup</title><meta name="description" content="D6 Business Directroy"><meta name="author" content="Edgar Montes"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=5"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet"><link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet"/><script defer="defer" src="assets/js/runtime.js"></script><script defer="defer" src="assets/js/vendors.turf.js"></script><script defer="defer" src="assets/js/main.js"></script></head><body><d6-business-map data-map-mode="map-panel" data-language="en" data-active-filters="" data-app-state="start" data-map-state="loaded"><p class="no-wc">Please turn on javascript to use this feature. Thanks!</p></d6-business-map><script src="https://www.unpkg.com/[email protected]/build/assets/js/main.js"></script><script src="https://www.unpkg.com/[email protected]/build/assets/js/runtime.js"></script><script src="https://www.unpkg.com/[email protected]/build/assets/js/vendors.babel.js"></script><script src="https://www.unpkg.com/[email protected]/build/assets/js/vendors.maplibre-gl.js"></script><script src="index.js"></script></body></html>
1 change: 0 additions & 1 deletion public/build/assets/js/main.js

This file was deleted.

1 change: 0 additions & 1 deletion public/build/assets/js/runtime.js

This file was deleted.

1 change: 0 additions & 1 deletion public/build/assets/js/vendors.babel.js

This file was deleted.

1 change: 0 additions & 1 deletion public/build/assets/js/vendors.maplibre-gl.js

This file was deleted.

1 change: 0 additions & 1 deletion public/build/index.html

This file was deleted.

10 changes: 5 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' />
</head>
<body>
<d6-business-map data-map-mode="map-panel" data-language="en" data-app-state="start" data-map-state="loaded">
<d6-business-map data-map-mode="map-panel" data-language="en" data-active-filters="" data-app-state="start" data-map-state="loaded">
<p class="no-wc">Please turn on javascript to use this feature. Thanks!</p>
</d6-business-map>

<script src="./build/assets/js/main.js"></script>
<script src="./build/assets/js/runtime.js"></script>
<script src="./build/assets/js/vendors.babel.js"></script>
<script src="./build/assets/js/vendors.maplibre-gl.js"></script>
<script src="https://www.unpkg.com/[email protected]/build/assets/js/main.js"></script>
<script src="https://www.unpkg.com/[email protected]/build/assets/js/runtime.js"></script>
<script src="https://www.unpkg.com/[email protected]/build/assets/js/vendors.babel.js"></script>
<script src="https://www.unpkg.com/[email protected]/build/assets/js/vendors.maplibre-gl.js"></script>
<script src="index.js"></script>
</body>
</html>
28 changes: 15 additions & 13 deletions src/components/D6BusinessMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default class D6BusinessMap extends HTMLElement {

console.log(this.layers);
// Create map component
let tempMainData = {"id":"schools","layers":[{"name":"data-points","type":"circle","radius":7,"color":"#745da8","active":true,"sort":10,"source":"data-points"}],"source":this.mainData.data,};
let tempMainData = {"id":"d6-business","layers":[{"name":"data-points","type":"circle","radius":7,"color":"#745da8","active":true,"sort":10,"source":"data-points"}],"source":this.mainData.data,};
this.map = document.createElement('cod-map');
this.map.id = 'd6-map';
this.map.setAttribute('data-parent-component', 'd6-business-map');
Expand Down Expand Up @@ -223,18 +223,20 @@ export default class D6BusinessMap extends HTMLElement {
console.log(`App - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);
switch (name) {
case 'data-active-filters':
const newFilters = newValue.split(',');
let url= this.buildQuery(newFilters);
console.log(url);
const app = this;
fetch(url)
.then((resp) => resp.json()) // Transform the data into json
.then(function (data) {
console.log(data);
(app.map.map.getSource('data-points')) ? app.map.map.getSource('data-points').setData(data) : 0;
}).catch(err => {
// console.log(err);
});
if(oldValue !== null){
const newFilters = newValue.split(',');
let url= this.buildQuery(newFilters);
console.log(url);
const app = this;
fetch(url)
.then((resp) => resp.json()) // Transform the data into json
.then(function (data) {
console.log(data);
(app.map.map.getSource('data-points')) ? app.map.map.getSource('data-points').setData(data) : 0;
}).catch(err => {
// console.log(err);
});
}
break;

case 'data-active-boundaries':
Expand Down

0 comments on commit baae1a3

Please sign in to comment.