openreferral / ServiceNet

7 stars 6 forks source link

Map view mapping to different silos #1604

Open EnriqueCorado opened 3 years ago

EnriqueCorado commented 3 years ago

As a user I want to load my map based on the silo that I am in. Not always load the map ping static to the bay area as it currently stands

Description: center the map on SP and public view depending on the user's silo

Load map view based on silo e.g. bay area silo load bay area on map view (like it currently stands)

dev: please advice if you think another approach may be easier Possible solution:

SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY GR.latitude), percentile_cont(0.5) WITHIN GROUP (ORDER BY GR.longitude) FROM geocoding_result GR, location_geocoding_results LGR, location L, organization O, silo_organizations SO WHERE SO.silo_id = 'fa9b0a3c-c73a-41d6-818a-de26244b85da' and O.id = SO.organization_id and L.organization_id = O.id and LGR.location_id = L.id and LGR.geocoding_results_id = GR.id

another approach John - check out my percentile approach. If we try this we can kinda ignore specific silos entirely. I also dont know if google maps API has something similar of 'fitting' the view to the pins

Question dev: if the above solution is the best solution do we load the map with center at x,y and radius of 20mi to encompass many CBO pings? or a greater number of miles?

Scope (includes UI mockups, user flow, and out of scope):

Acceptance criteria (includes edge cases):

Dependencies (links to other related tasks): *#1351 it was previously tasked to center map on san Francisco. However, this was before we had different active silos

Any required analytics for task: *

Dev Signoffs

QA Signoffs

Product Signoff

jkondrat commented 3 years ago

@EnriqueCorado should we center the map on public view only, or would we do that depending on the user's silo too?

EnriqueCorado commented 3 years ago

@jkondrat

johnhbenetech commented 3 years ago

@jkondrat check out my percentile approach. If we try this we can kinda ignore specific silos entirely.

I also dont know if google maps API has something similar of 'fitting' the view to the pins

johnhbenetech commented 3 years ago

also @jkondrat if you use the percentile approach it occurred to me that my SQL wouldn't include records created by ServiceProviders - so youll need to include those in addition to silo_organizations records

jkondrat commented 3 years ago

@johnhbenetech is it okay to initially get X closest records to this percentile point? I think we then could fit the map to these pins instead of centering it at that exact point.

johnhbenetech commented 3 years ago

@jkondrat yes thats fine

abaranowska1 commented 3 years ago

@jkondrat During testing, I encountered an issue that after the second click "map view" button the user saw a different map, we were moved to the SanFrancisco view. Peek 2021-02-11 11-16

abaranowska1 commented 3 years ago

Tested with success Now in different silos, the map is center appropriately in order to ensure and avoid user confusion as to where the map loads. Selection_999(074) Selection_999(073) Selection_999(072) Selection_999(071)