|
3 | 3 | title: car-location
|
4 | 4 | ---
|
5 | 5 | <style>
|
6 |
| - |
7 | 6 | h2{
|
8 | 7 | font-size: 1rem;
|
9 | 8 | }
|
| 9 | + input{ |
| 10 | + font-size: 0.8rem; |
| 11 | + } |
10 | 12 | html{
|
11 | 13 | height: 100%;
|
12 | 14 | }
|
|
27 | 29 | }
|
28 | 30 | @media screen and (max-width: 500px) {
|
29 | 31 | body,html {
|
30 |
| - font-size: 28px; |
31 |
| - |
| 32 | + font-size: 20px; |
32 | 33 | }
|
33 | 34 | h2{
|
34 | 35 | display: none;
|
|
132 | 133 | previousVelocityGroup = getVelocityGroup(currentPointsCost.velocity),
|
133 | 134 | reallyDistance = currentPointsCost.distance,
|
134 | 135 | airDistance = reallyDistance,
|
| 136 | + distancePointCount = 1, |
135 | 137 | currentStartPoint = dataPoints[0],
|
136 | 138 | tempPoints = {
|
137 | 139 | points: [getBMapPoint(dataPoints[0].value), getBMapPoint(dataPoints[1].value)],
|
|
144 | 146 | reallyDistance += currentPointsCost.distance; //实际距离
|
145 | 147 | airDistance = GPS.distance(currentStartPoint.value.lat, currentStartPoint.value.lon, dataPoints[i].value.lat, dataPoints[i].value.lon); //航空距离
|
146 | 148 | currentVelocityGroup = getVelocityGroup(currentPointsCost.velocity);
|
| 149 | + //console.log('reallyDistance:',reallyDistance,'airDistance',airDistance); |
147 | 150 | if(currentVelocityGroup == previousVelocityGroup){ //当前两个点的速度和前两个点的速度属于同一个组
|
148 |
| - if(reallyDistance - airDistance < 1){ |
| 151 | + if(reallyDistance - airDistance < 0.02 * ++distancePointCount){ |
149 | 152 | tempPoints.points.length = tempPoints.points.length - 1;
|
| 153 | + }else{ |
| 154 | + reallyDistance = currentPointsCost.distance; |
| 155 | + currentStartPoint = dataPoints[i - 1]; |
| 156 | + distancePointCount = 1; |
150 | 157 | }
|
151 | 158 | tempPoints.points.push(getBMapPoint(dataPoints[i].value));
|
152 | 159 | }else{
|
|
203 | 210 | var $prevPageButton = $('prevPageButton');
|
204 | 211 | var $nextPageButton = $('nextPageButton');
|
205 | 212 | var $searchButton = $('searchButton');
|
| 213 | + var $searchForm = $('searchForm'); |
206 | 214 | var $log = $('log');
|
| 215 | + $searchForm.onsubmit = function(e){ |
| 216 | + e.preventDefault(); |
| 217 | + } |
207 | 218 | $('baiduMapCtn').style.height = (document.body.offsetHeight - $('head').offsetHeight) + 'px'
|
208 | 219 | function CarMarker(deviceId, start, end){
|
209 | 220 | var _this = this;
|
|
347 | 358 | drawGroup: function(pointsGroup){
|
348 | 359 | var _this = this;
|
349 | 360 | var count = 0;
|
| 361 | + console.log(pointsGroup); |
350 | 362 | pointsGroup.forEach(item => {
|
| 363 | + count+= item.points.length; |
351 | 364 | _this.drawLine(item.points, VelocityGroupColor[item.velocityGroup]);
|
352 | 365 | });
|
| 366 | + console.log('实际渲染',count); |
353 | 367 | //加入marker
|
354 | 368 | var iconStart = new BMap.Icon('/resource/2019/markers_bg.png', new BMap.Size(25,40), {
|
355 | 369 | imageSize: new BMap.Size(50, 40),
|
|
0 commit comments