After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762303 - Add markers to map view when rendering the print layout
Add markers to map view when rendering the print layout
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: map view
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2016-02-19 06:09 UTC by amisha
Modified: 2016-02-25 19:17 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20


Attachments
mapMarker: Enable use without mapView (2.31 KB, patch)
2016-02-24 08:47 UTC, Jonas Danielsson
none Details | Review
printLayout: Add markers to route (5.59 KB, patch)
2016-02-24 08:47 UTC, Jonas Danielsson
none Details | Review
instructionRow: Add property for colored icons (1.33 KB, patch)
2016-02-24 08:47 UTC, Jonas Danielsson
none Details | Review
printLayout: Use red marker icons in instrutionRow (908 bytes, patch)
2016-02-24 08:47 UTC, Jonas Danielsson
none Details | Review
Cast of markers (544.21 KB, video/webm)
2016-02-24 08:50 UTC, Jonas Danielsson
  Details
mapMarker: Enable use without mapView (2.31 KB, patch)
2016-02-24 18:04 UTC, Jonas Danielsson
none Details | Review
printLayout: Add markers to route (5.59 KB, patch)
2016-02-24 18:05 UTC, Jonas Danielsson
none Details | Review
instructionRow: Add property for colored icons (1.32 KB, patch)
2016-02-24 18:05 UTC, Jonas Danielsson
none Details | Review
printLayout: Use red marker icons in instrutionRow (907 bytes, patch)
2016-02-24 18:05 UTC, Jonas Danielsson
none Details | Review
longPrintLayout: Add via points (2.03 KB, patch)
2016-02-24 18:05 UTC, Jonas Danielsson
none Details | Review
Cast of markers with via points (912.42 KB, video/webm)
2016-02-24 18:10 UTC, Jonas Danielsson
  Details
longPrintLayout: Add via points (3.67 KB, patch)
2016-02-24 19:46 UTC, Jonas Danielsson
none Details | Review
mapMarker: Enable use without mapView (2.31 KB, patch)
2016-02-25 08:52 UTC, Jonas Danielsson
committed Details | Review
printLayout: Add markers to route (5.59 KB, patch)
2016-02-25 08:52 UTC, Jonas Danielsson
committed Details | Review
instructionRow: Add property for colored icons (1.66 KB, patch)
2016-02-25 08:52 UTC, Jonas Danielsson
committed Details | Review
printLayout: Use red marker icons in instrutionRow (907 bytes, patch)
2016-02-25 08:52 UTC, Jonas Danielsson
committed Details | Review
longPrintLayout: Add via points (4.96 KB, patch)
2016-02-25 08:52 UTC, Jonas Danielsson
committed Details | Review

Description amisha 2016-02-19 06:09:41 UTC
As shown in mockup : https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/print-map.png, start, via and end point markers are to be added to mapview while rendering the print layout.
Comment 1 Jonas Danielsson 2016-02-24 08:47:44 UTC
Created attachment 322212 [details] [review]
mapMarker: Enable use without mapView
Comment 2 Jonas Danielsson 2016-02-24 08:47:49 UTC
Created attachment 322213 [details] [review]
printLayout: Add markers to route
Comment 3 Jonas Danielsson 2016-02-24 08:47:54 UTC
Created attachment 322214 [details] [review]
instructionRow: Add property for colored icons
Comment 4 Jonas Danielsson 2016-02-24 08:47:58 UTC
Created attachment 322215 [details] [review]
printLayout: Use red marker icons in instrutionRow
Comment 5 Jonas Danielsson 2016-02-24 08:50:13 UTC
Created attachment 322216 [details]
Cast of markers
Comment 6 amisha 2016-02-24 17:27:17 UTC
Review of attachment 322214 [details] [review]:

Thanks Jonas. This looks really great. Just a query, when we are adding via points markers too on the mapview and instruction row, i feel like we should add minimaps for via points too. Because there can be a requirement by user to move around in that complex area.

::: src/instructionRow.js
@@ +46,3 @@
+        if (!this._iconColor) {
+            this._directionImage.icon_name = this.turnPoint.iconName;
+        } else {

Can't this be like 
if (this._iconColor) {
I mean just to make it look little straight forward.
Comment 7 Jonas Danielsson 2016-02-24 17:29:34 UTC
Review of attachment 322214 [details] [review]:

Thanks for review!

Yes I agree we want via point miniMaps as well, do you think we should add this in this bug as well?

::: src/instructionRow.js
@@ +46,3 @@
+        if (!this._iconColor) {
+            this._directionImage.icon_name = this.turnPoint.iconName;
+        } else {

You mean switch the cases? Sure.
Comment 8 amisha 2016-02-24 17:38:14 UTC
Review of attachment 322215 [details] [review]:

::: src/printLayout.js
@@ +208,3 @@
             visible: true,
+            turnPoint: turnPoint,
+            iconColor: turnPoint.isStop()

I think the property should be colorIcon , because this name tells that it is a bool value,and iconColor feels like refering to color of icon.What say?
Comment 9 Jonas Danielsson 2016-02-24 17:39:24 UTC
Review of attachment 322215 [details] [review]:

::: src/printLayout.js
@@ +208,3 @@
             visible: true,
+            turnPoint: turnPoint,
+            iconColor: turnPoint.isStop()

Yeah you are right... maybe hasColor?
Comment 10 amisha 2016-02-24 17:42:55 UTC
Review of attachment 322215 [details] [review]:

::: src/printLayout.js
@@ +208,3 @@
             visible: true,
+            turnPoint: turnPoint,
+            iconColor: turnPoint.isStop()

Yeah, hasColor sounds good.
Comment 11 amisha 2016-02-24 17:48:56 UTC
Review of attachment 322214 [details] [review]:

I think we should handle that one in separate ticket. I will report one. But before that, would like to work on smarter split of instructions i.e. associating minimaps with instructions.
Comment 12 Jonas Danielsson 2016-02-24 18:04:53 UTC
Created attachment 322263 [details] [review]
mapMarker: Enable use without mapView
Comment 13 Jonas Danielsson 2016-02-24 18:05:09 UTC
Created attachment 322264 [details] [review]
printLayout: Add markers to route
Comment 14 Jonas Danielsson 2016-02-24 18:05:15 UTC
Created attachment 322265 [details] [review]
instructionRow: Add property for colored icons
Comment 15 Jonas Danielsson 2016-02-24 18:05:21 UTC
Created attachment 322266 [details] [review]
printLayout: Use red marker icons in instrutionRow
Comment 16 Jonas Danielsson 2016-02-24 18:05:27 UTC
Created attachment 322267 [details] [review]
longPrintLayout: Add via points
Comment 17 Jonas Danielsson 2016-02-24 18:10:48 UTC
Created attachment 322268 [details]
Cast of markers with via points
Comment 18 amisha 2016-02-24 18:24:01 UTC
Review of attachment 322267 [details] [review]:

::: src/longPrintLayout.js
@@ +95,3 @@
+                let viaPoints = this._createTurnPointArray(firstViaPoint,
+                                                           ++index);
+                this._cursorX = tmpX;

How about adding few instructions before the via point and few ones after the via point. Just a thought.
Comment 19 Jonas Danielsson 2016-02-24 19:46:35 UTC
Created attachment 322279 [details] [review]
longPrintLayout: Add via points
Comment 20 Hashem Nasarat 2016-02-24 22:51:47 UTC
Review of attachment 322263 [details] [review]:

::: src/mapMarker.js
@@ +60,3 @@
         this.connect('notify::size', this._translateMarkerPosition.bind(this));
+        if (this._mapView) {
+            this._view = this._mapView.view;

Setting this._view in here would appear to break _positionBubble() when this._view is undefined.
Comment 21 Hashem Nasarat 2016-02-25 04:36:49 UTC
Review of attachment 322265 [details] [review]:

Small suggestion

::: src/instructionRow.js
@@ +44,3 @@
         this._instructionLabel.label = this.turnPoint.instruction;
+
+        if (this._hasColor) {

I have no idea how this works. Could you add a comment here?
Comment 22 Hashem Nasarat 2016-02-25 04:44:25 UTC
Review of attachment 322266 [details] [review]:

Looks good
Comment 23 Hashem Nasarat 2016-02-25 04:45:42 UTC
Review of attachment 322264 [details] [review]:

Looks good.

::: src/printLayout.js
@@ +125,3 @@
         dy = mapViewHeight + mapViewMargin;
         this._adjustPage(dy);
+        let turnPointsLength = this._route.turnPoints.length;

I wish you did a rename in a separate commit, but this is fine.
Comment 24 Hashem Nasarat 2016-02-25 04:50:59 UTC
Review of attachment 322263 [details] [review]:

Small issue maybe?
Comment 25 Hashem Nasarat 2016-02-25 05:39:46 UTC
Review of attachment 322279 [details] [review]:

OK

::: src/longPrintLayout.js
@@ +81,3 @@
         /* x-cursor is increased temporarily for rendering instructions */
         let tmpX = this._cursorX;
+        for (let index = 0; index < this._route.turnPoints.length; index++) {

"i" instead of "index" would be more common.

@@ +94,3 @@
+                let tmpY = this._cursorY;
+                first = Math.max(0, index + 1 - (_NUM_MINIMAPS / 2));
+                last = Math.min(index + 1 + (_NUM_MINIMAPS / 2), pointsLength);

Where is this math coming from? Are we printing 2 turns on either side of a 'via' point? More comments please.

@@ +106,3 @@
         this._cursorX = tmpX;
 
+        first = Math.max(0, pointsLength - _NUM_MINIMAPS);

so this prints the last 5 turns? I dont' know enough to understand what's happening. More comments would help me.
Comment 26 Jonas Danielsson 2016-02-25 07:57:06 UTC
Review of attachment 322263 [details] [review]:

::: src/mapMarker.js
@@ +60,3 @@
         this.connect('notify::size', this._translateMarkerPosition.bind(this));
+        if (this._mapView) {
+            this._view = this._mapView.view;

How does this manifest? this._view will never be undefined unless we are doing print.
Comment 27 Jonas Danielsson 2016-02-25 07:58:38 UTC
Review of attachment 322264 [details] [review]:

Thanks for review!

::: src/printLayout.js
@@ +125,3 @@
         dy = mapViewHeight + mapViewMargin;
         this._adjustPage(dy);
+        let turnPointsLength = this._route.turnPoints.length;

But it is here I turn the array of coordinates to an array of turnPoints, it is part of the change I feel, since we know need turnpoints to get the iconName
Comment 28 Jonas Danielsson 2016-02-25 07:59:07 UTC
Review of attachment 322265 [details] [review]:

Thanks!

::: src/instructionRow.js
@@ +44,3 @@
         this._instructionLabel.label = this.turnPoint.instruction;
+
+        if (this._hasColor) {

Yes, good idea! Spoiler alert, it has todo with the icon having -symbolic in its name!
Comment 29 Jonas Danielsson 2016-02-25 08:05:06 UTC
Review of attachment 322279 [details] [review]:

Thanks!

::: src/longPrintLayout.js
@@ +81,3 @@
         /* x-cursor is increased temporarily for rendering instructions */
         let tmpX = this._cursorX;
+        for (let index = 0; index < this._route.turnPoints.length; index++) {

yes, but since we use it in calculations and not just as an array index  I felt I wanted a proper name, but can rename.

@@ +94,3 @@
+                let tmpY = this._cursorY;
+                first = Math.max(0, index + 1 - (_NUM_MINIMAPS / 2));
+                last = Math.min(index + 1 + (_NUM_MINIMAPS / 2), pointsLength);

Yes, it was Amishas suggestions from previous review, that for start points we show the NUM_MINIMAP from start, for END we show the NUM_MINIMAP leading towards end. And for via we show NUM_MINIMAP/2 before and after via.

@@ +106,3 @@
         this._cursorX = tmpX;
 
+        first = Math.max(0, pointsLength - _NUM_MINIMAPS);

Yes, exactly. Will provide a comment above all this to explain.
Comment 30 Jonas Danielsson 2016-02-25 08:52:13 UTC
Created attachment 322338 [details] [review]
mapMarker: Enable use without mapView
Comment 31 Jonas Danielsson 2016-02-25 08:52:18 UTC
Created attachment 322339 [details] [review]
printLayout: Add markers to route
Comment 32 Jonas Danielsson 2016-02-25 08:52:25 UTC
Created attachment 322340 [details] [review]
instructionRow: Add property for colored icons
Comment 33 Jonas Danielsson 2016-02-25 08:52:31 UTC
Created attachment 322341 [details] [review]
printLayout: Use red marker icons in instrutionRow
Comment 34 Jonas Danielsson 2016-02-25 08:52:37 UTC
Created attachment 322342 [details] [review]
longPrintLayout: Add via points
Comment 35 Hashem Nasarat 2016-02-25 18:45:10 UTC
Review of attachment 322342 [details] [review]:

Looks good. But this adds whitespace errors (at end of line). View with git show --check.
Comment 36 Hashem Nasarat 2016-02-25 18:45:13 UTC
Review of attachment 322342 [details] [review]:

Looks good. But this adds whitespace errors (at end of line). View with git show --check.
Comment 37 Hashem Nasarat 2016-02-25 18:46:07 UTC
Review of attachment 322264 [details] [review]:

::: src/printLayout.js
@@ +125,3 @@
         dy = mapViewHeight + mapViewMargin;
         this._adjustPage(dy);
+        let turnPointsLength = this._route.turnPoints.length;

OK
Comment 38 Hashem Nasarat 2016-02-25 18:47:15 UTC
Review of attachment 322263 [details] [review]:

OK

::: src/mapMarker.js
@@ +60,3 @@
         this.connect('notify::size', this._translateMarkerPosition.bind(this));
+        if (this._mapView) {
+            this._view = this._mapView.view;

I suppose it won't, it just seems like something that could easily be broken or overlooked in a refactor. It's fine for now though thanks.
Comment 39 Hashem Nasarat 2016-02-25 18:53:51 UTC
Review of attachment 322338 [details] [review]:

OK
Comment 40 Hashem Nasarat 2016-02-25 18:54:13 UTC
Review of attachment 322339 [details] [review]:

Nice!
Comment 41 Hashem Nasarat 2016-02-25 18:54:25 UTC
Review of attachment 322340 [details] [review]:

Nice!
Comment 42 Hashem Nasarat 2016-02-25 18:54:33 UTC
Review of attachment 322341 [details] [review]:

Nice!
Comment 43 Jonas Danielsson 2016-02-25 19:17:21 UTC
Attachment 322338 [details] pushed as 62604db - mapMarker: Enable use without mapView
Attachment 322339 [details] pushed as b8dfaab - printLayout: Add markers to route
Attachment 322340 [details] pushed as 2dc4d8e - instructionRow: Add property for colored icons
Attachment 322341 [details] pushed as 0e70d4a - printLayout: Use red marker icons in instrutionRow
Attachment 322342 [details] pushed as 0273c83 - longPrintLayout: Add via points