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 736111 - Make sure the default transportation mode gets notified.
Make sure the default transportation mode gets notified.
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-05 10:12 UTC by Jonas Danielsson
Modified: 2014-09-05 18:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
routeQuery: Notify transportation on reset (1.09 KB, patch)
2014-09-05 10:13 UTC, Jonas Danielsson
needs-work Details | Review
routeQuery: Notify transportation on reset (1.77 KB, patch)
2014-09-05 18:15 UTC, Jonas Danielsson
committed Details | Review

Description Jonas Danielsson 2014-09-05 10:12:52 UTC
I did a route search on a common walking path in my town. It's ~1km and the estimated time was 1 min.

This felt weird. And when digging I noticed that the search was done with transportation = CAR. Even tho the default setting of the mode chooser is PEDESTRIAN.

This is because there is no notification from when the transportation mode gets reset. Which also happens at init.
Comment 1 Jonas Danielsson 2014-09-05 10:13:16 UTC
Created attachment 285467 [details] [review]
routeQuery: Notify transportation on reset
Comment 2 Damián Nohales 2014-09-05 16:14:10 UTC
Review of attachment 285467 [details] [review]:

Nice catch!

Actually, most maps applications use the Car mode by default for routing (Bing Maps and Apple Maps at least, latest versions of Google Maps select the best transportation mode depending on the route, older versions used Car), I think we need to use CAR by default too.

Also this patch won't work for the FIRST sidebar reveal, I was trying it and changed the default mode to CAR and the active button on first reveal was PEDESTRIAN, this is because the first query reset is done before initializing the sidebar, I think we need to reset the query on Sidebar::_init or manually call the query.connect('notify::transportation') transportation callback in Sidebar::_initTransportationToggles, or re-hardcode the default active button if you agree that CAR mode should be the default.

::: src/routeQuery.js
@@ +43,3 @@
 };
 
+const DefaultTransportation = Transportation.PEDESTRIAN;

Isn't this constant too much? (also, shouldn't be DEFAULT_TRANSPORTATION?)
Comment 3 Zeeshan Ali 2014-09-05 17:55:46 UTC
(In reply to comment #2)
> Review of attachment 285467 [details] [review]:
> 
> Nice catch!
> 
> Actually, most maps applications use the Car mode by default for routing (Bing
> Maps and Apple Maps at least, latest versions of Google Maps select the best
> transportation mode depending on the route, older versions used Car), I think
> we need to use CAR by default too.

I agree. We can re-evaluate this still when we have public transportation as well.
Comment 4 Jonas Danielsson 2014-09-05 17:58:10 UTC
(In reply to comment #2)
> Review of attachment 285467 [details] [review]:
> 
> Nice catch!
> 
> Actually, most maps applications use the Car mode by default for routing (Bing
> Maps and Apple Maps at least, latest versions of Google Maps select the best
> transportation mode depending on the route, older versions used Car), I think
> we need to use CAR by default too.
> 
> Also this patch won't work for the FIRST sidebar reveal, I was trying it and
> changed the default mode to CAR and the active button on first reveal was
> PEDESTRIAN, this is because the first query reset is done before initializing
> the sidebar, I think we need to reset the query on Sidebar::_init or manually
> call the query.connect('notify::transportation') transportation callback in
> Sidebar::_initTransportationToggles, or re-hardcode the default active button
> if you agree that CAR mode should be the default.
> 
> ::: src/routeQuery.js
> @@ +43,3 @@
>  };
> 
> +const DefaultTransportation = Transportation.PEDESTRIAN;
> 
> Isn't this constant too much? (also, shouldn't be DEFAULT_TRANSPORTATION?)

Yeah agreem it could go away.
Comment 5 Jonas Danielsson 2014-09-05 17:58:49 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Review of attachment 285467 [details] [review] [details]:
> > 
> > Nice catch!
> > 
> > Actually, most maps applications use the Car mode by default for routing (Bing
> > Maps and Apple Maps at least, latest versions of Google Maps select the best
> > transportation mode depending on the route, older versions used Car), I think
> > we need to use CAR by default too.
> 
> I agree. We can re-evaluate this still when we have public transportation as
> well.

So I didn't get away with my anti car agenda :/
Comment 6 Jonas Danielsson 2014-09-05 18:15:28 UTC
Created attachment 285515 [details] [review]
routeQuery: Notify transportation on reset

Make sure that the transporation mode is notified
on init.

This fixes a bug where the sidebar showed PEDESTRIAN
as selected but the search was actually done with CAR.
Comment 7 Damián Nohales 2014-09-05 18:33:26 UTC
Review of attachment 285515 [details] [review]:

Looks good for me.
Comment 8 Jonas Danielsson 2014-09-05 18:38:01 UTC
Attachment 285515 [details] pushed as e87c688 - routeQuery: Notify transportation on reset