Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -19,6 +19,8 @@ import { DEFAULT_PANEL_WIDTH } from '../../../utils/LayoutUtils';
import '../assets/dynamicLegend.css';
import Text from '../../../components/layout/Text';

export const DYNAMIC_LEGEND_WMS_OPTIONS = "forceLabels:on;countMatched:true;fontAntiAliasing:true;";

/**
* Main component for the DynamicLegend plugin.
*
Expand Down Expand Up @@ -105,7 +107,7 @@ const DynamicLegend = ({
zoom: currentZoomLvl,
layerOptions: {
legendOptions: {
WMSLegendOptions: "countMatched:true;fontAntiAliasing:true;",
WMSLegendOptions: DYNAMIC_LEGEND_WMS_OPTIONS,
legendWidth: 12,
legendHeight: 12,
mapBbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import expect from 'expect';
import React from 'react';
import ReactDOM from 'react-dom';

import DynamicLegend from '../DynamicLegend';
import DynamicLegend, { DYNAMIC_LEGEND_WMS_OPTIONS } from '../DynamicLegend';

describe('DynamicLegend Component', () => {
let container;
Expand Down Expand Up @@ -76,4 +76,8 @@ describe('DynamicLegend Component', () => {
const layerTreeIsExisting = container.querySelectorAll('.ms-layers-tree');
expect(layerTreeIsExisting).toBeTruthy();
});

it('should preserve forced labels in dynamic legend WMS options', () => {
expect(DYNAMIC_LEGEND_WMS_OPTIONS).toBe('forceLabels:on;countMatched:true;fontAntiAliasing:true;');
});
});
Loading