tracman-server/views/map.html

97 lines
2.8 KiB
HTML
Raw Normal View History

2016-03-31 17:06:21 -06:00
{% extends 'templates/base.html' %}
2017-04-13 22:45:25 -06:00
{% block title %}{{super()}}{% if mapuser.name %} | {{mapuser.name}}{% endif %}{% endblock %}
2016-03-31 17:06:21 -06:00
{% block head %}
2016-06-04 04:54:57 -06:00
{{super()}}
2017-04-12 18:38:06 -06:00
<link href="/static/css/.map.min.css" rel="stylesheet">
<style>/* These styles include values passed from to the template from the server. Other styles are in map.css */
{% if noHeader=='1' %} main { top:0; } {% endif %}
2016-03-31 17:06:21 -06:00
2016-05-31 21:54:21 -06:00
{% if mapuser.settings.showStreetview and disp!='0' and disp!='1' %}
2016-03-31 17:06:21 -06:00
/* show both */
2016-05-31 21:54:21 -06:00
@media (orientation: landscape) {
#map, #pano {
display: inline-block;
width: 50%;
height: 100%;
}
2016-05-31 21:54:21 -06:00
#pano { float:right; }
2016-03-31 17:06:21 -06:00
}
@media (orientation: portrait) {
#map, #pano {
width: 100%;
height: 50%;
2016-03-31 17:06:21 -06:00
}
#pano { bottom:0; }
2016-06-04 04:54:57 -06:00
}
2016-05-31 21:54:21 -06:00
{% elif mapuser.settings.showStreetview and disp=='1' %}
2016-03-31 17:06:21 -06:00
/* show streetview */
#map { display:none; }
2016-03-31 17:06:21 -06:00
#pano {
width: 100%;
height: 100%;
}
2016-03-31 17:06:21 -06:00
{% else %}
/* show map */
#map {
width: 100%;
height: 100%;
}
#pano { display:none; }
2016-03-31 17:06:21 -06:00
{% endif %}
</style>
{% endblock %}
{% block main %}
2016-06-04 04:54:57 -06:00
<div id='map'></div>
<div id='pano'></div>
2016-06-04 04:54:57 -06:00
<div id='notset' class='centered alert alert-warning'>
2016-05-31 21:54:21 -06:00
{% if user.id == mapuser.id %}
Your location is unset. You can click 'set' below to set it to your current position.
{% else %}
This user has no location set.
2016-05-31 21:54:21 -06:00
{% endif %}
2016-03-31 17:06:21 -06:00
</div>
{% if user.id == mapuser.id %}
<div id='controls'>
{% if mapuser.settings.showStreetview and disp!='0' %}
<style>
@media (orientation: portrait) {
#controls { bottom:30px }
}
</style>
{% endif %}
<button class='btn set' onclick="setLocation()">Set</button>
<button class='btn track' onclick="trackLocation()" data-toggle="tooltop" title="Tracking location..." data-trigger="manual"><i class='fa fa-crosshairs'></i>&emsp;Track</button>
<button class='btn clear' onclick="clearLocation()">Clear</button>
2017-04-13 22:45:25 -06:00
</div>
{% endif %}
{% endblock %}
{% block javascript %}
{{super()}}
2017-04-16 14:50:02 -06:00
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js" integrity="sha256-WKvqiY0jZHWQZIohYEmr9KUC5rEaYEOFTq+ByllJK8w=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key={{mapApi}}&callback=gmapsCb" async defer></script>
<script type="text/javascript" src="/static/js/.map.min.js"></script>
{% if user.id == mapuser.id %}<script type="text/javascript" src="/static/js/.map-controls.min.js"></script>{% endif %}
<script> /* Variables from server */
2016-05-05 19:13:01 -06:00
const mapuser = JSON.parse('{{mapuser |dump|safe}}'),
noHeader = {{noHeader |dump|safe}},
disp = {{disp |dump|safe}}; // 0=map, 1=streetview, 2=both
2017-03-15 04:30:03 -06:00
2016-06-12 18:18:34 -06:00
{% if user %}
const userid = {{user._id |dump|safe}},
token = {{user.sk32 |dump|safe}};
2016-06-12 18:18:34 -06:00
{% endif %}
2016-06-04 04:54:57 -06:00
2016-03-31 17:06:21 -06:00
</script>
2016-06-12 18:18:34 -06:00
{% endblock %}