Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
al
celutz
Commits
79a91f37
Commit
79a91f37
authored
Nov 09, 2022
by
al
Browse files
Modifications mineurs avant mise en prod sur pano2.tetaneutral.net
parent
5655588a
Changes
5
Hide whitespace changes
Inline
Side-by-side
INSTALL.md
View file @
79a91f37
...
...
@@ -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).
...
...
api/serializers.py
View file @
79a91f37
...
...
@@ -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
):
...
...
panorama/admin.py
View file @
79a91f37
...
...
@@ -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
()
panorama/models.py
View file @
79a91f37
...
...
@@ -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
...
...
panorama/templates/panorama/main.html
View file @
79a91f37
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment