diff --git a/app/frontend/public/index.html b/app/frontend/public/index.html index 1dfc07d33..5e1d6e99a 100755 --- a/app/frontend/public/index.html +++ b/app/frontend/public/index.html @@ -1,6 +1,5 @@ -
diff --git a/components/package-lock.json b/components/package-lock.json index e9183741b..60df996b8 100644 --- a/components/package-lock.json +++ b/components/package-lock.json @@ -9,7 +9,6 @@ "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@bcgov/smk": "^1.2.1", "@types/leaflet": "^1.9.12", "@types/leaflet-draw": "^1.0.11", "autocompleter": "^7.0.1", @@ -307,11 +306,6 @@ "to-fast-properties": "^2.0.0" } }, - "node_modules/@bcgov/smk": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@bcgov/smk/-/smk-1.2.1.tgz", - "integrity": "sha512-FBpBefqAm2uLfGmbwRZwORzt6+RQAuiQ93DVweQBwgJ5eggq25SmpX15atg+R86RlQnnvWSLu+AC4QMey3X92g==" - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", diff --git a/components/package.json b/components/package.json index e62acf96f..636662295 100755 --- a/components/package.json +++ b/components/package.json @@ -47,7 +47,6 @@ "components" ], "dependencies": { - "@bcgov/smk": "^1.2.1", "@types/leaflet": "^1.9.12", "@types/leaflet-draw": "^1.0.11", "autocompleter": "^7.0.1", diff --git a/components/src/components/Map/Component.ts b/components/src/components/Map/Component.ts index 07f3c05cc..e2dbed261 100644 --- a/components/src/components/Map/Component.ts +++ b/components/src/components/Map/Component.ts @@ -38,21 +38,18 @@ export default class Component extends (FieldComponent as any) { } render() { - console.log('Rendering component'); return super.render( `` ); } attach(element) { - console.log('Attaching component to element'); const superAttach = super.attach(element); this.loadMap(); return superAttach; } loadMap() { - console.log('Loading map'); const mapContainer = document.getElementById(`map-${this.componentID}`); const form = document.getElementsByClassName('formio'); let drawOptions = { @@ -83,8 +80,7 @@ export default class Component extends (FieldComponent as any) { onDrawnItemsChange: this.saveDrawnItems.bind(this), }); - console.log('Current data value:', this.dataValue); - console.log('GetValue result:', this.getValue()); + // Load existing data if available if (this.dataValue) { @@ -93,9 +89,7 @@ export default class Component extends (FieldComponent as any) { } saveDrawnItems(drawnItems: L.Layer[]) { - console.log('Saving drawn items:', drawnItems); const value = drawnItems.map((layer: any) => { - console.log('Processing layer:', layer); if (layer instanceof L.Marker) { return { type: 'marker', @@ -125,19 +119,16 @@ export default class Component extends (FieldComponent as any) { } }); - console.log('Converted value:', value); // Convert to JSON string const jsonValue = this.component.numPoints === 1 ? JSON.stringify(value[0]) : JSON.stringify(value); - console.log('JSON value to set:', jsonValue); this.setValue(jsonValue); } setValue(value) { - console.log('Setting value:', value); super.setValue(value); // Additional logic to render the saved data on the map if necessary @@ -152,7 +143,6 @@ export default class Component extends (FieldComponent as any) { } getValue() { - console.log('Getting value:', this.dataValue); return this.dataValue; } } diff --git a/components/src/components/Map/services/MapService.ts b/components/src/components/Map/services/MapService.ts index 530426d70..cb0c39d1d 100644 --- a/components/src/components/Map/services/MapService.ts +++ b/components/src/components/Map/services/MapService.ts @@ -26,7 +26,6 @@ class MapService { drawnItems: L.FeatureGroup; constructor(options: MapServiceOptions) { - console.log('Initializing MapService with options:', options); this.options = options; if (options.mapContainer) { const { map, drawnItems } = this.initializeMap(options); @@ -36,7 +35,6 @@ class MapService { // Event listener for drawn objects map.on('draw:created', (e: any) => { - console.log('Drawing created:', e); let layer = e.layer; if (drawnItems.getLayers().length === options.numPoints) { L.popup() @@ -53,7 +51,6 @@ class MapService { } initializeMap(options: MapServiceOptions) { - console.log('Initializing map with options:', options); let { mapContainer, center, drawOptions, form, defaultZoom } = options; if (drawOptions.rectangle) { drawOptions.rectangle.showArea = false; @@ -89,7 +86,6 @@ class MapService { } bindPopupToLayer(layer: L.Layer) { - console.log('Binding popup to layer:', layer); if (layer instanceof L.Marker) { layer .bindPopup( @@ -120,7 +116,6 @@ class MapService { } loadDrawnItems(items: any) { - console.log('Loading drawn items:', items); const { drawnItems } = this; // Ensure drawnItems is defined before attempting to clear layers @@ -137,7 +132,6 @@ class MapService { } items.forEach((item) => { - console.log('Processing item:', item); let layer; if (item.type === 'marker') { layer = L.marker(item.latlng);