Skip to content

Commit

Permalink
[Maps] Use v7.6 Elastic Maps Service API (#54399)
Browse files Browse the repository at this point in the history
* Use v7.6 Elastic Maps Service API
  • Loading branch information
nickpeihl committed Jan 14, 2020
1 parent be71ec4 commit 6c9e4ec
Show file tree
Hide file tree
Showing 21 changed files with 155 additions and 112 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@elastic/apm-rum": "^4.6.0",
"@elastic/charts": "^16.1.0",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/ems-client": "7.6.0",
"@elastic/eui": "18.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
Expand Down
14 changes: 14 additions & 0 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,25 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
return settings;
};

const mapManifestServiceUrlDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
if (has(settings, 'map.manifestServiceUrl')) {
log(
'You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure the location ' +
'of the Elastic Maps Service settings. These settings have moved to the "map.emsTileApiUrl" and ' +
'"map.emsFileApiUrl" settings instead. These settings are for development use only and should not be ' +
'modified for use in production environments.'
);
}
return settings;
};

export const coreDeprecationProvider: ConfigDeprecationProvider = ({
unusedFromRoot,
renameFromRoot,
}) => [
unusedFromRoot('savedObjects.indexCheckTimeout'),
unusedFromRoot('server.xsrf.token'),
unusedFromRoot('maps.manifestServiceUrl'),
renameFromRoot('optimize.lazy', 'optimize.watch'),
renameFromRoot('optimize.lazyPort', 'optimize.watchPort'),
renameFromRoot('optimize.lazyHost', 'optimize.watchHost'),
Expand All @@ -110,4 +123,5 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
dataPathDeprecation,
rewriteBasePathDeprecation,
cspRulesDeprecation,
mapManifestServiceUrlDeprecation,
];
3 changes: 2 additions & 1 deletion src/legacy/core_plugins/tests_bundle/tests_entry_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const coreSystem = new CoreSystem({
},
mapConfig: {
includeElasticMapsService: true,
manifestServiceUrl: 'https://catalogue-staging.maps.elastic.co/v2/manifest'
emsFileApiUrl: 'https://vector-staging.maps.elastic.co',
emsTileApiUrl: 'https://tiles.maps.elastic.co',
},
vegaConfig: {
enabled: true,
Expand Down
6 changes: 5 additions & 1 deletion src/legacy/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ export default () =>
)
.default([]),
}).default(),
manifestServiceUrl: Joi.string().default('https://catalogue.maps.elastic.co/v7.2/manifest'),
manifestServiceUrl: Joi.string()
.default('')
.allow(''),
emsFileApiUrl: Joi.string().default('https://vector-staging.maps.elastic.co'),
emsTileApiUrl: Joi.string().default('https://tiles.maps.elastic.co'),
emsLandingPageUrl: Joi.string().default('https://maps.elastic.co/v7.4'),
emsFontLibraryUrl: Joi.string().default(
'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf'
Expand Down
36 changes: 18 additions & 18 deletions src/legacy/ui/public/vis/__tests__/map/ems_mocks/sample_files.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/world_countries_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/world_countries_v1.geo.json",
"legacy_default": true
}
],
Expand Down Expand Up @@ -430,7 +430,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/australia_states_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/australia_states_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -629,7 +629,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/canada_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/canada_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -908,7 +908,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/china_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/china_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -1266,7 +1266,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/finland_regions_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/finland_regions_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -1634,7 +1634,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/france_departments_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/france_departments_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -1984,7 +1984,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/germany_states_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/germany_states_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -2328,7 +2328,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/ireland_counties_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/ireland_counties_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -2637,7 +2637,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/japan_prefectures_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/japan_prefectures_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -3003,7 +3003,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/netherlands_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/netherlands_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -3309,7 +3309,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/norway_counties_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/norway_counties_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -3671,7 +3671,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/spain_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/spain_provinces_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -4002,7 +4002,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/sweden_counties_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/sweden_counties_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -4311,7 +4311,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/switzerland_cantons_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/switzerland_cantons_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -4827,7 +4827,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/uk_subdivisions_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/uk_subdivisions_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -5074,7 +5074,7 @@
"formats": [
{
"type": "topojson",
"url": "https://vector-staging.maps.elastic.co/files/usa_counties_v2.topo.json?elastic_tile_service_tos=agree",
"url": "/files/usa_counties_v2.topo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -5441,7 +5441,7 @@
"formats": [
{
"type": "geojson",
"url": "https://vector-staging.maps.elastic.co/files/usa_states_v1.geo.json?elastic_tile_service_tos=agree",
"url": "/files/usa_states_v1.geo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down Expand Up @@ -5731,7 +5731,7 @@
"formats": [
{
"type": "topojson",
"url": "https://vector-staging.maps.elastic.co/files/usa_zip_codes_v2.topo.json?elastic_tile_service_tos=agree",
"url": "/files/usa_zip_codes_v2.topo.json?elastic_tile_service_tos=agree",
"legacy_default": true
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{
"id": "tiles_v2",
"name": "Elastic Maps Tile Service",
"manifest": "https://tiles.foobar/manifest",
"manifest": "https://tiles.foobar/v7.6/manifest",
"type": "tms"
},
{
"id": "geo_layers",
"name": "Elastic Maps Vector Service",
"manifest": "https://files.foobar/manifest",
"manifest": "https://files.foobar/v7.6/manifest",
"type": "file"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"bounds": [-180, -85.0511, 180, 85.0511],
"format": "png",
"type": "baselayer",
"tiles": ["https://raster-style.foobar/styles/osm-bright/{z}/{x}/{y}.png"],
"tiles": ["/raster/styles/osm-bright/{z}/{x}/{y}.png"],
"center": [0, 0, 2]
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"sources": {
"openmaptiles": {
"type": "vector",
"url": "https://tiles.maps.elastic.co/data/v3.json"
"url": "/data/v3.json"
}
},
"sprite": "https://tiles.maps.elastic.co/styles/osm-bright/sprite",
"glyphs": "https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf",
"sprite": "/styles/osm-bright/sprite",
"glyphs": "/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tiles": [
"https://tiles.maps.elastic.co/data/v3/{z}/{x}/{y}.pbf"
"/data/v3/{z}/{x}/{y}.pbf"
],
"name": "OpenMapTiles",
"format": "pbf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"bounds": [-180, -85.0511, 180, 85.0511],
"format": "png",
"type": "baselayer",
"tiles": ["https://raster-style.foobar/styles/dark-matter/{z}/{x}/{y}.png"],
"tiles": ["/raster/styles/dark-matter/{z}/{x}/{y}.png"],
"center": [0, 0, 2]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"bounds": [-180, -85.0511, 180, 85.0511],
"format": "png",
"type": "baselayer",
"tiles": ["https://raster-style.foobar/styles/osm-bright-desaturated/{z}/{x}/{y}.png"],
"tiles": ["/raster/styles/osm-bright-desaturated/{z}/{x}/{y}.png"],
"center": [0, 0, 2]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
{
"locale": "en",
"format": "vector",
"url": "https://vector-style.foobar/styles/osm-bright/style.json"
"url": "/v7.6/styles/osm-bright/style.json"
},
{
"locale": "en",
"format": "raster",
"url": "https://raster-style.foobar/styles/osm-bright.json"
"url": "/v7.6/styles/osm-bright.json"
}
]
},
Expand All @@ -47,12 +47,12 @@
{
"locale": "en",
"format": "vector",
"url": "https://vector-style.foobar/styles/osm-bright-desaturated/style.json"
"url": "/v7.6/styles/osm-bright-desaturated/style.json"
},
{
"locale": "en",
"format": "raster",
"url": "https://raster-style.foobar/styles/osm-bright-desaturated.json"
"url": "/v7.6/styles/osm-bright-desaturated.json"
}
]
},
Expand All @@ -75,12 +75,12 @@
{
"locale": "en",
"format": "vector",
"url": "https://vector-style.foobar/styles/dark-matter/style.json"
"url": "/v7.6/styles/dark-matter/style.json"
},
{
"locale": "en",
"format": "raster",
"url": "https://raster-style.foobar/styles/dark-matter.json"
"url": "/v7.6/styles/dark-matter.json"
}
]
}
Expand Down
Loading

0 comments on commit 6c9e4ec

Please sign in to comment.