Commit 22e9402b authored by Matija Obreza's avatar Matija Obreza

Tiles: directly target backend tile server

- Skips proxy
parent 3874ae82
......@@ -16,7 +16,7 @@ const config = {
frontendPath: argv['frontend-path'] || '',
// Backend
apiTimeout: +(argv['api-timeout'] || 5000),
apiUrl: argv['api-url'] || 'localhost:8080',
apiUrl: argv['api-url'] || 'http://localhost:8080',
clientId: argv['client-id'] || 'defaultclient@localhost',
clientSecret: argv['client-secret'] || 'changeme',
googleClientId: argv['google-client-id'] || '',
......
......@@ -16,9 +16,8 @@ import PrettyFilters from '../../common/filter/PrettyFilters';
let Map;
let TileLayer;
import {API_ROOT} from 'constants/apiURLS';
interface IMapPageProps extends React.ClassAttributes<any> {
apiUrl: string;
paged: FilteredPage<Accession>;
currentTab: string;
classes: any;
......@@ -80,10 +79,10 @@ class BrowsePage extends React.Component<IMapPageProps, any> {
public render() {
const position = [30, 0];
const { paged, currentTab, classes, filterCode } = this.props;
const { paged, currentTab, classes, filterCode, apiUrl } = this.props;
// const color = 'f00ba0';
const layerUrl = `${API_ROOT}/acn/tile/{z}/{x}/{y}?f=${filterCode ? filterCode : ''}`; // `&color=${color}`;
const layerUrl = `${apiUrl}/acn/tile/{z}/{x}/{y}?f=${filterCode ? filterCode : ''}`; // `&color=${color}`;
return (
<PageLayout>
......@@ -130,6 +129,7 @@ class BrowsePage extends React.Component<IMapPageProps, any> {
}
const mapStateToProps = (state, ownProps) => ({
apiUrl: state.applicationConfig.apiUrl,
paged: state.accessions.paged || undefined,
filterCode: ownProps.match.params.filterCode || '',
currentTab: ownProps.match.params.tab || 'map', // current tab, or ownProps.location.pathname
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment