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 736326 - BoundingBox for userlocation
BoundingBox for userlocation
Status: RESOLVED OBSOLETE
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-09 12:47 UTC by Jonas Danielsson
Modified: 2018-03-26 12:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
userLocationMarker: Add bounding box (3.48 KB, patch)
2014-09-09 12:48 UTC, Jonas Danielsson
reviewed Details | Review
[RFC] mapWalker: more aggresive zoomToFit (1.70 KB, patch)
2014-09-09 12:50 UTC, Jonas Danielsson
reviewed Details | Review
Screenshot with patches (862.03 KB, image/png)
2014-09-09 17:25 UTC, Zeeshan Ali
  Details
userLocationMarker: Add bounding box (3.51 KB, patch)
2014-09-10 17:39 UTC, Jonas Danielsson
none Details | Review
userLocationMarker: Add bounding box (3.51 KB, patch)
2014-09-11 18:34 UTC, Jonas Danielsson
none Details | Review

Description Jonas Danielsson 2014-09-09 12:47:28 UTC
We have a circle to visualize the accuracy of the current location, but no bounding box that can help with the zoom level when going there.
Comment 1 Jonas Danielsson 2014-09-09 12:48:25 UTC
Created attachment 285734 [details] [review]
userLocationMarker: Add bounding box
Comment 2 Jonas Danielsson 2014-09-09 12:50:26 UTC
Created attachment 285735 [details] [review]
[RFC] mapWalker: more aggresive zoomToFit

Right now the zoomToFit function does not really work. It tries to find the correct zoom level where the bounding box is visible. But it cannot really and the result will vary depending on the lat/lon you start from.

It does not now where the bounding box center will be at the zoom level it tries to get bounding box for. Sort of.


So this patch simplifies, maybe to much, Try it out and see if you like it.
Comment 3 Zeeshan Ali 2014-09-09 17:25:43 UTC
Created attachment 285759 [details]
Screenshot with patches

This is what I see at launch with these patches in.
Comment 4 Mattias Bengtsson 2014-09-10 10:38:49 UTC
Review of attachment 285734 [details] [review]:

Good!

::: src/userLocationMarker.js
@@ +79,3 @@
+            right: this._view.x_to_longitude(x + radius)
+        });
+    },

These two properties are non-trivial and does a bunch of calculations. They should probably be functions instead?
Comment 5 Mattias Bengtsson 2014-09-10 10:41:28 UTC
Review of attachment 285735 [details] [review]:

Looks good to me.
Comment 6 Jonas Danielsson 2014-09-10 17:39:29 UTC
Created attachment 285843 [details] [review]
userLocationMarker: Add bounding box
Comment 7 Damián Nohales 2014-09-11 15:24:46 UTC
Review of attachment 285843 [details] [review]:

Otherwise, looks good to me.

::: src/userLocationMarker.js
@@ +58,3 @@
     },
 
+    _getRadius: function() {

get radius?

@@ +68,3 @@
+    },
+
+    _getBoundingBox: function() {

get boundingBox?

@@ +112,3 @@
             }).bind(this));
+
+            this.place.bounding_box = this._accuracyMarker.getBoundingBox();

It looks like the code is broken here, isn't the method called _getBoundingBox (with underscore), I'd go for the getter syntax anyways.
Comment 8 Damián Nohales 2014-09-11 15:31:55 UTC
Review of attachment 285735 [details] [review]:

Looks good to me too, but now I don't understand why we didn't used ensure_visible before xD
Comment 9 Damián Nohales 2014-09-11 15:33:17 UTC
Review of attachment 285735 [details] [review]:

It seems that _boxCover method is not used anymore after this change.
Comment 10 Jonas Danielsson 2014-09-11 18:11:57 UTC
Review of attachment 285735 [details] [review]:

Well, ensureVisible only ensures visibility so if we are zoom out it does nothing. This sets the zoom-level to max every time and then goes ensureVisible. It is a bit extreme.

And yeah _boxCover can go away and I think all the things about place_type as well. Not much does not have a boundingbox and we could set a default zoom-level for them.
Comment 11 Jonas Danielsson 2014-09-11 18:13:03 UTC
Review of attachment 285843 [details] [review]:

::: src/userLocationMarker.js
@@ +68,3 @@
+    },
+
+    _getBoundingBox: function() {

Well I had them as getters before. But Mattias in his review pointed out that they do quite some calculation and are non-trivial. There are more functions than properties and I tend to agree.

@@ +112,3 @@
             }).bind(this));
+
+            this.place.bounding_box = this._accuracyMarker.getBoundingBox();

Yeah typo.
Comment 12 Jonas Danielsson 2014-09-11 18:34:21 UTC
Created attachment 285944 [details] [review]
userLocationMarker: Add bounding box
Comment 13 GNOME Infrastructure Team 2018-03-26 12:41:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-maps/issues/14.