puppet node classifier
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.2 KiB

  1. {% extends "page.html" %}
  2. {% block title %}Photo map{% endblock %}
  3. {% block subtitle %}GPS data{% endblock %}
  4. {% block buttons %}{% endblock %}
  5. {% block body %}
  6. <div class="photo-map">
  7. <div id="mapdiv" style="height: 900px"></div>
  8. <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
  9. <script>
  10. <!-- https://wiki.openstreetmap.org/wiki/OpenLayers_Marker_Example -->
  11. var points = [
  12. {%- for item in images -%}
  13. [{{item.lon}}, {{item.lat}}],
  14. {%- endfor -%}
  15. ]
  16. var map = new OpenLayers.Map("mapdiv");
  17. map.addLayer(new OpenLayers.Layer.OSM());
  18. var markers = new OpenLayers.Layer.Markers( "Markers" );
  19. for(var i=0;i<points.length;i++) {
  20. var point = points[i]
  21. var lonLat = new OpenLayers.LonLat(point[0], point[1])
  22. .transform(new OpenLayers.Projection("EPSG:4326"),
  23. map.getProjectionObject());
  24. var marker = new OpenLayers.Marker(lonLat)
  25. markers.addMarker(marker);
  26. }
  27. map.addLayer(markers);
  28. var zoom={{ zoom or 3 }};
  29. map.setCenter(lonLat, zoom);
  30. </script>
  31. </div>
  32. {% endblock %}