kepler.gl icon indicating copy to clipboard operation
kepler.gl copied to clipboard

Load map using a URL should be part of Kepler.gl framework

Open macrigiuseppe opened this issue 7 years ago • 7 comments

Currently only demo website can load maps through url. We should move the feature to be part of Kepler.gl framework so developer can take advantage of the feature

macrigiuseppe avatar Feb 21 '19 00:02 macrigiuseppe

Hi We are using kepler.gl 1.1.0 and we are missing the feature "Load map using a URL". On which release version it will be added ?

Thanks

bragilev avatar Jun 25 '19 12:06 bragilev

Hi We are using kepler.gl 1.1.0 and we are missing the feature "Load map using a URL". On which release version it will be added ?

Thanks

Hi @bragilev, loading through URL is not part of Kepler.gl but you can find it in our demo app example.

The example provides information on how to customize Kepler.gl in order to provide the url fetching capability

macrigiuseppe avatar Jun 26 '19 19:06 macrigiuseppe

Hi I added a new button by overriding PanelTitleFactory to add loading dynamic layers through URL functionality. But I have a problem when I remove a dataset using delete basket and after it I try to add it in the same way, the dataset loaded with no configuration. I dispatch addDataToMap in following way : const dataset = { data, info: { id: layer, label: layer } }; const config = this.getMapConfig(); config.config = myConfig; this.props.dispatch(addDataToMap({datasets: dataset, config}));

First time loading datasets : image

Second time loading , after deleting dataset : image

layer configuration : { "id": "Hotzone", "type": "geojson", "config": { "dataId": "Hotzone", "label": "Hotzone", "color": [ 255, 152, 51, 255 ], "columns": { "geojson": "att_hotzone_geojson" }, "isVisible": true } },

Any ideas ? Thanks

bragilev avatar Jul 11 '19 08:07 bragilev

I found a workaround. It looks like there is an issue with "visState" "layerToBeMerged" array. After I delete a dataset, the appropriate layer is removed from the array. And then I dispatch "addDataToMap" the layer is missing and there is no correlation between dataset and configuration. The solution was to update the "layerToBeMerged" array before despatching the action.

bragilev avatar Jul 16 '19 14:07 bragilev

As a part of this issue, it would be great to be able to load layers from s3/azure blob storage, and doing so requires query parameters with SAS token. Currently, the fetch just looks at the ending of the url for csv/json, I striped off the token for the assigning of the file type. On my fork I updated file-handler.js to include this simple fix. Be happy to share if needed.

bigdawgmj avatar Oct 09 '19 22:10 bigdawgmj

I found a workaround. It looks like there is an issue with "visState" "layerToBeMerged" array. After I delete a dataset, the appropriate layer is removed from the array. And then I dispatch "addDataToMap" the layer is missing and there is no correlation between dataset and configuration. The solution was to update the "layerToBeMerged" array before despatching the action.

hey @bragilev what kind of issue are you referring to?

macrigiuseppe avatar Oct 10 '19 17:10 macrigiuseppe

This would indeed be great to allow for loading a map via a config url directly within the demo-app. Using search query url-param string like passing mapConfig=[URL] could result in loading the keplergl demo with the mapConfig loaded.

Probably somehow related to providing an official container image to the keplergl demo app requested from time to time, eg https://github.com/keplergl/kepler.gl/discussions/2836 or https://github.com/keplergl/kepler.gl/issues/2024

Currently, the mapConfig seems to reference datasets by their ids, it would be great if one could also pass not only config but also datasets url-endpoints, similar to the object expected by addDataToMap.


addDataToMap({
  datasets: [
    {
      info: {
        label, id: "dataset-id",
      },
      data: data,
    }
  ],
  options: { keepExistingConfig: true, autoCreateLayers: false, centerMap: false },
  config: { 
    // ... 
  }
})

jo-chemla avatar Nov 27 '25 09:11 jo-chemla