LogoLogo
  • Welcome
  • What's new?
  • Docs
    • User guides
      • Get Started
      • Kepler.gl workflow
        • Add data to layers
          • Adding Data Layers
          • Create a Layer
          • Blend and Rearrange Layers
          • Hide, Edit and Delete Layers
        • Add Data to the Map
      • Layers
        • Point
        • S2 Layer
        • Icon
        • Line
        • Cluster
        • Polygon
        • Hexbin
        • Grid
        • H3
        • Heatmap
        • Arc
        • Trip layer
      • Layer Attributes
      • Color Palettes
      • Filters
      • Map Styles
      • Interactions
      • Map Settings
      • Time Playback
      • Save and Export
      • FAQ
    • API Reference
      • ecosystem
      • Get Started
      • Advanced usages
        • Saving and Loading Maps with Schema Manager
        • Replace UI Component with Component Dependency Injection
        • Forward Dispatch Actions
        • Reducer Plugin
        • Using Updaters
        • Custom reducer initial state
        • custom-mapbox-host
      • Components
      • Reducers
        • reducers
        • map-style
        • map-state
        • combine
        • overview
        • ui-state
        • vis-state
      • Processors
        • All processors
      • Schemas
      • Actions
        • All actions
      • Cloud providers
        • Provider
      • Custom theme
      • Localization
    • Jupyter Notebook
  • Examples
    • Node/Express
    • Demo App
    • Open modal
    • Open modal
    • UMD client
    • Customize kepler.gl Theme
    • Customize kepler.gl Reducer
  • Contributing
    • Developing Kepler.gl
    • Contributor Covenant Code of Conduct
  • Change Log
  • Upgrade Guide
Powered by GitBook
On this page
  • Provider
  • MapResponse
  • Viz

Was this helpful?

  1. Docs
  2. API Reference
  3. Cloud providers

Provider

PreviousCloud providersNextCustom theme

Last updated 1 year ago

Was this helpful?

Table of Contents

Provider

The default provider class

Parameters

    • props.icon ReactElement React element

Examples

const myProvider = new Provider({
 name: 'foo',
 displayName: 'Foo Storage'
 icon: Icon,
 thumbnail: {width: 300, height: 200}
})

downloadMap

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;
}

getAccessToken

This method is called to determine whether user already logged in to this provider

getMapUrl

This method is called by kepler.gl demo app to pushes a new location to history, becoming the current location.

Parameters

getShareUrl

This method is called after user share a map, to display the share url.

Parameters

getUserName

This method is called to get the user name of the current user. It will be displayed in the cloud provider tile.

hasPrivateStorage

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.

hasSharingUrl

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

listMaps

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://',
       udpatedAt: 1582677787000,
       privateMap: false,
       loadParams: {}
     }
   ];
 }

login

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

logout

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

uploadMap

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

MapResponse

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

Properties

Viz

Properties

  • loadParams any A property to be passed to downloadMap

props

props.name

props.displayName

props.thumbnail thumbnail size object

props.thumbnail.width thumbnail width in pixels

props.thumbnail.height thumbnail height in pixels

Returns the map object containing dataset config info and format option

Returns true if a user already logged in

fullURL Whether to return the full url with domain, or just the location (optional, default true)

Returns mapUrl

fullUrl Whether to return the full url with domain, or just the location (optional, default false)

Returns shareUrl

Returns true if a user already logged in

Returns

Returns

Returns <> an array of Viz objects

onCloudLoginSuccess callbacks to be called after login success

onCloudLogoutSuccess callbacks to be called after logout success

param

param.mapData the map object

param.mapData.map {datasets. config, info: {title, description}}

param.mapData.thumbnail A thumbnail of current map. thumbnail size can be defined by provider by this.thumbnail

param.options (optional, default {})

param.options.overwrite whether user choose to overwrite already saved map under the same name

param.options.isPublic whether user wish to share the map with others. if isPublic is truthy, kepler will call this.getShareUrl() to display an URL they can share with others

Type:

map

map.datasets <>

map.config

map.info

format one of 'csv': csv file string, 'geojson': geojson object, 'row': row object, 'keplergl': datasets array saved using KeplerGlSchema.save

Type:

id An unique id

title The title of the map

description The description of the map

imageUrl The imageUrl of the map

lastModification An epoch timestamp in milliseconds

privateMap Optional, whether if this map is private to the user, or can be accessed by others via URL

object
string
string
object
number
number
boolean
boolean
string
boolean
string
string
boolean
boolean
function
function
Object
Object
Object
Blob
Object
boolean
boolean
Object
Object
Array
Object
Object
Object
string
Object
string
string
string
string
number
boolean
Provider
downloadMap
getAccessToken
getMapUrl
getShareUrl
getUserName
hasPrivateStorage
hasSharingUrl
listMaps
login
logout
uploadMap
MapResponse
Viz
MapResponse
Array
Viz