mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 22:47:10 +00:00
working, but very faint
This commit is contained in:
@@ -107,7 +107,7 @@ class MapLocations(object):
|
||||
# Parameters for big map and zoomed subarea maps:
|
||||
# big map first (zoom factor ignored)
|
||||
|
||||
# These are the values for the url? /prospecting/[mapcode].png ??
|
||||
# These are the values for the url /prospecting/[mapcode].png
|
||||
|
||||
maps = {
|
||||
# id left top right bottom zoom
|
||||
@@ -210,23 +210,23 @@ def plot(surveypoint, number, point_type, label, mapcode, draw, img):
|
||||
def prospecting_image(request, name):
|
||||
# We should replace all this with something that exports an overlay for Google Maps and OpenStreetView
|
||||
|
||||
test = os.path.join(settings.EXPOFILES, "location_maps", "testmap.png")
|
||||
response = HttpResponse(content_type = "image/png")
|
||||
with Image.open(test) as im:
|
||||
# test = os.path.join(settings.EXPOFILES, "location_maps", "testmap.png")
|
||||
# response = HttpResponse(content_type = "image/png")
|
||||
# with Image.open(test) as im:
|
||||
|
||||
draw = ImageDraw.Draw(im)
|
||||
draw.line((0, 0) + im.size, fill=128)
|
||||
draw.line((0, im.size[1], im.size[0], 0), fill=128)
|
||||
# draw = ImageDraw.Draw(im)
|
||||
# draw.line((0, 0) + im.size, fill=128)
|
||||
# draw.line((0, im.size[1], im.size[0], 0), fill=128)
|
||||
|
||||
# write to stdout
|
||||
#im.save(sys.stdout, "PNG")
|
||||
img.save(response, "PNG")
|
||||
# # write to stdout
|
||||
# #im.save(sys.stdout, "PNG")
|
||||
# img.save(response, "PNG")
|
||||
|
||||
return response
|
||||
# return response
|
||||
|
||||
mainImage = Image.open(os.path.join(settings.EXPOFILES, "location_maps", "pguidemap.jpg"))
|
||||
if settings.PUBLIC_SITE and not request.user.is_authenticated:
|
||||
mainImage = Image.new("RGB", mainImage.size, '#ffffff')
|
||||
# if settings.PUBLIC_SITE and not request.user.is_authenticated:
|
||||
# mainImage = Image.new("RGB", mainImage.size, '#ffffff')
|
||||
m = maps[name]
|
||||
#imgmaps = []
|
||||
if name == "all":
|
||||
|
||||
Reference in New Issue
Block a user