@@ -135,11 +135,13 @@ public final class MapillaryLayer extends MVTLayer implements ActiveLayerChangeL
135
135
/** The color scale used when drawing using velocity */
136
136
private final ColorScale velocityScale = ColorScale .createHSBScale (256 );
137
137
/** The color scale used when drawing using date */
138
- private final ColorScale dateScale = ColorScale .createFixedScale (new Color [] { ColorHelper .html2color ("e17155" ), // Really
139
- // old
140
- // color
141
- ColorHelper .html2color ("fbc01b" ), // Old color
142
- MapillaryColorScheme .SEQ_UNSELECTED // New color
138
+ private final ColorScale dateScale = ColorScale .createFixedScale (
139
+ // Really old color
140
+ new Color [] { ColorHelper .html2color ("e17155" ),
141
+ // Old color
142
+ ColorHelper .html2color ("fbc01b" ),
143
+ // New color
144
+ MapillaryColorScheme .SEQ_UNSELECTED
143
145
}).addTitle (tr ("Time" ));
144
146
145
147
/** The color scale used when drawing using direction */
@@ -189,8 +191,8 @@ private MapillaryLayer() {
189
191
private void setupColorScales () {
190
192
this .dateScale .setNoDataColor (MapillaryColorScheme .SEQ_UNSELECTED );
191
193
// ChronoUnit.YEARS isn't supported since a year can be either 365 or 366.
192
- this .dateScale .setRange (Instant .now ().minus (4 * 365L , ChronoUnit .DAYS ).toEpochMilli (),
193
- Instant .now ().toEpochMilli ());
194
+ this .dateScale .setRange (Instant .now ().minus (4 * 365L , ChronoUnit .DAYS ).getEpochSecond (),
195
+ Instant .now ().getEpochSecond ());
194
196
this .directionScale .setNoDataColor (MapillaryColorScheme .SEQ_UNSELECTED );
195
197
this .velocityScale .setNoDataColor (MapillaryColorScheme .SEQ_UNSELECTED );
196
198
}
@@ -414,7 +416,10 @@ private void drawSequence(final Graphics2D g, final MapView mv, final IWay<?> se
414
416
private Color getColor (final INode node ) {
415
417
switch (this .drawType ) {
416
418
case DATE :
417
- return this .dateScale .getColor (MapillaryImageUtils .getDate (node ).toEpochMilli ());
419
+ if (node .isTimestampEmpty ()) {
420
+ MapillaryImageUtils .getDate (node );
421
+ }
422
+ return this .dateScale .getColor (node .getRawTimestamp ());
418
423
case VELOCITY_FOOT :
419
424
case VELOCITY_BIKE :
420
425
case VELOCITY_CAR :
0 commit comments