Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import colormap from 'colormap';
import React, { useEffect, useRef, useState } from 'react';

import ColorRampEntry from './ColorRampEntry';
import cmocean from './cmocean.json';

export interface IColorMap {
name: string;
Expand Down Expand Up @@ -79,9 +80,19 @@ const CanvasSelectComponent: React.FC<ICanvasSelectComponentProps> = ({
});
const colorMap = { name: name, colors: colorRamp };
colorMapList.push(colorMap);
});

setColorMaps(colorMapList);
Object.entries(cmocean).forEach(([name, colors]) => {
if (name === '__license__') {
return;
}
colorMapList.push({
name,
colors: colors as string[],
});
});

setColorMaps(colorMapList);
}, []);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ const ColorRamp: React.FC<IColorRampProps> = ({
const [isLoading, setIsLoading] = useState(false);

useEffect(() => {
populateOptions();
if (selectedRamp === '' && selectedMode === '' && numberOfShades === '') {
populateOptions();
}
}, [layerParams]);

const populateOptions = async () => {
const populateOptions = () => {
let nClasses, singleBandMode, colorRamp;

if (layerParams.symbologyState) {
Expand Down
Loading
Loading