-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
三層 zoom in level 有不同的 cluster,取消隨機顯示 pin #121
Comments
Part of the reason is our API says:
when we zoom out really far. So we could I guess check if range goes above that, set a flag to, when it goes back below it, reset the list to the new region? |
Hm actually if you zoom in and wait it does reset the request, it just takes a while. I wonder if we could have some server-side clustering, even just a simple .count() query when range > 100? |
The original range setting limit was to load the webpage faster. Another
related setting is to show some random pins first while loading all pins in
the range.
I don’t know if the cluster feature already improves the loading
performance. If so, we can change the range limit and random display while
loading.
|
I can try this and test. |
可能的解法,在不同的 zoom-in level 設定 cluster 的方式:
順便解除 random 顯示 100 個工廠,然後移動地圖時會有新工廠冒出來讓使用者很困惑的問題。 |
related to |
Frontend tasks
⬆ Sorry it's wrong. Backend task
|
Try downloading whole factory list |
Still need to have a conversation on how to download this whole list - surely we can dump the DB from the production deployment? Back it up, basically? |
Just realized I misinterpreted ael's issue. 😓 We need to implement:
For the last two layers, we need another API to map district/county name to location. |
https://docs.google.com/spreadsheets/d/1wCLyRF1szd1p3_4N09k9W_dL9l84xFFXuT22Xwa6qdg/edit?usp=sharing @komali2 Here's the location data of each district/county/city |
https://staging.disfactory.tw/api/factories?lng=121.44787073135184&lat=25.07&range=10 Now returns 145 factories, and https://staging.disfactory.tw/api/factories?lng=121.44787073135184&lat=25.07&range=11 will be limited to 50 |
@DoraLyn20 , one of our designers, drew a mockup and brought up an issue that users may not know they can upload photos to report a factory. She may work on the redesign for that. |
Wow that looks sick. I'm finally back from huandao so can start working on this again! |
Design updated at Figma here. |
Oh perfect, thank you!!! |
https://github.com/g0v/twgeojson - geoJSON format If we are only displaying admin boundaries 縣市 when zoomed out, we can use a simplified static topoJSON file and color it dynamically. This won't work however if we need to display them in fine detail when zoomed in |
@bdon Could you elaborate more on the limitation when zoomed in? |
Limitation on zoom in should not be issue. original TopoJSON including all 縣市/區 is small enough (<300kb uncompressed) however, statistics API should return one list of all 區. If front-end is interested in 縣市 instead, it can do sum logic on frontend. [
{
"district": "萬里區",
"county": "新北市",
"factories": 0,
"report_records": 0,
"documents": 0,
"未處理": 0,
"處理中": 0,
"已斷電": 0,
"已拆除": 0
},
{
"district": "新店區",
"county": "新北市",
"factories": 0,
"report_records": 0,
"documents": 0,
"未處理": 0,
"處理中": 0,
"已斷電": 0,
"已拆除": 0
}
] |
a341cce has basic implementation however
|
Problem Another reasons may be the data from government sources. There are couples of coordinates only 0.5 cm apart, which our current algorithm would definitely cluster those records into one. Describe the solution you'd like |
@aelcenganda This issue was solved in #153 (not yet delivered to production) |
@bdon In the discussion today, we decide to build statistic layers only for the city/county(縣市), not at the district level. So the new 3 zoom-in levels would be:
|
現在 cluster分三層
|
Is your feature request related to a problem? Please describe.
目前打開一個地點的時候,之前因為效率問題,會只先 load 一定距離內的工廠。所以使用者如果 zoom out,就會看起來台灣其他地區沒有工廠。
Describe the solution you'd like
不知道現在做的 cluster 之後,可以顯示全台灣 cluster 後的工廠數量嗎?
可能的解法,在不同的 zoom-in level 設定 cluster 的方式:
(以上這兩個已經有 API 給 about page 了)
順便解除 random 顯示 100 個工廠,然後移動地圖時會有新工廠冒出來讓使用者很困惑的問題。
(當初只顯示 100 個是因為 performance 和太擠了)
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: