Skip to content

Commit

Permalink
[Vega] user should be able to set a specific tilemap service using th…
Browse files Browse the repository at this point in the history
…e mapStyle property
  • Loading branch information
alexwizp committed Feb 1, 2021
1 parent af337ce commit 253e661
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 44 deletions.
6 changes: 5 additions & 1 deletion docs/user/dashboard/vega-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ experimental[] To enable *Maps*, the graph must specify `type=map` in the host c
"longitude": -74, // default 0
"zoom": 7, // default 2
// defaults to "default". Use false to disable base layer.
// Use "mapStyle" to configure a base map layer for your vega map.
// Can be set to one of the following:
// - set to false to disable base layer;
// - set "mapStyle" to any Elastic Maps Service (EMS) tile layer id.
// May either be: "road_map", "road_map_desaturated", "dark_map"
"mapStyle": false,
// default 0
Expand Down
25 changes: 0 additions & 25 deletions src/plugins/vis_type_vega/public/data_model/vega_parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,31 +316,6 @@ describe('VegaParser._parseMapConfig', () => {
0
)
);

test(
'warnings',
check(
{
delayRepaint: true,
latitude: 0,
longitude: 0,
zoom: 'abc', // ignored
mapStyle: 'abc',
zoomControl: 'abc',
scrollWheelZoom: 'abc',
maxBounds: [2, 3, 4],
},
{
delayRepaint: true,
latitude: 0,
longitude: 0,
mapStyle: 'default',
zoomControl: true,
scrollWheelZoom: false,
},
5
)
);
});

describe('VegaParser._parseConfig', () => {
Expand Down
14 changes: 0 additions & 14 deletions src/plugins/vis_type_vega/public/data_model/vega_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,20 +466,6 @@ The URL is an identifier only. Kibana and your browser will never access this UR

// `false` is a valid value
res.mapStyle = this._config?.mapStyle === undefined ? `default` : this._config.mapStyle;
if (res.mapStyle !== `default` && res.mapStyle !== false) {
this._onWarning(
i18n.translate('visTypeVega.vegaParser.mapStyleValueTypeWarningMessage', {
defaultMessage:
'{mapStyleConfigName} may either be {mapStyleConfigFirstAllowedValue} or {mapStyleConfigSecondAllowedValue}',
values: {
mapStyleConfigName: 'config.kibana.mapStyle',
mapStyleConfigFirstAllowedValue: 'false',
mapStyleConfigSecondAllowedValue: '"default"',
},
})
);
res.mapStyle = `default`;
}

this._parseBool('zoomControl', res, true);
this._parseBool('scrollWheelZoom', res, false);
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -4553,7 +4553,6 @@
"visTypeVega.inspector.vegaAdapter.value": "値",
"visTypeVega.inspector.vegaDebugLabel": "Vegaデバッグ",
"visTypeVega.mapView.experimentalMapLayerInfo": "マップレイヤーはまだ実験段階であり、オフィシャルGA機能のサポートSLAが適用されません。フィードバックがある場合は、{githubLink}で問題を報告してください。",
"visTypeVega.mapView.mapStyleNotFoundWarningMessage": "{mapStyleParam} が見つかりませんでした",
"visTypeVega.mapView.minZoomAndMaxZoomHaveBeenSwappedWarningMessage": "{minZoomPropertyName} と {maxZoomPropertyName} が交換されました",
"visTypeVega.mapView.resettingPropertyToMaxValueWarningMessage": "{name} を {max} にリセットしています",
"visTypeVega.mapView.resettingPropertyToMinValueWarningMessage": "{name} を {min} にリセットしています",
Expand All @@ -4575,7 +4574,6 @@
"visTypeVega.vegaParser.inputSpecDoesNotSpecifySchemaErrorMessage": "仕様に基づき、{schemaParam}フィールドには、\nVega({vegaSchemaUrl}を参照)または\nVega-Lite({vegaLiteSchemaUrl}を参照)の有効なURLを入力する必要があります。\nURLは識別子にすぎません。Kibanaやご使用のブラウザーがこのURLにアクセスすることはありません。",
"visTypeVega.vegaParser.invalidVegaSpecErrorMessage": "無効な Vega 仕様",
"visTypeVega.vegaParser.kibanaConfigValueTypeErrorMessage": "{configName} が含まれている場合、オブジェクトでなければなりません",
"visTypeVega.vegaParser.mapStyleValueTypeWarningMessage": "{mapStyleConfigName} は {mapStyleConfigFirstAllowedValue} か {mapStyleConfigSecondAllowedValue} のどちらかです",
"visTypeVega.vegaParser.maxBoundsValueTypeWarningMessage": "{maxBoundsConfigName} は 4 つの数字の配列でなければなりません",
"visTypeVega.vegaParser.notSupportedUrlTypeErrorMessage": "{urlObject} はサポートされていません",
"visTypeVega.vegaParser.notValidLibraryVersionForInputSpecWarningMessage": "インプット仕様に {schemaLibrary} {schemaVersion} が使用されていますが、現在のバージョンの {schemaLibrary} は {libraryVersion} です。’",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4558,7 +4558,6 @@
"visTypeVega.inspector.vegaAdapter.value": "值",
"visTypeVega.inspector.vegaDebugLabel": "Vega 调试",
"visTypeVega.mapView.experimentalMapLayerInfo": "地图图层处于试验状态,不受正式发行版功能的支持 SLA 的约束。如欲提供反馈,请在 {githubLink} 中创建问题。",
"visTypeVega.mapView.mapStyleNotFoundWarningMessage": "找不到 {mapStyleParam}",
"visTypeVega.mapView.minZoomAndMaxZoomHaveBeenSwappedWarningMessage": "已互换 {minZoomPropertyName} 和 {maxZoomPropertyName}",
"visTypeVega.mapView.resettingPropertyToMaxValueWarningMessage": "将 {name} 重置为 {max}",
"visTypeVega.mapView.resettingPropertyToMinValueWarningMessage": "将 {name} 重置为 {min}",
Expand All @@ -4580,7 +4579,6 @@
"visTypeVega.vegaParser.inputSpecDoesNotSpecifySchemaErrorMessage": "您的规范要求 {schemaParam} 字段包含\nVega(请参见 {vegaSchemaUrl})或\nVega-Lite(请参见 {vegaLiteSchemaUrl})的有效 URL。\n该 URL 仅限标识符。Kibana 和您的浏览器将不访问此 URL。",
"visTypeVega.vegaParser.invalidVegaSpecErrorMessage": "Vega 规范无效",
"visTypeVega.vegaParser.kibanaConfigValueTypeErrorMessage": "如果存在,{configName} 必须为对象",
"visTypeVega.vegaParser.mapStyleValueTypeWarningMessage": "{mapStyleConfigName} 可能为 {mapStyleConfigFirstAllowedValue} 或 {mapStyleConfigSecondAllowedValue}",
"visTypeVega.vegaParser.maxBoundsValueTypeWarningMessage": "{maxBoundsConfigName} 必须为具有四个数字的数组",
"visTypeVega.vegaParser.notSupportedUrlTypeErrorMessage": "不支持 {urlObject}",
"visTypeVega.vegaParser.notValidLibraryVersionForInputSpecWarningMessage": "输入规范使用 {schemaLibrary} {schemaVersion},但 {schemaLibrary} 的当前版本为 {libraryVersion}。",
Expand Down

0 comments on commit 253e661

Please sign in to comment.