Skip to content

Init geocoder#67

Merged
abettermap merged 18 commits intomasterfrom
geocoder
Aug 31, 2020
Merged

Init geocoder#67
abettermap merged 18 commits intomasterfrom
geocoder

Conversation

@abettermap
Copy link
Contributor

Additions

Geocoder init

Working well. @rperlin-ela let me know if it's working as you'd want/expect it to:

image

Zoom level

When you click "Manhattan" for example, is it a good extent?

image

Note that the geocoder returns a point, not a polygon from what I can tell. So it's basically the lat/lon/center concepts like we've talked about in regards to initial map extent.

Boundaries

Our MB Boundaries access does not seem to be enabled. I tried to set it up but no soup so I emailed our contact. Worst-case, if we don't get it, can we (Maya) upload a Neighborhoods tileset?. The Boundaries stuff is very new and the docs and examples are not as robust as the rest.

Zoom to current

Just a placeholder but @rperlin-ela let me know if this is still desired before I spend time on it. It will take some time and I'm not sure how much use it will get (useless if you're outside NYC metro!), plus people may be reluctant to use location (there will be the usual browser alert asking for permission, it's definitely required).

image

World Region symbol in Details

image

@rperlin-ela I started looking at Size and have some ideas but wasn't sure if that and/or Status should really be shown here given they are a bit loosely defined. Should I omit? And what about primary country? Show flag of primary country if present? Or skip?

Other

Random point when none selected

Having fun with this!

image

Omnibox style improve

Some extra contrast for the headings, easier to see:

image

Refactoring, cleanup

Just a bit.

@abettermap
Copy link
Contributor Author

@rperlin-ela
Copy link
Collaborator

rperlin-ela commented Aug 30, 2020 via email

@rperlin-ela
Copy link
Collaborator

rperlin-ela commented Aug 30, 2020 via email

@abettermap
Copy link
Contributor Author

All good points, thanks for reviewing!

Replies

and there will be highlighting of corresponding polygons to come?

Yes, for neighborhoods at a minimum, and maybe cities or whatever the non-neighborhood polygons there are, but it depends on:

(Using Boundaries? And/or our Neighborhoods tileset?)

I cc'd you on the support email to MB yesterday, just waiting to hear back about why Boundaries isn't enabled for us.

Or, for specific addresses, do we think users will expect to see some kind of pin?

Yes that would be ideal and should be easy. Questions in "Discussion" below.

To make sure the international order of linguists doesn’t boot me out, I have to ask about Unicode (non-Roman) character support in the geocoder.

Ha! Don't want to get you booted from the order, so let's see what we can do. The geocoder can indeed support(ish) languages:

image

The available languages are here. Which ones will be needed? I realize this is something to test, especially since there is limited support, so might be trial and error. I did try it with Chinese though, and pasted in your 第八大道 as a test and it seemed to work great (although my Chinese is a little rusty...):

image

I tried it with the language setting for Chinese AND English:

image

and it supports both as a search but displays the English result since that was listed first:

image

What's interesting though is that if I don't set any language, it still supports the search:

image

So if you're wanting to not just support the non-Roman search but also display the results in that language, there would need to be another dropdown/setting to select language. And if you're going to allow that, it seems awkward to only display in that language in the geocoder but not the rest of the app. 🤔

“Zoom to Current” is still of interest, but let’s focus on other things first, like the Details panel, and revisit based on time, is that ok?

Very ok! I want to make sure I cover the SOW but I've worked with Geolocation in the past and it's deceptively involved, so if the Geocode search is covering things for now then yes wait on geolocation.

For Details, I think Size or Status can be omitted.

Ok

Primary country with or without flag (should be present for all) should be shown.

To clarify "should be present for all", you mean all the countries should have flags now, correct? Not "all" as in show all the countries for that community?

Very eager to see your ability to squeeze things in and make it work, but we don’t have to go overboard.

That makes two of us. Is there anything else to show beyond what I have plus primary country and flag? And maybe an expanding popover for +4 more to show the rest?

image

The “random community” idea is great — maybe better to say “try a community at random”?

Ha yeah my version didn't sound right. How about this?

image

In terms of the text, I understand the logic, but having both “Location Search” and then “Search by place” feels a little redundant and I think “Location Search” (kind of bulky anyway) can just be taken out. “Search by place” can become “Search by location”.

Agreed, assuming we are dropping the geolocation part for now.

Then maybe "Address, Neighborhood, Postal Code, Landmark etc.”. I’m not sure what to do about “city”, so maybe just leave off?

Why leave off city?

Discussion

Behavior/lifespan of the pin or highlighted feature

How long should the pin remain (or the feature be highlighted)? In other words, how should it be clearable?

I would expect it to be cleared via the same way it was created- via the geocode search box. Currently its value does not persist after selecting a result, but I could set it up that way. So in that scenario:

  1. User searches for location
  2. Clicks a result
  3. If an address or POI, create a temporary marker then zoom the map to ________ zoom level
  4. If not, zoom to the result's bounding box (UPDATE: just learned that this is available, so there won't be a question of what zoom level should be used for polygons). If there is a neighborhood polygon beneath the bounding box, highlight the polygon.
  5. For either 3 or 4 above, the selected result will persist in the geocode search box until they clear it. Same goes for the corresponding marker or highlighted feature (larger question on that below).

For 3 above, let me know the ______ answer. Remember you can check via URL in MB Studio:

image

For 4 above, should the other neighborhoods be shown as well, just not highlighted? Basically just like the Boundaries Explorer behavior:

image

Regardless of geocoding, once we have Neighborhoods there should ideally be a toggle switch to turn them on/off. So, based on your answer to showing the non-highlighted polygons as well, if they ARE shown then what happens if the user had the Neighborhoods layer toggled off? Would clicking another geocode result force it back on?

If you're not concerned with showing any non-highlighted polygons then maybe a toggle is not needed.

Also, what happens if the clicked result is not a neighborhood? Say, Wayne NJ? If we are banking on Boundaries coming through, then should Cities be its own layer with its own toggle?

image

Or, how about this (and again 100% assuming Boundaries folks come through): a single toggle for "Show boundaries", which would cover both cities and neighborhoods? I could code it so that the neighborhoods are shown on top of the cities, otherwise NYC city boundary would obscure the neighborhoods:

image

@abettermap
Copy link
Contributor Author

@rperlin-ela that's a big one. Can Zoom later if you'd like?

@abettermap
Copy link
Contributor Author

also here's what i came up with for the geocode popover:

image

cool?

@rperlin-ela
Copy link
Collaborator

rperlin-ela commented Aug 30, 2020

The available languages are here. Which ones will be needed?

This seems to be doing the trick for major languages without any need to specify individual languages. I spot-checked Брайтон-Бич, كوينز, குயின்சு, and a few simple things. So at least something decent is up and running.

So if you're wanting to not just support the non-Roman search but also display the results in that language, there would need to be another dropdown/setting to select language. And if you're going to allow that, it seems awkward to only display in that language in the geocoder but not the rest of the app. 🤔

Good point, so this goes on the wishlist. From your end, just out of curiosity, how much work would it take to develop a Spanish or even a Chinese version of the whole site? Are there easy/medium/difficult ways of doing it? Maybe better for a Zoom call after this current push.

To clarify "should be present for all", you mean all the countries should have flags now, correct? Not "all" as in show all the countries for that community?

I just wanted sure what you meant by "if present" because all countries should have flags, I believe, and all records should at least have a primary country.

That makes two of us. Is there anything else to show beyond what I have plus primary country and flag? And maybe an expanding popover for +4 more to show the rest?

Definitely need some way to show the additional neighborhoods. If you think it's too much to squeeze in two (and in a few cases three) countries, then Primary Country is probably ok. I guess the main thing now to do with the Details panel is to fit in the videos (definitely the priority--for the good number of records that have it), audio (so far just testing one), and potentially story map (none yet). Right?

Ha yeah my version didn't sound right. How about this?

image

Great

Why leave off city?

We want to build this generically, but we don't want people to think we have this for cities other than New York. True that Yonkers and Jersey City and a few others we have records for are cities, but maybe changing to "town" would be more explicitly inclusive of the suburban cities? Not a big deal if we have "city", but maybe then "Address, City, Neighborhood, Postal Code, Landmark etc within the New York metropolitan area"?

  1. User searches for location
  2. Clicks a result
  3. If an address or POI, create a temporary marker then zoom the map to ________ zoom level
  4. If not, zoom to the result's bounding box (UPDATE: just learned that this is available, so there won't be a question of what zoom level should be used for polygons). If there is a neighborhood polygon beneath the bounding box, highlight the polygon.
  5. For either 3 or 4 above, the selected result will persist in the geocode search box until they clear it. Same goes for the corresponding marker or highlighted feature (larger question on that below).

For 3 above, let me know the ______ answer. Remember you can check via URL in MB Studio:

This sounds intuitive to me. If I understand right, at least looking on desktop, I would think maybe a zoom level like 15 to really get us close in to a point but still showing a decent amount of its surrounding area.

For 4 above, should the other neighborhoods be shown as well, just not highlighted? Basically just like the Boundaries Explorer behavior.

Regardless of geocoding, once we have Neighborhoods there should ideally be a toggle switch to turn them on/off. So, based on your answer to showing the non-highlighted polygons as well, if they ARE shown then what happens if the user had the Neighborhoods layer toggled off? Would clicking another geocode result force it back on?

Just to double-check, are we talking about our layer of Neighborhoods or the one used by Mapbox Boundaries (which I know we also requested)? Are we potentially causing headaches here if we use our own?

Doesn't seem mission-critical, but showing surrounding neigbhorhoods while highlighting the one being searched does seem nice. What you suggest in terms of forcing the Neighborhoods layer on/off to match what the user is doing could make sense, as long as it's not annoying. But if this whole question of toggling looks complicated, maybe we can skip it and just highlight the neighborhood being searched.

Or, how about this (and again 100% assuming Boundaries folks come through): a single toggle for "Show boundaries", which would cover both cities and neighborhoods? I could code it so that the neighborhoods are shown on top of the cities, otherwise NYC city boundary would obscure the neighborhoods:

This sounds like the ticket— single toggle, combine layers to have neighborhoods on top.

@rperlin-ela
Copy link
Collaborator

rperlin-ela commented Aug 30, 2020 via email

@abettermap
Copy link
Contributor Author

@rperlin-ela

Good point, so this goes on the wishlist. From your end, just out of curiosity, how much work would it take to develop a Spanish or even a Chinese version of the whole site? Are there easy/medium/difficult ways of doing it?

Not sure, I've never done anything like that. Material supports a few though and it looks relatively straightforward. But it might be more confined to what MB shows for labels (geocoding is separate animal).

Definitely need some way to show the additional neighborhoods.

Show 24/7 or on-demand via click? If 24/7, should they go in the same "intro" section of Details or can they go in the body?

If you think it's too much to squeeze in two (and in a few cases three) countries, then Primary Country is probably ok.

If we aren't showing Size or Status, I should be able to fit it fine. Kinda depends on the on-demand neighborhoods though.

Desktop has all the room in the world so I'd vote for intro as top choice and save the body for description, and only add stuff to body as a last resort. I think at a minimum on mobile we just need to make sure the first line is seen so it encourages scrolling and lets user know there is more:

image

I guess the main thing now to do with the Details panel is to fit in the videos (definitely the priority--for the good number of records that have it), audio (so far just testing one), and potentially story map (none yet). Right?

Right. And I totaly forgot about media. Guess I should stick to my #23 efforts.

Re: media, is that another 24/7 one? I feel like that could have a toggle. At some point I'm not going to be able to fit everything in first view on mobile without losing first line of Descrip or compromising comfy layout, so let's see how far I get with fitting the rest and cross the on-demand bridge if needed.

We want to build this generically, but we don't want people to think we have this for cities other than New York. True that Yonkers and Jersey City and a few others we have records for are cities, but maybe changing to "town" would be more explicitly inclusive of the suburban cities? Not a big deal if we have "city", but maybe then "Address, City, Neighborhood, Postal Code, Landmark etc within the New York metropolitan area"?

I see. I can switch to "town" but here's the mess masterpiece I added in the interim:

image

Either way, is it ok with you if we keep the heading? I find headings as a user to be very helpful. It's instant UI-relief to know what a section is for through slightly-larger bold text. I also changed the placeholder input so it's action-suggesting and not redundant.

I would think maybe a zoom level like 15 to really get us close in to a point but still showing a decent amount of its surrounding area.

Sounds good. I haven't made those changes yet because I'd to lump them in with zoom-to-bounds for polygons, which will take some work as almost the entire map stuff in the project is based on center + zoom, not bounds. The box-clearing/search input persistence will take some work as well.

Just to double-check, are we talking about our layer of Neighborhoods or the one used by Mapbox Boundaries (which I know we also requested)?

Either one, but if using ours then would only be Neighborhoods I believe? Don't show city/township boundaries? Or do?

Are we potentially causing headaches here if we use our own?

No headaches to my knowledge. I think it will be a similar process either way.

Doesn't seem mission-critical, but showing surrounding neigbhorhoods while highlighting the one being searched does seem nice.

Agreed, just not sure how the toggle/forced toggle will play in.

What you suggest in terms of forcing the Neighborhoods layer on/off to match what the user is doing could make sense, as long as it's not annoying.

Depends on the user 😃 I think if we include a toggle, ideally it would be off by default so as not to compete with World Region symbols on load, and it would never be forced on, and if the user clicked a result while it was turned off then the map would just zoom but show nothing. If they turned it on then the layer would stay on, and if their clicked geocode result (assuming it's a polygon like neighborhood) would get highlighted.

TLDR; either the layer is on or it's not. And it's controlled by the user, no surprises/shenanigans.

But if this whole question of toggling looks complicated, maybe we can skip it and just highlight the neighborhood being searched.

It will add some work but it's a core aspect of interactive maps and GIS. I think it's also in the SOW so let's make it happen.

This sounds like the ticket— single toggle, combine layers to have neighborhoods on top.

Agreed, although it depends on Boundaries status and if we don't get that, does Maya have the other layers?

I will say that the combo layer is considerably more involved. Not the toggle so much, but more likely the "what happens in terms of highlighting" part since it has to look for several layers.

If you're not encouraging cities/towns anyway, then how about this:

  1. A toggle in the Search by Location that just says "Show Neighborhoods" or "Show NYC neighborhoods" and a little blurb for "sorry NJ" if needed.
  2. It's turned off by default.
  3. If user turns on, it stays on until turned off.
  4. If on, matched poly gets highlighted.
  5. Either way, map zooms to result.

How does that sound? The "Show Neighborhoods" toggle would mean no confusion about "hey man, where's that Wayne, NJ boundary I was expecting?".

Happy to Zoom pretty much any time now with a little notice for any major loose ends or roadblocks, but also figuring we might just want to push on today and tomorrow and then catch our breath. Just let me know.

We've gotten pretty far via GH but I'll leave Zoom open as a backup.

@rperlin-ela
Copy link
Collaborator

Show 24/7 or on-demand via click? If 24/7, should they go in the same "intro" section of Details or can they go in the body?

Via click seems fine.

Desktop has all the room in the world so I'd vote for intro as top choice and save the body for description, and only add stuff to body as a last resort. I think at a minimum on mobile we just need to make sure the first line is seen so it encourages scrolling and lets user know there is more:

image

Re: media, is that another 24/7 one? I feel like that could have a toggle. At some point I'm not going to be able to fit everything in first view on mobile without losing first line of Descrip or compromising comfy layout, so let's see how far I get with fitting the rest and cross the on-demand bridge if needed.

Media is really important, especially video, so let's focus on that. Toggle seems possible, but this is arguably as cool and unique a feature of the map as the descriptions, the fact that we have 100+ videos of speakers from New York speaking these very languages. It's also fine to have a "Show More" with the Description if that helps.

I see. I can switch to "town" but here's the mess masterpiece I added in the interim:

image

A masterpiece, but needs to be shorter. How about just "... or other point of interest within the New York City metro area"

Either way, is it ok with you if we keep the heading? I find headings as a user to be very helpful. It's instant UI-relief to know what a section is for through slightly-larger bold text. I also changed the placeholder input so it's action-suggesting and not redundant.

Sure

Either one, but if using ours then would only be Neighborhoods I believe? Don't show city/township boundaries? Or do?

Can we "combine" our Neighborhoods with their Cities/Townshops, or is that getting weird? In any case the Neighborhood layers are more important. I'm open to using the MB Neighborhood layers but it will take some work on our end. I guess first we need them turned on to see what we're dealing with. Out of my depth here and defer to @fiddleHeads.

  1. A toggle in the Search by Location that just says "Show Neighborhoods" or "Show NYC neighborhoods" and a little blurb for "sorry NJ" if needed.
  2. It's turned off by default.
  3. If user turns on, it stays on until turned off.
  4. If on, matched poly gets highlighted.
  5. Either way, map zooms to result.

How does that sound?

I think this sounds good. Showing Neighborhood polygons is by far the most important (because unclear boundaries).

@abettermap
Copy link
Contributor Author

Media is really important, especially video, so let's focus on that. Toggle seems possible, but this is arguably as cool and unique a feature of the map as the descriptions, the fact that we have 100+ videos of speakers from New York speaking these very languages.

Roger that. Will definitely get the media into intro. I still think consistency is better like this:

VIDEO: clickable thing AUDIO: N/A STORY MAP: N/A

than this:

VIDEO: clickable thing

event though most won't have audio/story map. The N/A could lead to "ooh cool, now I have to find one with audio" and also less confusion like "hmm I swear there was a Video reference in that previous community I clicked but now there's nothing". We'll see how it shakes out though.

It's also fine to have a "Show More" with the Description if that helps.

Nah, if it's at the bottom it's fine. If you're feeling it though I can add.

A masterpiece, but needs to be shorter. How about just "... or other point of interest within the New York City metro area"

image

Done. I won't tell Fairview, NJ we had this talk. 🤫

Can we "combine" our Neighborhoods with their Cities/Townshops, or is that getting weird? In any case the Neighborhood layers are more important. I'm open to using the MB Neighborhood layers but it will take some work on our end. I guess first we need them turned on to see what we're dealing with. Out of my depth here and defer to @fiddleHeads.

Out of my depth too until I have some polygon layers to work with. Hopefully MB support replies tomorrow and we can move forward.

@abettermap
Copy link
Contributor Author

@rperlin-ela I got the "zoom to geocoder polygon result extent" working: https://deploy-preview-67--languagemapping.netlify.app/

If it looks "off", you can visit the playground as the source of truth. The big thing to note is that the center point is not necessarily the "center" of the polygon:

image

I'm not familiar enough w/NYC to know how it plays out but what I have does seem to match the playground.

The only slightly-off thing is not a geocoder issue but rather me miscalculating the "perceived center" of the map. This has probably been the hardest (or at least most frequent) issue to deal with in the entire project, but basically having a map with panels on top of it means the "center" is not actually the center in the user's eyes- it's the center of the available space between the panel and the edges of the screen.

Anyway, you may also see the miscalc when a point is clicked and zoomed to, but it kinda works out in our favor due to the popup height. Popups: I just noticed they are gone. I broke it but I know what's wrong, will fix tomorrow.

Other updates:

  • wording in the Geocode popout. Good?
  • If clicked geocode result is a point, map zooms to level 15.
  • The map now zooms on load (and when "zoom to home" btn clicked) to the bounds you suggested in the email thread I replied to earlier tonight.

Near-future Jason

  • Restore popups
  • Show geocode marker
  • NOT do anything w/neighborhood polygons until I have... some polygons.

@abettermap
Copy link
Contributor Author

Re: near-future jason...

Not sure if marker and the "clear marker when geocode is cleared, and make sure geocode value in search box persists until then" is something to hit next though. The search-by-location is doing its job, so if you're okay with waiting until the table and Details are done, that can be on the backburner.

@rperlin-ela
Copy link
Collaborator

@rperlin-ela I got the "zoom to geocoder polygon result extent" working: https://deploy-preview-67--languagemapping.netlify.app/

Seems to be working well!

  • wording in the Geocode popout. Good?

Good, but assume this will be shortened as discussed (and in your screenshot). I still see the long version.

Seems fine to finsih Table and Details before dealing with marker!

Re: media, I feel pretty strongly that we shouldn't have "Audio: N/A" or "Story Map: N/A" when there's only going to be a tiny number of these and they're more likely special add-ons, maybe, in the future. For video, I'm more open, but anything would be better than "N/A" — somehow graying something out? Will there actually be a good way for people to find all the ones that have video?

@abettermap
Copy link
Contributor Author

I must not have pushed the shortened version up last night. Will do this morning.

Ah good call, graying out is a much better approach than N/A!

For the video should that open as an embed in a modal dialog? I think that would be much better than trying to squeeze it into Details like I did with the world map. And better than opening in new tab because we don’t want to lose anyone.

I think all YouTube embeds have a link to the source video anyway, so that would either open in new tab or app on phone.

Sound good?

I’m going to restore the Popups then push what I have and merge this branch into master. We can revisit geocode marker and polygons later. Been looking forward to Details for weeks!

@rperlin-ela
Copy link
Collaborator

All sounds good. I think there may be strong feelings from the wider team about how the video displays, but this sounds like a good plan to me for now. Definitely a modal dialog, just wondering (while I understand about squeezing) how we can give it maximum visibility. Let me know if there are any issues with the links as given in the spreadsheet — they are just plain (non-embed) links and some are playlist links (going right into the first video), which is hopefully ok.

@abettermap
Copy link
Contributor Author

I will look into the YouTube thing and get back to you

geocoder:

Close the popup on `movestart` in all instances including geocoder
search to avoid the janky feel of popup staying open while moving.
@abettermap abettermap changed the title WIP: geocoder Init geocoder Aug 31, 2020
@abettermap
Copy link
Contributor Author

@rperlin-ela all set! You can see my changes summary in the commit messages: https://github.com/Language-Mapping/language-map/pull/67/commits

Tested as we go. Merging.

@abettermap abettermap merged commit 75841a3 into master Aug 31, 2020
@abettermap abettermap deleted the geocoder branch August 31, 2020 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants