|
@@ -10,6 +10,8 @@ from django.views.generic import CreateView, DetailView, RedirectView, ListView,
|
|
|
from django.views.decorators.csrf import ensure_csrf_cookie
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
|
|
+from PIL import Image, ImageDraw
|
|
|
+
|
|
|
from .models import Point, Panorama, ReferencePoint
|
|
|
from .forms import SelectReferencePointForm, CustomPointForm, PanoramaForm, ReferencePointForm
|
|
|
|
|
@@ -131,3 +133,22 @@ class LocateCustomPointView(MainView):
|
|
|
context['located_point_lat'] = point.latitude
|
|
|
context['located_point_lon'] = point.longitude
|
|
|
return super(LocateCustomPointView, self).render_to_response(context)
|
|
|
+
|
|
|
+
|
|
|
+def tile_debug_view(request, *args, **kwargs):
|
|
|
+ x = kwargs['x']
|
|
|
+ y = kwargs['y']
|
|
|
+ z = kwargs['z']
|
|
|
+ res = HttpResponse(content_type='image/jpeg')
|
|
|
+ img = Image.new('RGB', (256, 256), (200, 50, 50))
|
|
|
+ draw = ImageDraw.Draw(img)
|
|
|
+ draw.text((50, 50), "x = " + x)
|
|
|
+ draw.text((50, 100), "y = " + y)
|
|
|
+ draw.text((50, 150), "z = " + z)
|
|
|
+ draw.line((0, 0, 0, 255))
|
|
|
+ draw.line((0, 255, 255, 255))
|
|
|
+ draw.line((255, 255, 255, 0))
|
|
|
+ draw.line((255, 0, 0, 0))
|
|
|
+ img.save(res, format='jpeg')
|
|
|
+ del draw
|
|
|
+ return res
|