Browse Source

Change objective.html old markers to green, and add tooltip to objectivemarker

testing
Burathar 4 years ago
parent
commit
9b8d818391
  1. 9
      app/templates/objective.html

9
app/templates/objective.html

@ -5,7 +5,6 @@
{{ super() }} {{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='assets/leaflet/leaflet.css') }}" /> <link rel="stylesheet" href="{{ url_for('static', filename='assets/leaflet/leaflet.css') }}" />
<script src="{{ url_for('static', filename='assets/leaflet/leaflet.js') }}"></script> <script src="{{ url_for('static', filename='assets/leaflet/leaflet.js') }}"></script>
<script src="{{ url_for('static', filename='assets/leaflet/utils.js') }}"></script>
{% endblock %} {% endblock %}
{% block app_content %} {% block app_content %}
@ -62,6 +61,7 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{ url_for('static', filename='assets/leaflet/utils.js') }}"></script>
<script type="text/javascript", crossorigin="anonymous"> <script type="text/javascript", crossorigin="anonymous">
// Leaflet Map // Leaflet Map
map = getMap() map = getMap()
@ -74,7 +74,7 @@
objective = otherObjectives[i] objective = otherObjectives[i]
if(objective.hash == '{{ objective.hash }}'){continue;} if(objective.hash == '{{ objective.hash }}'){continue;}
otherObjectiveMarkers.push(addObjectiveMarker(map, objective, greyIcon)) otherObjectiveMarkers.push(addObjectiveMarker(map, objective, greenIcon))
} }
if ('{{ owner }}' == 'True'){ if ('{{ owner }}' == 'True'){
@ -90,6 +90,11 @@
'{{ objective.longitude }}' '{{ objective.longitude }}'
]) ])
} }
'{% if objective.hash %}'
objectiveMarker.bindTooltip(`<b>{{ objective.name }}</b>`).openPopup();
'{% else %}'
objectiveMarker.bindTooltip('New Objective').openPopup();
'{% endif %}'
objectiveMarker.addTo(map); objectiveMarker.addTo(map);
if (otherObjectiveMarkers.length + 1 > 0) { if (otherObjectiveMarkers.length + 1 > 0) {

Loading…
Cancel
Save