Skip to content

Commit 5eb8cee

Browse files
authored
#7 - Added arrow to show direction for links. (#9)
1 parent 9c739a6 commit 5eb8cee

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

dist/images/arrow-black.png

673 Bytes
Loading

gulpfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,9 @@ gulp.task('templates', function() {
9090
.pipe(gulp.dest('dist'));
9191
});
9292

93-
gulp.task('default', ['styles', 'templates']);
93+
gulp.task('images', function() {
94+
return gulp.src(['./src/images/*'])
95+
.pipe(gulp.dest('dist/images'));
96+
});
97+
98+
gulp.task('default', ['styles', 'templates', 'images']);

src/images/arrow-black.png

673 Bytes
Loading

src/ml-ol-maps-helper.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@
5858
})
5959
];
6060

61-
// geometry.forEachSegment(function(start, end) {
62-
// var dx = end[0] - start[0];
63-
// var dy = end[1] - start[1];
64-
// var rotation = Math.atan2(dy, dx);
65-
// // arrows
66-
// styles.push(new ol.style.Style({
67-
// geometry: new ol.geom.Point(end),
68-
// image: new ol.style.Icon({
69-
// src: 'images/arrow-black.png',
70-
// anchor: [1.5, 0.5],
71-
// rotateWithView: false,
72-
// rotation: -rotation
73-
// })
74-
// }));
75-
// });
61+
geometry.forEachSegment(function(start, end) {
62+
var dx = end[0] - start[0];
63+
var dy = end[1] - start[1];
64+
var rotation = Math.atan2(dy, dx);
65+
// arrows
66+
styles.push(new ol.style.Style({
67+
geometry: new ol.geom.Point(end),
68+
image: new ol.style.Icon({
69+
src: 'images/arrow-black.png',
70+
anchor: [1.5, 0.5],
71+
rotateWithView: false,
72+
rotation: -rotation
73+
})
74+
}));
75+
});
7676

7777
return styles;
7878
};

0 commit comments

Comments
 (0)