Skip to content

[feat] support for mapbox basemap styles #2897

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

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bindings/kepler.gl-jupyter/js/lib/keplergl/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function App() {
rel="stylesheet"
href="http://d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css"
/>
<link
rel="stylesheet"
href="http://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css"
Expand Down
1 change: 1 addition & 0 deletions bindings/kepler.gl-jupyter/js/webpack/build-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module.exports = (rules, plugins) => ({
inject: true,
links: [
'https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css',
'https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css',
'https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css'
],
scripts: [
Expand Down
1 change: 1 addition & 0 deletions examples/custom-map-style/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset='UTF-8' />
<title>kepler.gl demo</title>
<link rel="stylesheet" href="//d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">
<link href="//api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
Expand Down
1 change: 1 addition & 0 deletions examples/custom-reducer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset='UTF-8' />
<title>kepler.gl demo</title>
<link href="//d1a3f4spazzrp4.cloudfront.net/uber-fonts/4.0.0/superfine.css" rel="stylesheet">
<link href="//api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
Expand Down
1 change: 1 addition & 0 deletions examples/custom-theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset='UTF-8' />
<title>kepler.gl demo</title>
<link rel="stylesheet" href="//d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">
<link href="//api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
Expand Down
1 change: 1 addition & 0 deletions examples/demo-app/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset='UTF-8' />
<title>kepler.gl demo</title>
<link rel="stylesheet" href="//d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">
<link href="//api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
<link rel="stylesheet" href="/bundle.css">
<style type="text/css">
Expand Down
1 change: 1 addition & 0 deletions examples/node-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset='UTF-8' />
<title>kepler.gl demo</title>
<link rel="stylesheet" href="//d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">
<link href="//api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
Expand Down
1 change: 1 addition & 0 deletions examples/open-modal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset='UTF-8' />
<title>kepler.gl demo</title>
<link rel="stylesheet" href="//d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">
<link href="//api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
<style type="text/css">
body {margin: 0; padding: 0; overflow: hidden;}
Expand Down
5 changes: 3 additions & 2 deletions examples/umd-client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/>

<!--MapBox css-->
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet" />
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet" />

<!-- Load React/Redux -->
Expand Down Expand Up @@ -88,8 +89,8 @@
/** END STORE **/

/** COMPONENTS **/
const KeplerElement = (function(react, keplerGl, mapboxToken) {
return function(props) {
const KeplerElement = (function (react, keplerGl, mapboxToken) {
return function (props) {
return react.createElement(
'div',
{style: {position: 'absolute', left: 0, width: '100vw', height: '100vh'}},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"jest-environment-jsdom": "^29.5.0",
"jsdom": "^24.1.1",
"json-loader": "^0.5.4",
"mapbox-gl": "1.13.1",
"maplibre-gl": "^3.6.2",
"minimist": "^1.2.6",
"nyc": "^15.1.0",
Expand Down
21 changes: 17 additions & 4 deletions src/components/src/common/styled-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,24 @@ export const StyledMapContainer = styled.div`
display: none;
}
}
.mapboxgl-map {
.mapboxgl-missing-css {
display: none;
}
.mapboxgl-ctrl-attrib {
display: none;
}
}
`;

export const StyledAttrbution = styled.div.attrs({
className: 'maplibre-attribution-container'
})`
export type StyledAttrbutionProps = {
mapLibCssClass: string;
mapLibAttributionCssClass: string;
};

export const StyledAttrbution = styled.div.attrs<StyledAttrbutionProps>(props => ({
className: props.mapLibAttributionCssClass
}))<StyledAttrbutionProps>`
bottom: 0;
right: 0;
position: absolute;
Expand Down Expand Up @@ -567,7 +580,7 @@ export const StyledAttrbution = styled.div.attrs({
align-items: center;
color: ${props => props.theme.labelColor};

a.maplibregl-ctrl-logo {
a.${props => props.mapLibCssClass}-ctrl-logo {
width: 72px;
margin-left: 4px;
background-size: contain;
Expand Down
4 changes: 4 additions & 0 deletions src/components/src/kepler-gl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ const GlobalStyle = styled.div`
.maplibregl-ctrl .maplibregl-ctrl-logo {
display: none;
}

.mapboxgl-ctrl .mapboxgl-ctrl-logo {
display: none;
}
`;

type BottomWidgetOuterProps = {
Expand Down
Loading
Loading