Skip to content

Commit

Permalink
Adds every config option from Leaflet
Browse files Browse the repository at this point in the history
  • Loading branch information
pickypg authored and jbudz committed Jul 13, 2016
1 parent 58844a0 commit 0b9388c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 15 deletions.
9 changes: 5 additions & 4 deletions src/core_plugins/tests_bundle/tests_entry_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ window.__KBN__ = {
esRequestTimeout: '300000',
tilemap: {
url: 'https://tiles.elastic.co/v1/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana',
subdomains: [],
minZoom: 1,
maxZoom: 8,
attribution: '© [Elastic Tile Service](https://www.elastic.co/elastic_tile_service_tos)'
options: {
minZoom: 0,
maxZoom: 8,
attribution: '© [Elastic Tile Service](https://www.elastic.co/elastic_tile_service_tos)'
}
}
},
uiSettings: {
Expand Down
33 changes: 29 additions & 4 deletions src/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,35 @@ module.exports = () => Joi.object({

tilemap: Joi.object({
url: Joi.string().default('https://tiles.elastic.co/v1/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana'),
subdomains: Joi.array().items(Joi.string()).default([]),
minZoom: Joi.number().default(1),
maxZoom: Joi.number().default(8),
attribution: Joi.string().default('© [Elastic Tile Service](https://www.elastic.co/elastic_tile_service_tos)')
options: Joi.object({
attribution: Joi.string().default('© [Elastic Tile Service](https://www.elastic.co/elastic_tile_service_tos)'),
minZoom: Joi.number().default(0),
maxZoom: Joi.number().default(8),
maxNativeZoom: Joi.number().optional(),
tileSize: Joi.number().optional(),
subdomains: Joi.array().items(Joi.string()).single().optional(),
errorTileUrl: Joi.string().uri().optional(),
tms: Joi.boolean().optional(),
continuousWorld: Joi.boolean().optional(),
noWrap: Joi.boolean().optional(),
zoomOffset: Joi.number().optional(),
zoomReverse: Joi.boolean().optional(),
opacity: Joi.number().optional(),
zIndex: Joi.number().optional(),
unloadInvisibleTiles: Joi.boolean().optional(),
detectRetina: Joi.boolean().optional(),
reuseTiles: Joi.boolean().optional(),
bounds: Joi.object({
southWest: Joi.object({
lat: Joi.number().required(),
lng: Joi.number().required()
}).required(),
northEast: Joi.object({
lat: Joi.number().required(),
lng: Joi.number().required()
}).required()
}).optional()
}).default()
}).default(),

}).default();
14 changes: 7 additions & 7 deletions src/ui/public/vislib/visualizations/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ export default function MapFactory(Private, tilemap) {
let defaultMapCenter = [15, 5];
let defaultMarkerType = 'Scaled Circle Markers';

let tilemapOptions = tilemap.options;

tilemapOptions.attribution = marked(tilemapOptions.attribution);

let mapTiles = {
url: tilemap.url,
options: {
attribution: marked(tilemap.attribution),
subdomains: tilemap.subdomains
}
options: tilemapOptions
};

let markerTypes = {
Expand Down Expand Up @@ -56,11 +57,10 @@ export default function MapFactory(Private, tilemap) {
this._attr = params.attr || {};

let mapOptions = {
minZoom: tilemap.minZoom,
maxZoom: tilemap.maxZoom,
minZoom: tilemapOptions.minZoom,
maxZoom: tilemapOptions.maxZoom,
noWrap: true,
maxBounds: L.latLngBounds([-90, -220], [90, 220]),
scrollWheelZoom: false,
fadeAnimation: false,
};

Expand Down

0 comments on commit 0b9388c

Please sign in to comment.