Commit 24f729b5 authored by Haas, Ingrid's avatar Haas, Ingrid

update panoId and path in tour.js and correct index.html

parents 6961f8d0 1222be8d
# directories to be excluded
./www/videos
\ No newline at end of file
/.pydevproject
/.project
/.settings/
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.8</pydev_property>
</pydev_project>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="www"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="AfricaTour">
<wb-resource deploy-path="/" source-path="/www"/>
<property name="context-root" value="AfricaTour"/>
</wb-module>
</project-modules>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.web"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="wst.web" version="1.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
FROM python:2.7
FROM python:3.8.4-alpine3.11
RUN apk add nfs-utils
WORKDIR "/opt/leuven"
COPY ./server.py /opt/leuven/server.py
COPY ./www /opt/leuven/www
RUN mkdir -p /opt/leuven/www/videos
WORKDIR "/opt/leuven"
CMD [ "python", "server.py" ]
\ No newline at end of file
Intro
-----
Generic instructions and documentation concerning the Leuven virtual tour
- [http://leuven.isric.org/](http://leuven.isric.org/)
- [https://ees.kuleuven.be/africa-in-profile/virtuele-tentoonstelling/index.html](https://ees.kuleuven.be/africa-in-profile/virtuele-tentoonstelling/index.html)
Deployment
----------
Tour is run from OC, project leuven:
```
#Note that there are some mis-confusion with image names and locations
oc project leuven
docker build -t docker-registry.wur.nl/isric/leuven/leuven-v0-2 .
docker push docker-registry.wur.nl/isric/leuven/leuven-v0-2
oc import-image leuven:latest
```
The docker image contains a video folder that considerable increases the image size and the time for deployment: `./www/videos` this has been changed into using a pod container that will contain a permanent version of the videos.
Google tour key
---------------
The google tour key is associated to the `worlsoilmuseum@gmail.com`
```
key=AIzaSyBNjBofeB7ALxZAN0oTSEOJwQfYvzQfl8w
```
The key is used on `index.html` around line 30:
```javascirpt
<script>
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyBNjBofeB7ALxZAN0oTSEOJwQfYvzQfl8w&callback=initTour";
$("head").append(s);
</script>
```
Google tour medatainfo
----------------------
Checking on the network console (browser) we have the [GeoPhotoService.GetMetadata](https://maps.googleapis.com/maps/api/js/GeoPhotoService.GetMetadata?pb=!1m5!1sapiv3!5sUS!11m2!1m1!1b0!2m2!1sen!2sUS!3m3!1m2!1e10!2sAF1QipN8WM2np43B5Ze7P_A3_Ftc_EYPWRYV6BbFWmzl!4m6!1e1!1e2!1e3!1e4!1e8!1e6&callback=_xdc_._vlmdra) url that contains metadata of the tour:
Panoid
------
Panoid is used on `tour.js` to start the tour and then on `leuven_tour.json` to define the icon location. Therefore the icon location on the tour is defined by this specific id. Looking at the tour on a browser the current panoid can be obtain on the console, inspecting object `panorama.location`
```
>> panorama.location
```
Google has new documentation concerning the customization of streeview: [here](https://developers.google.com/maps/documentation/javascript/examples/streetview-custom-simple?hl=nl
)
Development Notes
-----------------
check
Hierbij de files voor de virtuele tour
De bestanden staan geordend zoals ze op mijn machine werken
Plaatsen waar het pad mogelijk aangepast moet worden:
-www/assets/js/tour.js :
regel 17 -21 (Het pad van de links wanneer op de icoontjes wordt geklikt)
regel 28,29,30,31,32: img src (Het pad naar de icoontjes in de tour)
De links worden opgebouwd door het basis pad zoals in tour.js te koppelen aan de url per icoontje zoals in www/assets/tour/leuven_tour.json staat.
De gebruikte pdf-en staan in de folder www/assets/pdf.
De gebruikte video’s staan in de folder www/assets/video.
De foto’s van de objecten in de vitrinekasten en de foto’s van de panelen staan in www/images.
Hierbij de files voor de virtuele tour
De bestanden staan geordend zoals ze op mijn machine werken
Plaatsen waar het pad mogelijk aangepast moet worden:
-www/assets/js/tour.js :
regel 17 -21 (Het pad van de links wanneer op de icoontjes wordt geklikt)
regel 28,29,30,31,32: img src (Het pad naar de icoontjes in de tour)
De links worden opgebouwd door het basis pad zoals in tour.js te koppelen aan de url per icoontje zoals in www/assets/tour/leuven_tour.json staat.
De gebruikte pdf-en staan in de folder www/assets/pdf.
De gebruikte video’s staan in de folder www/assets/video.
De foto’s van de objecten in de vitrinekasten en de foto’s van de panelen staan in www/images.
#!/usr/bin/python3
""" Script to server the page independent """
import sys,os
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from socket import socket, SOCK_DGRAM,AF_INET
HandlerClass = SimpleHTTPRequestHandler
ServerClass = BaseHTTPServer.HTTPServer
Protocol = "HTTP/1.0"
SubFolder= "www"
port = 80 # For testing change to another port
import os
import http.server
import socketserver
def getIP():
"""Determines the current IP inside the WUR network."""
s=socket(AF_INET,SOCK_DGRAM)
s.connect(("216.58.209.164",0)) #google.com
try:
return s.getsockname()[0]
except:
return "127.0.0.1"
SubFolder = "www"
ip = "0.0.0.0"
port = 80 # For testing change to another port (you can only bind to port 80 as root)
os.chdir(os.path.join(os.path.abspath(os.curdir),SubFolder))
server_address = (getIP(), port)
HandlerClass.protocol_version = Protocol
httpd = ServerClass(server_address, HandlerClass)
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
httpd.serve_forever()
\ No newline at end of file
server_address = (ip, port)
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(server_address, Handler) as httpd:
print(f"serving at: {ip}:{port}")
httpd.serve_forever()
......@@ -27,14 +27,9 @@
<script >
var s = document.createElement("script");
s.type = "text/javascript";
<<<<<<< HEAD
//s.src = "https://maps.googleapis.com/maps/api/js?sensor=false&callback=initTour"; try below nov 2019
s.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyBxtmVPaEWur1IXxj2aGCPwxRILStmqKoE&callback=initTour";
=======
s.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyBNjBofeB7ALxZAN0oTSEOJwQfYvzQfl8w&sensor=false&callback=initTour";
>>>>>>> b25a74de79f323fa1aa484a62e268b9e352adf9f
$("head").append(s);
</script>
</script>
</html>
\ No newline at end of file
Markdown is supported
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