Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sfggeogis committed May 6, 2024
1 parent ab93304 commit 7e02462
Show file tree
Hide file tree
Showing 32 changed files with 79,829 additions and 142 deletions.
4,771 changes: 4,771 additions & 0 deletions dist/html2canvas.esm-DbilGY6A-DB3xAFLF.mjs

Large diffs are not rendered by default.

65,892 changes: 65,892 additions & 0 deletions dist/index-7vA8gJhT.mjs

Large diffs are not rendered by default.

5,905 changes: 5,905 additions & 0 deletions dist/index.es-BR8y8uSW-DmctbIix.mjs

Large diffs are not rendered by default.

2,649 changes: 2,649 additions & 0 deletions dist/mapicgc-gl.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/mapicgc-gl.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { C as p, a as s, M as r } from "./index-7vA8gJhT.mjs";
export {
p as CompareMaps,
s as Config,
r as Map
};
174 changes: 87 additions & 87 deletions dist/mapicgc-gl.umd.js

Large diffs are not rendered by default.

464 changes: 464 additions & 0 deletions dist/purify.es-C-d0AVPf-BZqXIm-R.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nodeDeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const renamedFilePath = `${process.env.FTP_LOCA_PATH}${process.env.FILE_JS}`;
console.error('Error copying file:', err);
} else {
console.log('File copied and renamed successfully.');
deploy(process.env.FTP_HOST1)
deploy(process.env.FTP_HOST1)
deploy(process.env.FTP_HOST2)
}
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "mapicgc-gl-js",
"homepage": "https://autogitlab.icgc.local/geostarters/icgc/mapicgc/mapicgc-gl-js",
"version": "0.0.65",
"homepage": "https://openicgc.github.io/mapicgc-doc/",
"version": "0.0.76",
"description": "mapicgc-gl-js library",
"author": "Institut Cartogràfic i Geològic de Catalunya",
"license": "BSD-3-Clause",
"type": "commonjs",
"keywords": [
"map",
"js",
Expand All @@ -23,12 +24,12 @@
"email": "geostart@icgc.cat"
}
],
"main": "dist/mapicgc-gl.js",
"main": "dist/mapicgc-gl.mjs",
"module": "dist/mapicgc-gl.js",
"exports": {
".": {
"import": "./dist/mapicgc-gl.js",
"require": "./dist/mapicgc-gl.js"
"import": "./dist/mapicgc-gl.mjs",
"require": "./dist/mapicgc-gl.mjs"
}
},
"scripts": {
Expand Down
38 changes: 20 additions & 18 deletions src/constants/ConfigICGC.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@ import mapicgcConfig from "../mapicgc-config.json";
const urlConfigICGC = "https://tilemaps.icgc.cat/cdn/configs/mapicgc-config.json";
const timeOut = 5000;

async function Config() {
try {
const response = await axios.get(urlConfigICGC, { timeout: timeOut });
if (response.data) {
return response.data;
} else {
console.log("Resposta sense dades:", response);
class Config {
static async getConfigICGC() {
try {
const response = await axios.get(urlConfigICGC, { timeout: timeOut });
if (response.data) {
return response.data;
} else {
console.log("Resposta sense dades:", response);
return mapicgcConfig;
}
} catch (error) {
if (error.response) {
console.error("Error de resposta:", error.response.data);
console.error("Codi d'estat:", error.response.status);
} else if (error.request) {
console.error("No s'ha rebut resposta del servidor:", error.request);
} else {
console.error("Error:", error.message);
}
return mapicgcConfig;
}
} catch (error) {
if (error.response) {
console.error("Error de resposta:", error.response.data);
console.error("Codi d'estat:", error.response.status);
} else if (error.request) {
console.error("No s'ha rebut resposta del servidor:", error.request);
} else {
console.error("Error:", error.message);
}
return mapicgcConfig;
}
}

export default Config();
export default Config;
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Map from "./map/Map";
import CompareMaps from "./plugins/CompareMaps";
import ConfigICGC from "./constants/ConfigICGC";
import Config from "./constants/ConfigICGC";





export { Map, CompareMaps,ConfigICGC };
export { Map, CompareMaps,Config };
8 changes: 5 additions & 3 deletions src/map/Map.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import maplibregl from "maplibre-gl";
import "../../public/mapicgc-gl.css";
import "@watergis/maplibre-gl-export/dist/maplibre-gl-export.css";
import { deserialize } from "flatgeobuf/lib/mjs/geojson.js";
import Pitch3DToggleControl from "../controls/Toggle3DControl.js";
import { MapboxLayer } from "@deck.gl/mapbox";
Expand All @@ -13,13 +14,13 @@ import {
Format,
DPI,
} from "@watergis/maplibre-gl-export";
import "@watergis/maplibre-gl-export/dist/maplibre-gl-export.css";
import MaplibreGeocoder from "@maplibre/maplibre-gl-geocoder";
import LogoControl from "../controls/LogoControl.js";
import LegendControl from "../controls/LegendControl.js";
import MouseCoordinatesControl from "../controls/MouseCoordinatesControl.js";
import ConfigICGC from "../constants/ConfigICGC.js";
import Config from "../constants/ConfigICGC.js";
import Legends from "../constants/Legends.js";
import mapicgcConfig from "../mapicgc-config.json";

const ORDER_LAYER_TOP = "top";
const ORDER_LAYER_LINE = "lines";
Expand All @@ -31,7 +32,8 @@ export default class Map {
* @param {Object} options - Options to initialize the map.
*/
constructor(options) {
ConfigICGC.then((data) => {

Config.getConfigICGC().then((data) => {
Styles = { ...data.Styles };
Layers = { ...data.Layers };
Terrains = { ...data.Terrains };
Expand Down
3 changes: 1 addition & 2 deletions test/exemples/addBasemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@
<div id="map"></div>
<!-- <div id="basemap-group" class="basemap-group"></div> -->
<script>
// add basemap

async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO, // <-- add style basemap here
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addCompare.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map1 = new mapicgcgl.Map({
container: "before",
style: data.Styles.ORTO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addControl.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addFeatureQuery.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addGeocoderICGC.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addICGCTerrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.ORTO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addImageLayerICGC.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addLayerGeojson.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addLayerTree.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<nav id="filter-group" class="filter-group"></nav>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addLogo.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div id="logos"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addMapStyle.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: 'map',
style: data.Styles.ORTO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addMarker.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addMouseCoordinateControl.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/addVectorLayerICGC.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div id="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/advancedExemple.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<nav id="menu-group" class="filter-group"></nav>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.ORTO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/fetchData.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div id="basemap-group" class="basemap-group"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.LIGHT,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/fetchDataAndMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: "map",
style: data.Styles.TOPO,
Expand Down
2 changes: 1 addition & 1 deletion test/exemples/styleOrto3D.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<div id="map" class="map"></div>
<script>
async function initMap() {
const data = await mapicgcgl.ConfigICGC;
const data = await mapicgcgl.Config.getConfigICGC();;
const map = new mapicgcgl.Map({
container: 'map',
style: data.Styles.ORTO3D,
Expand Down
2 changes: 1 addition & 1 deletion vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
lib: {
entry: 'src/index.js',
fileName: 'mapicgc-gl',
formats:['umd'],
formats: ['es','umd'],
name: 'mapicgcgl',
},
rollupOptions: {
Expand Down

0 comments on commit 7e02462

Please sign in to comment.