keplergl / keplergl/kepler.gl

[Bug]

Open
#1,250 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
12k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
66

Description

**Describe the bug**
keplar gl custome add data map dataset replace after add new dataset
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '. loadremoteconfig
2. and i have this function
export function loadRemoteMap(options,dataurl) {
//console.log(sampleTripData);
var rowdata = options.data["rows"]["0"];
var rowarray=[];
rowdata.forEach(obj=>{
var myInnerArray=[];
Object.keys(obj).forEach(key=>{
myInnerArray.push(obj[key]);
})
rowarray.push(myInnerArray);
});

const visurdata = {
fields:options.data["schema"]["0"],
rows:rowarray
// rows: [
// ['test1', -73.99389648, 40.75011063],
// ['test2', -73.97642517, 40.73981094],
// ['test3', -73.96870422, 40.75424576],
// ]
};
//console.log(visurdata);
const sampleConfig = {
visState: {
filters: [
{
id: dataurl,
dataId: dataurl,
name: dataurl,
// type: 'timeRange',
enlarged: true
}
]
}
}
return dispatch => {
dispatch(setLoadingMapStatus(true));
dispatch(
addDataToMap({
datasets: {
info: {
label: dataurl.dataUrl,
id: dataurl.dataUrl
},
data: visurdata
},
option: {
centerMap: true,
readOnly: false,
keepExistingConfig: true
},
info: {
title: dataurl.dataUrl,
description: dataurl.dataUrl
},
config: sampleConfig
})
);

error => {
const {target = {}} = error;
const {status, responseText} = target;
dispatch(loadRemoteResourceError({status, message: responseText}, options.dataUrl));
}

// dispatch(setLoadingMapStatus(false))
// breakdown url into url+query params
// loadRemoteRawData(options.dataUrl).then(
// // In this part we turn the response into a FileBlob
// // so we can use it to call loadFiles
// ([file, url]) => {
// const {file: filename} = parseUri(url);
// dispatch(loadFiles([new File([file], filename)])).then(() =>
//
// );
// },
// error => {
// const {target = {}} = error;
// const {status, responseText} = target;
// dispatch(loadRemoteResourceError({status, message: responseText}, options.dataUrl));
// }
// );
};
}

![image](https://user-images.githubusercontent.com/7962189/91613288-d838ea00-e99c-11ea-8796-d26b03afbb2c.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the loadRemoteMap entry point shown in the issue and trace its addDataToMap dispatch. Reproduce adding a custom dataset followed by a new dataset, checking whether the existing dataset is replaced as shown in the screenshot. Done means the intended dataset behavior is confirmed and the regression is covered by the relevant frontend test or reproduction path.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.