Files
redash/client/app/visualizations/map/getOptions.js
Arik Fraimovich 56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00

30 lines
685 B
JavaScript

import { merge } from "lodash";
const DEFAULT_OPTIONS = {
latColName: "lat",
lonColName: "lon",
classify: null,
groups: {},
mapTileUrl: "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
clusterMarkers: true,
customizeMarkers: false,
iconShape: "marker",
iconFont: "circle",
foregroundColor: "#ffffff",
backgroundColor: "#356AFF",
borderColor: "#356AFF",
bounds: null,
};
export default function getOptions(options) {
options = merge({}, DEFAULT_OPTIONS, options);
options.mapTileUrl = options.mapTileUrl || DEFAULT_OPTIONS.mapTileUrl;
// Backward compatibility
if (options.classify === "none") {
options.classify = null;
}
return options;
}