Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
736cf7e065 | ||
|
|
68e10ec2ea | ||
|
|
b9142f71e0 | ||
|
|
8818b7d801 | ||
|
|
34d58dcfc9 | ||
|
|
0b77656e05 | ||
|
|
316c9323c2 | ||
|
|
1e6ac07e9e | ||
|
|
2d412372b1 |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
+9
-1
@@ -212,7 +212,8 @@ def query(filter_dummy, query):
|
|||||||
return json.dumps(l)
|
return json.dumps(l)
|
||||||
|
|
||||||
@app.route(baseURL+'/map/<containerID>')
|
@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;'
|
s = 'select map, overlay from containers where id = :id;'
|
||||||
r = db_engine.execute(text(s), id=containerID)
|
r = db_engine.execute(text(s), id=containerID)
|
||||||
l = []
|
l = []
|
||||||
@@ -233,6 +234,13 @@ def getMap(containerID):
|
|||||||
# width, height = pointer.size
|
# width, height = pointer.size
|
||||||
# pointerLayer.paste(pointer, (x - int(width/2), y-int(height/2)))
|
# pointerLayer.paste(pointer, (x - int(width/2), y-int(height/2)))
|
||||||
mapimage = Image.alpha_composite(mapImage, overlayImage)
|
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)
|
return serveImage(mapimage)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -23,6 +23,11 @@ function init_edit(partID) {
|
|||||||
$('input[name=notes-input]').show();
|
$('input[name=notes-input]').show();
|
||||||
$('table#details tr#notes td p').hide();
|
$('table#details tr#notes td p').hide();
|
||||||
|
|
||||||
|
// make map have names of containers for this one click
|
||||||
|
if (!$('img#map').attr('src').endsWith('/a')){
|
||||||
|
$('img#map').attr('src', $('img#map').attr('src') + '/a')
|
||||||
|
}
|
||||||
|
|
||||||
// var newButton = '<div class="round-button-left"><a href="#" onclick="save(' + partID + ')"><i class="fa fa-check" aria-hidden="true"></i></a></div>';
|
// 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);
|
// $('.round-button-left').replaceWith(newButton);
|
||||||
$('#edit-button').html('<i class="fa fa-check" aria-hidden="true"></i>');
|
$('#edit-button').html('<i class="fa fa-check" aria-hidden="true"></i>');
|
||||||
@@ -42,6 +47,10 @@ function new_entry() {
|
|||||||
overlay_in();
|
overlay_in();
|
||||||
container_onchange();
|
container_onchange();
|
||||||
|
|
||||||
|
// make map have names of containers for this one click
|
||||||
|
if (!$('img#map').attr('src').endsWith('/a')){
|
||||||
|
$('img#map').attr('src', $('img#map').attr('src') + '/a')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function end_edit() {
|
function end_edit() {
|
||||||
@@ -75,7 +84,7 @@ function end_edit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function save(partID) {
|
function save(partID) {
|
||||||
if (!$('#location-dropdown').val() || ($'#location-dropdown').val()== -1 ) {
|
if (!$('#location-dropdown').val() || $('#location-dropdown').val()== -1 ) {
|
||||||
alert('Please select a location.');
|
alert('Please select a location.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user