Plots2: Names of nations not recognized in autosearch

Created on 31 Jan 2018  ยท  15Comments  ยท  Source: publiclab/plots2

Related to the Geographic Features project https://github.com/publiclab/plots2/issues/1416

Please describe the problem

What happened just before the problem occurred?

My goal was to location tag someone's profile with the nation that they specified in their bio, this case, Germany.

What did you expect to see that you didn't?

I typed Germany into the search box, and nothing happened. Are nations not searchable?

Next i tried to zoom in to manually choose the country, and i can't figure out which box to choose, but that's a different problem!
geographic-tagging-zoom-levels

Please show us where to look

any profile page, for instance, you can test on mine publiclab.org/people/liz

JavaScript bug help wanted

Most helpful comment

Finally found the problem here โค๏ธ ๐Ÿ˜„ !

All 15 comments

Hi, this is part of our Leaflet plugin leaflet-blurred-location:
https://github.com/publiclab/leaflet-blurred-location

we're using Google geocoding so this may be a limitation or setting of
Google's API:

https://github.com/publiclab/leaflet-blurred-location/blob/e802cdf2cd4d8c7be69cca69f96327f4bc9a1346/src/blurredLocation.js#L73

Here's the raw request:
https://maps.googleapis.com/maps/api/geocode/json?address=Germany

It seems to return a location. Can anyone confirm that the form is making
this exact request when "Germany" is typed in?

It's probably worth copying this into a new issue on
leaflet-blurred-location instead of here. Thanks!

On Jan 31, 2018 11:39 AM, "Liz Barry" notifications@github.com wrote:

Please describe the problem

What happened just before the problem occurred?

My goal was to location tag someone's profile with the nation that they
specified in their bio, this case, Germany.

What did you expect to see that you didn't?

I typed Germany into the search box, and nothing happened. Are nations not
searchable?

Next i tried to zoom in to manually choose the country, and i can't figure
out which box to choose, but that's a different problem!
[image: geographic-tagging-zoom-levels]
https://user-images.githubusercontent.com/161439/35643450-4b593b0a-0694-11e8-8041-a589403a03a7.gif
Please show us where to look

any profile page, for instance, you can test on mine
publiclab.org/people/liz

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2186, or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJw8HqbD5FQVtAm8ESJINcP36vh9dks5tQMFggaJpZM4R0iDE
.

@jywarren @ebarry Yesterday I have also encountered the same problem. When you type in the country or state, the map does not automatically shows that typed in location.
But the latitude and longitude are updated as soon as we type in the country or state and press enter
However, when we save it, then it is saved to the right location.

Thank you again for all your work @mridulnagpal ! This feature is elegant, and i love using it.

I'm wondering about typing place names, and if we should expect that any placename that has a search result in Google Maps would also have a search result in our location tagging system?

I found that when i type in Barataria Bay that the map does not move to that location, even though Google Maps itself does have Barataria Bay as a place name -- see this search result https://www.google.com/maps/place/Barataria+Bay/@29.3781947,-89.9872989,12z/data=!3m1!4b1!4m5!3m4!1s0x889fd379b8300d49:0x4134bdb99b1b24a5!8m2!3d29.3947018!4d-89.9440061

It also seems like there's an issue with the dropdown autocompletion - the demo properly shows suggestions:

https://publiclab.github.io/leaflet-blurred-location/examples/

screenshot 2018-02-05 at 11 24 53 am

But i see errors on the PublicLab.org implementation:

InvalidValueError: not an instance of HTMLInputElement
_.Pb @ js:38

...

application-77562176e14ba2183a17d8a12a9edb36.js:59785 Uncaught TypeError: Cannot read property 'url' of undefined

...

maps.googleapis.com/maps-api-v3/api/js/31/8a/places_impl.js:31 Uncaught TypeError: Cannot read property 'activeElement' of undefined

And no dropdown.

@Souravirus did I see you potentially found a solution to this? We're a bit stuck on it -- maybe we need to compare the exact HTML from the original example:

https://publiclab.github.io/leaflet-blurred-location/examples/

to the DOM in PublicLab.org:

https://github.com/publiclab/plots2/blob/master/app/views/locations/_form.html.erb

to see if there's something missing. Or maybe it's that the Google geocoding div is loaded with the page, but when a modal is asynchronously loaded, it happens /after/ the google library?

I think this is 2 separate issues. One is an API rate overage:

"You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_"

The second is that the auto-suggest system is not displaying a list of suggested places the way I screenshotted above. for that, i'm not sure but maybe it does have to do with the load order of the Google API code and the modal dialog.

@jywarren @ebarry We will be getting rid of google API anyways this summer so I think this should be resolved when we do that. Sounds good?

I think it should be possible to figure this one out ahead of then, to be optimistic! Possibly if one of our new contributors or @publiclab/reviewers with some JavaScript experience would be able to tackle this one?

Hi jeff , i would love to see this one also...will ping you if i need help
:)

On 22 Feb 2018 3:11 am, "Jeffrey Warren" notifications@github.com wrote:

I think it should be possible to figure this one out ahead of then, to be
optimistic! Possibly if one of our new contributors or
@publiclab/reviewers https://github.com/orgs/publiclab/teams/reviewers
with some JavaScript experience would be able to tackle this one?

โ€”
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/2186#issuecomment-367482945,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOQoxc7WR9scDwqAVUT_dvuDBE7yAhTJks5tXI2BgaJpZM4R0iDE
.

Finally found the problem here โค๏ธ ๐Ÿ˜„ !

After hours of experimenting with code !
The autocomplete is working and drop-down is shown but below the container ๐Ÿ˜† .

This is awesome. :-) ๐Ÿ‘ ๐ŸŽˆ ๐Ÿš„

This was indeed a tricky one ! Thank you ๐Ÿ˜„ :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noi5e picture noi5e  ยท  3Comments

first-timers[bot] picture first-timers[bot]  ยท  3Comments

milaaraujo picture milaaraujo  ยท  3Comments

grvsachdeva picture grvsachdeva  ยท  3Comments

grvsachdeva picture grvsachdeva  ยท  3Comments