Skip to content

Commit

Permalink
removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn Guerin committed Jul 9, 2024
1 parent 9834f38 commit 642f681
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions public/model/customLayerFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,6 @@ import { CustomLayerSpecification, OSMLayerSpecification } from './mapLayerType'
import { hasLayer, removeLayers } from './map/layer_operations';
import { MaplibreRef } from './layersFunctions';

// const updateLayerConfig = (layerConfig: CustomLayerSpecification, maplibreRef: MaplibreRef) => {
// const maplibreInstance = maplibreRef.current;
// if (maplibreInstance) {
// const customLayer = maplibreInstance.getLayer(layerConfig.id);
// if (customLayer) {
// maplibreInstance.setPaintProperty(
// layerConfig.id,
// 'raster-opacity',
// layerConfig.opacity / 100
// );
// maplibreInstance.setLayerZoomRange(
// layerConfig.id,
// layerConfig.zoomRange[0],
// layerConfig.zoomRange[1]
// );
// const rasterLayerSource = maplibreInstance.getSource(
// layerConfig.id
// )! as RasterSourceSpecification;
// if (rasterLayerSource.attribution !== layerConfig.source?.attribution) {
// rasterLayerSource.attribution = layerConfig?.source?.attribution;
// maplibreInstance._controls.forEach((control) => {
// if (control instanceof AttributionControl) {
// control._updateAttributions();
// }
// });
// }
// const tilesURL = getCustomMapURL(layerConfig);
// console.log("here123");
// if (rasterLayerSource.tiles![0] !== tilesURL) {
// console.log("here124");
// rasterLayerSource.tiles = [layerConfig?.source?.url];
// console.log(maplibreInstance);
// maplibreInstance.style.sourceCaches[layerConfig.id].clearTiles();
// console.log("transform");
// console.log(maplibreInstance.transform);
// console.log("transform id");
// console.log(maplibreInstance.style.sourceCaches[layerConfig.id]);
// maplibreInstance.style.sourceCaches[layerConfig.id].update(maplibreInstance.transform); // error here
// maplibreInstance.triggerRepaint();
// }
// console.log("here1235");
// console.log(tilesURL);
// }
// }
// };

const refreshLayer = (layerConfig: CustomLayerSpecification, maplibreRef: MaplibreRef) => {
const maplibreInstance = maplibreRef.current;
if (maplibreInstance) {
Expand Down Expand Up @@ -86,7 +40,6 @@ const addNewLayer = (layerConfig: CustomLayerSpecification, maplibreRef: Maplibr
}
};

// not the issue
const getCustomMapURL = (layerConfig: CustomLayerSpecification) => {
const layerSource = layerConfig?.source;
if (layerSource?.customType === 'tms') {
Expand Down

0 comments on commit 642f681

Please sign in to comment.