Plots2: Add a blank map and prompt people to add location to un-geotagged note pages

Created on 28 Nov 2018  ยท  23Comments  ยท  Source: publiclab/plots2

Many notes are not geotagged, and would be helpful to see as part of regional work (say, people studying air quality in Wisconsin). We should do more to prompt people to add a location - we could start by displaying a map on pages that lack a location, which could look like this:

image

But perhaps say "add a location" but preserving the "learn about location privacy" link to https://publiclab.org/location-privacy below.

I think it doesn't have to be a full square as shown... it's really just reminding people, so it could be more like this aspect ratio:

image

Maybe with rounded corners, using the correct Bootstrap css class -- is it img-round? We can check on https://getbootstrap.com/docs/3.3/

We could display this if it does NOT have a place tag, but DOES have @node.lat and @node.lon, in an extra outcome of this conditional:

https://github.com/publiclab/plots2/blob/58db2b8cc6ba72e650c25e4767553bbc9fcc07b6/app/views/sidebar/_related.html.erb#L46-L48

Clicking the button could trigger the location input modal, with: onClick="$('.blurred-location-input').click()"

We'd love help with this one!

(@edieblu this could be part of a dashboard design too, i think... worth considering!)

JavaScript Ruby fto-candidate help wanted

Most helpful comment

@sagarpreet-chadha ๐Ÿ˜„ check it out!

@ValentinaTironi sorry, i tried to correct myself -- you're right, it should show if there is no lat/lon data. But if it has lat/lon AND it's a "place page" (i.e. if it has the tag place), we allow other code to show a map at the top, full-width. Thanks!

All 23 comments

@milaaraujo @sagarpreet-chadha i added you two as mentors but no obligation, just so you can see it as tangentially related to our geographic API and UI work!

Sorry! I meant:

We could display this if it does NOT have a place tag, and also does NOT have @node.lat and @node.lon, in an extra outcome of this conditional:

I am new to this Project but I would like to contribute. Can someone give the initial steps? I have already solved a first-timer issue

Hi @neel1998 -- I believe @ValentinaTironi may be working on this. But perhaps you two would be interested in collaborating on this? If you're both in GCI, I'd be happy to give task credit for both of you if you'd like.

@ValentinaTironi are you still working on this?

OMG, I didn't see this! I'm really sorry @jywarren. Let me see all the information about that and if I can help of course I will! Thank you! And again, I'm sorry for not get answer from me :/

OK, I think I can work on this if nobody is working yet. @oorjitchowdhary are you working on this?

I have a couple of questions:

We could display this if it does NOT have a place tag, but DOES have @node.lat and @node.lon, in an extra outcome of this conditional:
<% if @node && [email protected]_power_tag('place') && @node.lat && @node.lon %> <%= render_map(@node.lat, @node.lon) %> <% end %>

This conditional check exactly what you said. I don't understand. Doesn't the button should display when this condition returns true? This line render the map<%= render_map(@node.lat, @node.lon) %>, right? So, why you want display the share you location button if you already have the location with latitude and longitude?

Sorry if are a lot of questions, I just wanna understand. Thank you!
@jywarren

Another comment :) I can't claim this this without have this task approved https://github.com/publiclab/plots2/pull/4098, you know that Guarav can't answer now so would be really great if you can check out it! Everything is ready there! Thank you so much ๐Ÿ’ฏ

@valentinatironi I haven't start working on it yet.. Maybe we can collaborate this one?

That sounds great! I've never collaborated with someone remote. I think we can do it :)

@sagarpreet-chadha ๐Ÿ˜„ check it out!

@ValentinaTironi sorry, i tried to correct myself -- you're right, it should show if there is no lat/lon data. But if it has lat/lon AND it's a "place page" (i.e. if it has the tag place), we allow other code to show a map at the top, full-width. Thanks!

Hey @ValentinaTironi , @oorjitchowdhary !

How about one of you can work on writing the logic to display the static image of map with "add a location" button on top of it - if the latitude AND longitude tags are not present .

The other can work on the CSS of it - getting the correct aspect ratio with round corners of the map image .

And after that - you both can review each other code and see if anything is missing ๐Ÿ” ๐Ÿ‘€ .

Thank you ๐Ÿ˜„ ! Happy to see you guys collaborating ๐ŸŽ‰ !

Sounds good.. @valentinatironi can I work on the css...

Hey everybody! Sorry for my absence, I was doing an exam! So, I'm agree with all of that. @oorjitchowdhary it's gonna be a pleasure work with you :)

@jywarren OK, thank you for clear that for me :) The button just has to display this onClick="$('.blurred-location-input').click()"? and that modal already exists or I have to create it too?

That's right, the modal is already set up.

OK, I can do it, but there is an error in blurred-location-input button:
screen shot 2018-12-05 at 10 19 54 pm
The error is external to my changes, it existed before me... and my code works (do the click when I press add location button) What I have to do? Do I do the pull request anyway or what?

@jywarren

Oh, does that error appear on the live site too? Maybe just open a new
issue for it please! And yes you can open a PR with your code. Thanks!

On Wed, Dec 5, 2018, 8:23 PM Valentina Tironi <[email protected]
wrote:

OK, I can do it, but there is an error in blurred-location-input button:
[image: screen shot 2018-12-05 at 10 19 54 pm]
https://user-images.githubusercontent.com/20969831/49554691-f1059000-f8db-11e8-871c-58ece058160f.png
The error is external to my changes, it existed before me... and my code
works (do the click when I press add location button) What I have to do?
Do I do the pull request anyway or what?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/4066#issuecomment-444713463,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ8qqjwfPBk-Ym39vXm2dD-VKO_POks5u2HFkgaJpZM4Y4B2B
.

Let me see if in the production code happens too

OK, the error doesn't appear in the live mmmm I'm gonna save my changes and try again

I removed my changes and the error still appearing there. I'm gonna to create the pull request anyway to @oorjitchowdhary can work on this. Now, I have to study for exams, but when I'm back, I'm gonna try to resolve this or create an issue if it is possible (maybe you two can help me @jywarren @oorjitchowdhary to see what is happening, I think is something asynchronously function)! Thank you!

Done @oorjitchowdhary! You can start working in css :)

Hey @jywarren What I have to do with the error? Can you check if locally it appears too? In production code doesn't appear, maybe is my computer? I don't know. Can you help me here?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jywarren picture jywarren  ยท  3Comments

keshavsethi picture keshavsethi  ยท  3Comments

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

milaaraujo picture milaaraujo  ยท  3Comments

RuthNjeri picture RuthNjeri  ยท  3Comments