The default provider class
Parameters
props
object
Examples
const myProvider = new Provider({
name: 'foo',
displayName: 'Foo Storage'
icon: Icon,
thumbnail: {width: 300, height: 200}
})
This method will be called when user select a map to load from the storage map viewer
Parameters
loadParams
any the loadParams property of each visualization object
Examples
async downloadMap(loadParams) {
const mockResponse = {
map: {
datasets: [],
config: {},
info: {
app: 'kepler.gl',
created_at: ''
title: 'test map',
description: 'Hello this is my test dropbox map'
}
},
// pass csv here if your provider currently only support save / load file as csv
format: 'keplergl'
};
return downloadMap;
}
Returns MapResponse the map object containing dataset config info and format option
This method is called to determine whether user already logged in to this provider
Returns boolean true if a user already logged in
This method is called by kepler.gl demo app to pushes a new location to history, becoming the current location.
Parameters
fullURL
boolean Whether to return the full url with domain, or just the location (optional, defaulttrue
)
Returns string mapUrl
This method is called after user share a map, to display the share url.
Parameters
fullUrl
boolean Whether to return the full url with domain, or just the location (optional, defaultfalse
)
Returns string shareUrl
This method is called to get the user name of the current user. It will be displayed in the cloud provider tile.
Returns string true if a user already logged in
Whether this provider support upload map to a private storage. If truthy, user will be displayed with the storage save icon on the top right of the side bar.
Returns boolean
Whether this provider support share map via a public url, if truthy, user will be displayed with a share map via url under the export map option on the top right of the side bar
Returns boolean
This method is called to get a list of maps saved by the current logged in user.
Examples
async listMaps() {
return [
{
id: 'a',
title: 'My map',
description: 'My first kepler map',
imageUrl: 'http://',
lastModification: 1582677787000,
privateMap: false,
loadParams: {}
}
];
}
Returns Array<Viz> an array of Viz objects
This method will be called when user click the login button in the cloud provider tile.
Upon login success, onCloudLoginSuccess
has to be called to notify kepler.gl UI
Parameters
onCloudLoginSuccess
function callbacks to be called after login success
This method will be called when user click the logout button under the cloud provider tile.
Upon login success, onCloudLoginSuccess
has to be called to notify kepler.gl UI
Parameters
onCloudLogoutSuccess
function callbacks to be called after logout success
This method will be called to upload map for saving and sharing. Kepler.gl will package map data, config, title, description and thumbnail for upload to storage. With the option to overwrite already saved map, and upload as private or public map.
Parameters
The returned object of downloadMap
. The response object should contain: datasets: [], config: {}, and info: {}
each dataset object should be {info: {id, label}, data: {...}}
to inform how kepler should process your data object, pass in format
Type: Object
map
Objectformat
string one of 'csv': csv file string, 'geojson': geojson object, 'row': row object, 'keplergl': datasets array saved using KeplerGlSchema.save
Type: Object
id
string An unique idtitle
string The title of the mapdescription
string The description of the mapimageUrl
string The imageUrl of the maplastModification
number An epoch timestamp in millisecondsprivateMap
boolean Optional, whether if this map is private to the user, or can be accessed by others via URLloadParams
any A property to be passed todownloadMap