mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
38978a07ae
commit
f6200a42c6
6 changed files with 13 additions and 20 deletions
|
@ -79,8 +79,7 @@ VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmaps
|
|||
text: 'top right',
|
||||
}],
|
||||
colorSchemas: Object.keys(truncatedColorMaps),
|
||||
vectorLayers: vectorLayers,
|
||||
baseLayers: []
|
||||
vectorLayers: vectorLayers
|
||||
},
|
||||
schemas: new Schemas([
|
||||
{
|
||||
|
|
|
@ -121,7 +121,7 @@ export function BaseMapsVisualizationProvider(serviceSettings) {
|
|||
|
||||
_baseLayerConfigured() {
|
||||
const mapParams = this._getMapsParams();
|
||||
return mapParams.wms.baseLayersAreLoaded || mapParams.wms.selectedTmsLayer;
|
||||
return mapParams.wms.selectedTmsLayer;
|
||||
}
|
||||
|
||||
async _updateBaseLayer() {
|
||||
|
@ -166,9 +166,7 @@ export function BaseMapsVisualizationProvider(serviceSettings) {
|
|||
...mapParams.wms.options
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
await mapParams.wms.baseLayersAreLoaded;
|
||||
} else if (mapParams.wms.selectedTmsLayer) {
|
||||
const selectedTmsLayer = mapParams.wms.selectedTmsLayer;
|
||||
this._setTmsLayer(selectedTmsLayer);
|
||||
|
||||
|
|
|
@ -76,4 +76,4 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<wms-options options="editorState.params.wms"></wms-options>
|
||||
<wms-options options="editorState.params.wms" collections="vis.type.editorConfig.collections"></wms-options>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
id="tmsLayers"
|
||||
class="kuiSelect kuiSideBarSelect"
|
||||
ng-model="options.selectedTmsLayer"
|
||||
ng-options="layer.id for layer in options.tmsLayers track by layer.id"
|
||||
ng-options="layer.id for layer in collections.tmsLayers track by layer.id"
|
||||
></select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -27,21 +27,17 @@ module.directive('wmsOptions', function (serviceSettings) {
|
|||
template: wmsOptionsTemplate,
|
||||
replace: true,
|
||||
scope: {
|
||||
options: '='
|
||||
options: '=',
|
||||
collections: '=',
|
||||
},
|
||||
link: function ($scope) {
|
||||
|
||||
$scope.options.baseLayersAreLoaded = new Promise((resolve, reject) => {
|
||||
new Promise((resolve, reject) => {
|
||||
|
||||
serviceSettings
|
||||
.getTMSServices()
|
||||
.then((allTMSServices) => {
|
||||
|
||||
if (!$scope.options.tmsLayers) {
|
||||
$scope.options.tmsLayers = [];
|
||||
}
|
||||
|
||||
const newBaseLayers = $scope.options.tmsLayers.slice();
|
||||
const newBaseLayers = $scope.collections.tmsLayers.slice();
|
||||
for (let i = 0; i < allTMSServices.length; i += 1) {
|
||||
const layerFromService = allTMSServices[i];
|
||||
const alreadyAdded = newBaseLayers.some((layer) => layerFromService.id === layer.id);
|
||||
|
@ -49,10 +45,10 @@ module.directive('wmsOptions', function (serviceSettings) {
|
|||
newBaseLayers.push(layerFromService);
|
||||
}
|
||||
}
|
||||
$scope.options.tmsLayers = newBaseLayers;
|
||||
$scope.collections.tmsLayers = newBaseLayers;
|
||||
|
||||
if (!$scope.options.selectedTmsLayer) {
|
||||
$scope.options.selectedTmsLayer = $scope.options.tmsLayers[0];
|
||||
if (!$scope.options.selectedTmsLayer && $scope.collections.tmsLayers.length) {
|
||||
$scope.options.selectedTmsLayer = $scope.collections.tmsLayers[0];
|
||||
}
|
||||
resolve(true);
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ VisTypesRegistryProvider.register(function TileMapVisType(Private, getAppState,
|
|||
'Shaded Geohash Grid',
|
||||
'Heatmap'
|
||||
],
|
||||
baseLayers: []
|
||||
tmsLayers: [],
|
||||
},
|
||||
optionsTemplate: '<tile-map-vis-params></tile-map-vis-params>',
|
||||
schemas: new Schemas([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue