Skip to content

Commit

Permalink
Ensure baselayers display in region maps (#22609)
Browse files Browse the repository at this point in the history
* Add tmsLayers placeholder array to collections. Bind collections to wms-options scope

* Move tmsLayers attribute declaration to base visualization creation

* Add test to verify presence of road_map base layer option
  • Loading branch information
kindsun authored Nov 6, 2018
1 parent 383b419 commit 9b40183
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/core_plugins/region_map/public/region_map_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ provided base maps, or add your own. Darker colors represent higher values.' }),
text: i18n('regionMap.mapVis.regionMapEditorConfig.topRightText', { defaultMessage: 'top right' }),
}],
colorSchemas: Object.values(truncatedColorMaps).map(value => ({ id: value.id, label: value.label })),
vectorLayers: vectorLayers
vectorLayers: vectorLayers,
tmsLayers: []
},
schemas: new Schemas([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@
</div>
</div>

<wms-options options="editorState.params.wms"></wms-options>
<wms-options options="editorState.params.wms" collections="collections"></wms-options>
9 changes: 6 additions & 3 deletions test/functional/apps/visualize/_region_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function ({ getService, getPageObjects }) {
const toTime = '2015-09-23 18:31:44.000';

const log = getService('log');
const find = getService('find');
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']);

before(async function () {
Expand Down Expand Up @@ -73,17 +74,19 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.visualize.selectFieldById('Three letter abbreviation', 'joinField');
await PageObjects.visualize.selectFieldById('Country name', 'joinField');
await PageObjects.visualize.selectFieldById('Two letter abbreviation', 'joinField');

await PageObjects.common.sleep(2000);//need some time for the data to load

await PageObjects.visualize.openInspector();
const actualData = await PageObjects.visualize.getInspectorTableData();
const expectedData = [['CN', '2,592'], ['IN', '2,373'], ['US', '1,194'], ['ID', '489'], ['BR', '415']];
expect(actualData).to.eql(expectedData);


});

it('should contain a dropdown with the default road_map base layer as an option',
async () => {
const roadMapExists = await find.existsByCssSelector('[label="road_map"]');
expect(roadMapExists).to.be(true);
});
});
});

Expand Down

0 comments on commit 9b40183

Please sign in to comment.