Closed ajones05 closed 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.
Yes, the idea was to remove the circle and change the posts shown to those within the map area visible on the screen.
@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.
@abdulhafeez We can do it by these two points. I will start work on these updates.
Thank you!
done
@abdulhafeez Please test and make feedback.
One question: If I do not send ne and sw, but only send the center, will it return posts in some default area?
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
The changes seem to be working fine now.
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.
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
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.
@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?
@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
@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:
The api was mobile/myposts
Sorry, I was applied my changes just for mobile/request-nearest API. Let me apply changes to mobile/myposts.
done
Thanks! Seems to be working fine now.
Thanks, much better. I noticed three issues, though:
When I first open the app, nothing loads. I have to move it and "redo search" before it loads posts.
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)
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.
Thanks, that's fine and understandable about 3.
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:
Original posts that were loaded, then I zoomed out![img_5573](https://user-images.githubusercontent.com/10637288/28425102-30dc2116-6d24-11e7-9312-8dd45658d1df.PNG)
Then I tried to "redo search" but it says there are no posts![img_5574](https://user-images.githubusercontent.com/10637288/28425116-3a8e8d52-6d24-11e7-83d5-32943eb76696.PNG)
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).