-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Raster style.json doesn't load #2570
Labels
bug
Something isn't working
Comments
I found a way to add style (looks weird though):
SS.2024-06-26.at.11.59.07.mov |
🤯 I was able to get this to work programmatically: export const BACKGROUND_LAYER_GROUP_SLUG = "Background";
export const BACKGROUND_LAYER_GROUP: DEFAULT_LAYER_GROUP = {
slug: BACKGROUND_LAYER_GROUP_SLUG,
filter: () => false,
defaultVisibility: false,
isVisibilityToggleAvailable: false,
isMoveToTopAvailable: false,
isColorPickerAvailable: true,
};
export function getOpenStreetMapStyles(): KeplerStyles {
const osmStyleJsonUrl = `${window.location.origin}/app/static/kepler/osm-raster-style.json`;
const style: KeplerStyles = {
osm_public: {
id: "osm_public",
label: "Open Street Map",
url: "",
icon: "https://a.tile.openstreetmap.org/0/0/0.png",
layerGroups: [BACKGROUND_LAYER_GROUP],
colorMode: "LIGHT",
style: {
version: 8,
name: "Open Street Map",
sources: {
openmaptiles: {
type: "raster",
tiles: [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",
"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",
"https://c.tile.openstreetmap.org/{z}/{x}/{y}.png",
],
tileSize: 256,
attribution:
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
},
},
layers: [
{
id: "simple-tiles",
type: "raster",
source: "openmaptiles",
minzoom: 0,
maxzoom: 19,
},
],
},
},
};
console.log("Kepler.App Using Open Street Map", { osmStyleJsonUrl, style });
return style;
}
mapStyles = getOpenStreetMapStyles();
keplerGlReducer.initialState({
mapStyle: {
mapStyles,
styleType,
}, ... }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
My style json from mapbox docs doesn't load into the demo.
based my json on mapbox example
To Reproduce
Steps to reproduce the behavior:
https://kepler.gl/demo
Expected behavior
I can use a raster tile
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: