ajones05 / seearound.me-ionic

0 stars 0 forks source link

Redo search #234

Closed ajones05 closed 7 years ago

ajones05 commented 7 years ago

Doesn't seem to work as expected. If I expand the area, for example, then it should show the top posts in the new, bigger area. But sometimes it shows fewer or even no posts. For example:

  1. Original posts that were loaded, then I zoomed out img_5573

  2. Then I tried to "redo search" but it says there are no posts img_5574

It also seems to treat the map movement as a search, but really it should just refresh the top posts in the new area (it should not have the cancel (x) in the search bar).

abdulhafeez commented 7 years ago

OK, I think I did not understand the requirement. I was searching in the old 1.6 km radius around new center. I think what you mean is, search in the new radius, not around new center. I'll fix it.

ajones05 commented 7 years ago

Yes, the idea was to remove the circle and change the posts shown to those within the map area visible on the screen.

abdulhafeez commented 7 years ago

@yuriyua It seems here is some work for you. The concept has changed. The mobile/request-nearest API for example was taking lat, long of the center and the radius (radious) params to find posts in the circle defined by these params and return them. Now, we need to find the posts in a rectangle defined by the screen bounds. I can give you North-East and Soth-West points as params. Can you change the APIs to find posts defined by the rectangle defined by these two points, instead of circle?

We'll basically change params radious, latitude, longitude to north-east-lat, north-east-lng, south-west-lat and south-west-lng on all APIs that return posts.

yuriyua commented 7 years ago

@abdulhafeez We can do it by these two points. I will start work on these updates.

abdulhafeez commented 7 years ago

Thank you!

yuriyua commented 7 years ago

done

Filters example https://www.seearound.me/admin/mobile-api/request-nearest/token/LS9P9Q2YVCGBPAFPP2D84MKY2ICR5QCQIMGTDHSAXALLL4BC5QK9D67FQI8VBKMX/ne/37.831125,-122.298286/sw/37.831125,-122.298286/submit

API updates https://github.com/ajones05/seearound.me/wiki/Mobile-Api-Reference/_compare/117578bba9220526c8b67cf3a2340d68695595dc...cc36c47bc3f4e02b6a1556d98eec7815c18d7562

@abdulhafeez Please test and make feedback.

abdulhafeez commented 7 years ago

One question: If I do not send ne and sw, but only send the center, will it return posts in some default area?

ajones05 commented 7 years ago

Yes, let's leave the default map area (when loading the first time, or when user hits center button) the same as it was before, just without the circle

abdulhafeez commented 7 years ago

The changes seem to be working fine now.

ajones05 commented 7 years ago

If I zoom or change area, and then "redo search" it still does not use the visible map area to refresh the posts shown. For example, in one case it might load many posts outside the area, which I can only see if I zoom back out.

The refresh should show only posts within the map area that is visible at the time the "redo search" button is tapped.

Let me know if more detail, screenshots, or a screen video would help.

abdulhafeez commented 7 years ago

I have confirmed that 'ne' and 'sw' values are picked fine when the map stops (idle event) after any kind of movement. I also noted that the APIs are not returning posts in the correct area. When we zoom in, the ne and sw values are right but the API gives posts out of this area. So, I think it is server side issue. @yuriyua

ajones05 commented 7 years ago

Note: Before, when only posts in the circle were loaded, it didn't matter how zoomed in/out the map was. But now zoom matters as much as location and it seems maybe that is the reason for the issue.

yuriyua commented 7 years ago

@abdulhafeez I cannot rise the issue https://github.com/ajones05/seearound.me-ionic/issues/234#issuecomment-320353632 I added rectangle to map (https://github.com/ajones05/seearound.me/commit/a8195d55dbd811c904a7a36e7da59153768c1b3d) for debug posts location:

https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/15/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/30/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/45/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/60/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/75/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/90/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/105/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/120/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/135/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/135/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/150/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/165/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/180/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/195/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/210/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/225/submit https://www.seearound.me/admin/mobile-api/request-nearest/token/VP5DFDRFAFTDZ5F6ZIT2F249Q3MXXI3S988QM27YG3CF7SL7DF8TGC59ER7CBA7L/ne/37.81672609575876,-122.2618345263977/sw/37.79075309157979,-122.28042727514651/start/240/submit ...

Could you send me request and response example, please?

ajones05 commented 7 years ago

@yuriyua Here's a video showing how it does not load the top posts in an area: https://www.dropbox.com/s/bbx1t3irvwdh1ye/loading%20posts%20area.mp4?dl=0

abdulhafeez commented 7 years ago

@yuriyua Here is an example of request and response. I zoomed to an area where it should have only one post but the response gives whole 15 posts, 14 of which are out of the given area: redo search screenshot 2017-08-07 21 26 15

The api was mobile/myposts

yuriyua commented 7 years ago

Sorry, I was applied my changes just for mobile/request-nearest API. Let me apply changes to mobile/myposts.

yuriyua commented 7 years ago

done

https://github.com/ajones05/seearound.me/wiki/Mobile-Api-Reference/_compare/cc36c47bc3f4e02b6a1556d98eec7815c18d7562...8aefc316130372f61b49ba2fa515f362e2d097fc

https://www.seearound.me/admin/mobile-api/myposts/token/ZLDSPAT9VHRVNLRQV2DZTNDEGYL3V42TPFNFRIPM3HIR6BI2DZ28NFN6DB8AEA66/ne/37.805741,-122.269452/sw/37.800401,-122.278539/submit

abdulhafeez commented 7 years ago

Thanks! Seems to be working fine now.

ajones05 commented 7 years ago

Thanks, much better. I noticed three issues, though:

  1. When I first open the app, nothing loads. I have to move it and "redo search" before it loads posts.

  2. If I move it and redo search a few times, it will show "loading posts..." and never finish loading (so I have to close the app and re-open it). There seems to be some issue. Normally on the third or fourth time I try to "redo search" it happens, so it happens pretty quickly and regularly. (I've tried on fast wifi at different locations, so it's not a slow connection issue) image

  3. It seems to load posts from the map area behind the top navigation bar, so it will still load posts that I can't see in that area. Ideally the area where posts are loaded would be just the visible map area.

abdulhafeez commented 7 years ago
  1. Fixed
  2. Fixed
  3. Fixed. However, the posts that lie very close to top edge will still hide behind the top bar as only the tip will be within the map. If I move the map down, there will be a gap between the map and the top bar which doesn't look good off course.
ajones05 commented 7 years ago

Thanks, that's fine and understandable about 3.