Skip to content

From flask to emmett #373

Answered by josejachuf
josejachuf asked this question in Q&A
Aug 3, 2021 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

tile is bytes type (<class 'bytes'>) In Flask this works fine

tile = get_tile(z, x, y)
response = make_response(tile)
response.headers['Content-Type'] = "application/octet-stream"
return response

in emmett I made this:

tile = get_tile(z, x, y)
response.headers['Content-Type'] = "application/octet-stream" 
return tile

This returns a bytes too, but the maps viewer shows an error and does not render the map

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@josejachuf
Comment options

Comment options

You must be logged in to vote
3 replies
@josejachuf
Comment options

@gi0baro
Comment options

@josejachuf
Comment options

Answer selected by josejachuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants