|
|
|
@ -212,7 +212,8 @@ def query(filter_dummy, query):
|
|
|
|
|
return json.dumps(l)
|
|
|
|
|
|
|
|
|
|
@app.route(baseURL+'/map/<containerID>')
|
|
|
|
|
def getMap(containerID):
|
|
|
|
|
@app.route(baseURL+'/map/<containerID>/<annotate>')
|
|
|
|
|
def getMap(containerID, annotate=None):
|
|
|
|
|
s = 'select map, overlay from containers where id = :id;'
|
|
|
|
|
r = db_engine.execute(text(s), id=containerID)
|
|
|
|
|
l = []
|
|
|
|
@ -233,6 +234,13 @@ def getMap(containerID):
|
|
|
|
|
# width, height = pointer.size
|
|
|
|
|
# pointerLayer.paste(pointer, (x - int(width/2), y-int(height/2)))
|
|
|
|
|
mapimage = Image.alpha_composite(mapImage, overlayImage)
|
|
|
|
|
if annotate=='a':
|
|
|
|
|
try:
|
|
|
|
|
annotationName = mapFile.split('.')[0] + '-annotated.' + mapFile.split('.')[1]
|
|
|
|
|
annotationImage = Image.open('maps/' + annotationName).convert("RGBA")
|
|
|
|
|
mapimage = Image.alpha_composite(mapimage, annotationImage)
|
|
|
|
|
except FileNotFoundError:
|
|
|
|
|
pass
|
|
|
|
|
return serveImage(mapimage)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|