Changeset 4554843 in OpenWorkouts-current
- Timestamp:
- Dec 18, 2018, 10:22:36 AM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- 74b9c4d
- Parents:
- e8e633f
- Location:
- ow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/static/js/ow.js
re8e633f r4554843 77 77 }; 78 78 79 80 var add_ow_charts = function add_ow_charts() {81 /*82 Add the analysis charts to the map (elevation, heartrate, cadence, etc)83 This has to be called *after* create_map and *before* load_gpx.84 */85 ow_charts = L.control.ow({86 position: "topright",87 theme: "ow-analysis", //default: lime-theme88 width: 600,89 height: 125,90 margins: {91 top: 10,92 right: 20,93 bottom: 30,94 left: 5095 },96 useHeightIndicator: true, //if false a marker is drawn at map position97 interpolation: "linear", //see https://github.com/mbostock/d3/wiki/SVG-Shapes#wiki-area_interpolate98 hoverNumber: {99 decimalsX: 3, //decimals on distance (always in km)100 decimalsY: 0, //deciamls on height (always in m)101 formatter: undefined //custom formatter function may be injected102 },103 xTicks: undefined, //number of ticks in x axis, calculated by default according to width104 yTicks: undefined, //number of ticks on y axis, calculated by default according to height105 collapsed: false //collapsed mode, show chart on click or mouseover106 });107 108 var ow_charts_container = ow_charts.addTo(map);109 document.getElementById('ow-analysis').appendChild(110 ow_charts_container._container);111 };112 113 114 79 var load_gpx = function load_gpx(gpx_url) { 115 80 /* … … 126 91 }); 127 92 gpx.on("addline",function(e){ 128 //elevation.addData(e.line);129 ow_charts.addData(e.line);93 elevation.addData(e.line); 94 // ow_charts.addData(e.line); 130 95 }); 131 96 gpx.addTo(map); … … 135 100 // create the map, add elevation, load gpx 136 101 create_map(latitude, longitude, zoom); 137 //add_elevation_chart();138 add_ow_charts();102 add_elevation_chart(); 103 // add_ow_charts(); 139 104 load_gpx(gpx_url); 140 105 }; -
ow/templates/workout.pt
re8e633f r4554843 122 122 <metal:body-js metal:fill-slot="body-js"> 123 123 124 125 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> 124 126 <!-- 125 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>126 127 <script src="${request.static_url('ow:static/d3/d3.min.js')}" 127 128 tal:condition="context.has_gpx"></script> … … 142 143 <script src="${request.static_url('ow:static/leaflet-openworkouts/leaflet.openworkouts.src.js')}" 143 144 tal:condition="context.has_gpx"></script> 145 --> 144 146 <script src="${request.static_url('ow:static/js/ow.js')}" 145 147 tal:condition="context.has_gpx"></script> 146 -->147 148 148 149 <script type="text/javascript" tal:condition="context.has_gpx"> 149 150 151 152 153 154 155 156 157 158 workout_map.render()150 var workout_map = owjs.map({ 151 latitude: ${start_point['latitude']}, 152 longitude: ${start_point['longitude']}, 153 zoom: 11, 154 gpx_url: '${request.resource_url(context, 'gpx')}', 155 start_icon: '${request.static_url('ow:static/leaflet-gpx/pin-icon-start.png')}', 156 end_icon: '${request.static_url('ow:static/leaflet-gpx/pin-icon-end.png')}', 157 shadow: '${request.static_url('ow:static/leaflet-gpx/pin-shadow.png')}', 158 }); 159 workout_map.render(); 159 160 </script> 160 161 </metal:body-js>
Note: See TracChangeset
for help on using the changeset viewer.