Commit 79a91f37 authored by al's avatar al
Browse files

Modifications mineurs avant mise en prod sur pano2.tetaneutral.net

parent 5655588a
......@@ -29,6 +29,7 @@ should look like this:
python3 -m venv ~/mycelutzvenv
. ~/mycelutzvenv/bin/activate
pip install --upgrade pip
pip install "setuptools<58.0.0"
pip install -r requirements.txt
Redis is used as a message broker between Django and Celery workers, used for tile generation (see below).
......
......@@ -11,7 +11,7 @@ class ReferencePointSerializer(serializers.HyperlinkedModelSerializer):
model = ReferencePoint
fields = ("url", "name",
"latitude", "longitude", "altitude",
"refpoint_references")
"refpoint_references", "timestamp")
class PanoramaSerializer(serializers.HyperlinkedModelSerializer):
......@@ -21,7 +21,8 @@ class PanoramaSerializer(serializers.HyperlinkedModelSerializer):
fields = ("url", "name", "loop", "image_width", "image_height",
"latitude", "longitude", "altitude",
"tiles_url",
"panorama_references")
"panorama_references",
"timestamp")
class ReferenceSerializer(serializers.HyperlinkedModelSerializer):
......
......@@ -9,6 +9,8 @@ from django.utils.translation import gettext_lazy as _
from .models import Panorama, ReferencePoint, Reference
from .utils import path_exists
from django.core import serializers
from datetime import datetime
class ReferenceInline(admin.TabularInline):
model = Reference
......@@ -42,3 +44,12 @@ class ReferencePointAdmin(admin.ModelAdmin):
list_filter = ('kind', )
fields = ('name', ('latitude', 'longitude'), ('ground_altitude', 'height_above_ground'), 'kind')
search_fields = ('name', )
actions = ('save_refpoints_json', )
def save_refpoints_json(self, request, queryset):
data = serializers.serialize("json", queryset)
filename = "refpoints" + datetime.now().isoformat() + ".json"
savefile = open(filename, "w+")
savefile.write(data)
savefile.close()
......@@ -133,7 +133,7 @@ class AbstractPoint(models.Model, PointMixin):
height_above_ground = models.FloatField(verbose_name=_("height above ground"),
help_text=_("In meters"),
default=0.)
timestamp = models.DateTimeField(auto_now_add=True)
timestamp = models.DateTimeField(auto_now_add=True, blank=True, null=True)
class Meta:
abstract = True
......
......@@ -209,7 +209,10 @@
var osm = new L.TileLayer(osmUrl, {attribution: osmAttrib, maxZoom: 19});
// start the map in Grenoble
map.setView(new L.LatLng(45.1842, 5.7218),13);
//map.setView(new L.LatLng(45.1842, 5.7218),13);
//map.addLayer(osm);
// start the map in Toulouse
map.setView(new L.LatLng(43.61, 1.45), 12);
map.addLayer(osm);
// Add in a crosshair for the map
......@@ -284,7 +287,7 @@
return div;
};
map.addLayer(pointsOfInterest);
map.fitBounds(fittingMarkers,{padding: [30, 30]});
//map.fitBounds(fittingMarkers,{padding: [30, 30]});
legend.addTo(map);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment