map with names
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
+8
-1
@@ -211,7 +211,7 @@ def query(filter_dummy, query):
|
||||
r.close()
|
||||
return json.dumps(l)
|
||||
|
||||
@app.route(baseURL+'/map/<containerID>')
|
||||
@app.route(baseURL+'/map/<containerID>/<annotate>', defaults={'annotate': None})
|
||||
def getMap(containerID):
|
||||
s = 'select map, overlay from containers where id = :id;'
|
||||
r = db_engine.execute(text(s), id=containerID)
|
||||
@@ -233,6 +233,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)
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ function init_edit(partID) {
|
||||
$('input[name=notes-input]').show();
|
||||
$('table#details tr#notes td p').hide();
|
||||
|
||||
$('img#map').attr('src', 'parts/map/' + data.container_id + '/a');
|
||||
|
||||
// var newButton = '<div class="round-button-left"><a href="#" onclick="save(' + partID + ')"><i class="fa fa-check" aria-hidden="true"></i></a></div>';
|
||||
// $('.round-button-left').replaceWith(newButton);
|
||||
$('#edit-button').html('<i class="fa fa-check" aria-hidden="true"></i>');
|
||||
|
||||
Reference in New Issue
Block a user