owncloud-archive / maps

:globe_with_meridians: Maps app for ownCloud
GNU Affero General Public License v3.0
42 stars 20 forks source link

Search does not automatically zoom on best result #38

Closed poVoq closed 8 years ago

poVoq commented 9 years ago

If I search there seems to be a marker placed at possible search results, but I would like the map to automatically pan and zoom to the best guess result, and maybe list a set of other possible results in the side bar.

Thanks!

v1r0x commented 9 years ago

I implemented this right now. But my problem is, that if the user searches for "berlin" they automatically get the city Berlin as result and the map pans to this result (which is what you want I think, and I want, too). Since it is possible to search for contacts as well, this should also load all contacts with an address in berlin. So where should the map pan to? The city or one of the contacts? I don't know which would be best. Maybe @jancborchardt has an idea?

cc @DJaeger @Henni @brantje

poVoq commented 9 years ago

Displaying the city seems like a reasonable default behavior. Maybe some check boxes under the search field to limit the search to contacts only, or to exclude contacts (other ideas?) would make sense?

jancborchardt commented 9 years ago

Yep, the city should be centered. No checkboxes or additional settings for now, as when the city is centered all Contacts should be in view anyway.

DJaeger commented 8 years ago

I think it should not center anything until a result is chosen.

jancborchardt commented 8 years ago

@DJaeger it should definitely zoom/center on the set of results, so it’s easier to choose a specific result.

DJaeger commented 8 years ago

@jancborchardt: Mhm, you are right. That would realy make the choose easier.

DJaeger commented 8 years ago

But what, if I start typing the name of a contact and not an address? Then the results could be more widely spreaded than one single city. Shouldn't we choose a BBOX spanning all currently shown results? Or we always zoom and center on only the first result while typing and on hovering/focusing another one, center and zoom to only that one.

jancborchardt commented 8 years ago

@DJaeger I’d say BBOX is a good first approach which solves the problem in a general way. We can think about zooming into the best/first result automatically later.

v1r0x commented 8 years ago

So, If I search for "berlin" and have a contact named "Something Berlin" located in Paris, it should center to a BBOX from Paris to Berlin?

Henni commented 8 years ago

@v1r0x yes, that's how I would solve this for now.

v1r0x commented 8 years ago

@Henni Ok, I will move the regarding code to my test environment and try to solve it.

jancborchardt commented 8 years ago

Yeah, we definitely need to fix this in a better way in the future as there will be lots of »Berliner Straße« as well. We can also experiment with always focusing on the best result, but a good first pass is the BBOX.

v1r0x commented 8 years ago

Maybe waiting for the user to choose a result and pan to the selected result whould be the easiest (same as in g maps)

DJaeger commented 8 years ago

I second the solution of @v1r0x. I think OSM is doing it also.

jancborchardt commented 8 years ago

In Google Maps, pressing enter after putting in a search term chooses the first (best) result and zooms to it. That seems good.

@DJaeger I wouldn’t necessarily use OSM as a good example since they do lots of things quite badly. ;) We can improve on that.

DJaeger commented 8 years ago

But we can mention OSM if they do it the same way like G to confirm a "well known behaviour". ;-) I think OSM has become much better in the last few years and is now in general also usable by the mainstream users.

jancborchardt commented 8 years ago

This bites me again and again, thinking search is broken. ;) @v1r0x you said you implemented something here, can you maybe just put up a work-in-progress pull request of this? :)

v1r0x commented 8 years ago

There is a really messed up branch in my fork. We can have a look at it here and discuss what we want and what we don't want so we can start a proper and clean branch here. Thus we can fix this one and #21 as well.