terracotta-dash-example icon indicating copy to clipboard operation
terracotta-dash-example copied to clipboard

Cannot display tiles in dash mapbox from local terracotta

Open ciskoh opened this issue 2 years ago • 2 comments

Hi all, I am running a local Terracotta server (launched through terracotta serve -r ...). I can see the tiles fine with terracotta client and QGIS, but when I try to visualize them in a dashboard I get only errors in response. From the browser's developer tools this is the request made by the client:

Request URL: http://localhost:5001/singleband/z/0/h/3/16/34217/22982.png?colormap=greys&stretch_range=[41,200]
Request Method: GET
Status Code: 200 OK
Remote Address: 127.0.0.1:5001
Referrer Policy: strict-origin-when-cross-origin 

while this is the (failed request from the dashboard

Request URL: http://localhost:5001/singleband/z/0/h/1/12/2137/1438.png?colormap=greys&stretch_range=[47,208]
Referrer Policy: strict-origin-when-cross-origin

accept: image/webp,*/*
Referer: http://0.0.0.0:5081/
sec-ch-ua: "Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

I did set the CORS ORIGIN for tiles as '["*"]' and indeed the result of curl --head http:/localhost:5001/datasets is the following:

Server: Werkzeug/2.2.3 Python/3.10.9
Date: Fri, 17 Feb 2023 10:34:05 GMT
Content-Type: application/json
Content-Length: 342
Access-Control-Allow-Origin: *
Connection: close

Any idea of what could I be doing wrong? Is there any specific setting I should modify to make local server work with dash? Thanks

ciskoh avatar Feb 17 '23 12:02 ciskoh

What is the error? Did you change any code as compared to the example code? I was able to run the example code locally without any issues.

emilhe avatar Feb 17 '23 12:02 emilhe

What is the error? Did you change any code as compared to the example code? I was able to run the example code locally without any issues.

thanks for the reply. Up to now I was working with the command line ( I have a deployed terracotta instance on the cloud), making my way through the example

ciskoh avatar Feb 17 '23 12:02 ciskoh