Fix Map Attribution Problems (#10696)

* Fix Map Attribution Errors

* Move "Limit" Dropdown to the left

* fix pagination styles

* move attribution to the left
This commit is contained in:
Malte Jürgens
2021-12-27 20:35:52 +01:00
committed by GitHub
parent 54ec5b2436
commit 04c65e6d09
8 changed files with 54 additions and 21 deletions

View File

@@ -8,6 +8,7 @@ export type BasemapSource = {
type: 'raster' | 'tile' | 'style';
url: string;
tileSize?: number;
attribution?: string;
};
const defaultBasemap: BasemapSource = {
@@ -15,6 +16,7 @@ const defaultBasemap: BasemapSource = {
type: 'raster',
url: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png',
tileSize: 256,
attribution: '© OpenStreetMap contributors',
};
const baseStyle: Style = {
@@ -38,6 +40,7 @@ export function getStyleFromBasemapSource(basemap: BasemapSource): Style | strin
} else {
const style: Style = { ...baseStyle };
const source: RasterSource = { type: 'raster' };
if (basemap.attribution) source.attribution = basemap.attribution;
if (basemap.type == 'raster') {
source.tiles = expandUrl(basemap.url);
source.tileSize = basemap.tileSize || 512;