publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
961 stars 1.83k forks source link

Long-term Geographic Features planning #1416

Open jywarren opened 7 years ago

jywarren commented 7 years ago

This is not a regular issue, but is a long-term tracking issue for all Geographic features. It's related to work on this repository (formerly #1070) and to https://github.com/publiclab/leaflet-blurred-location/issues/1


Release v0.1 - bare bones minimal useful release


Release v0.2 - "people and privacy"

v0.2a - Location entry

(mostly via https://github.com/publiclab/leaflet-blurred-location/issues/1)

v0.2b - Map displays

v0.2c - Map API

Geo Subscriptions

mridulnagpal commented 7 years ago

@jywarren Shall we start with the integration?

jywarren commented 7 years ago

Sure, how's the display library going?

For interface, I'd like to suggest you try to get the basic input to display in a partial template, as you originally did, but this time using the new library!

On Aug 25, 2017 3:08 PM, "Mridul Nagpal" notifications@github.com wrote:

@jywarren https://github.com/jywarren Shall we start with the integration?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1416#issuecomment-325011018, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJxpV8v2CSZT_ib1ZzRxk_E-Mw7YFks5sbxuRgaJpZM4NYYC9 .

mridulnagpal commented 7 years ago

The display library is at a prototype stage now, it builds fine and has some basic methods.

mridulnagpal commented 7 years ago

We need to add the leaflet-blurred-location library to npm first, or we just link it from github itself?

mridulnagpal commented 7 years ago

The version is 1.1.0 and the name is leaflet-blurred-location Should I change anything?

jywarren commented 7 years ago

I trust your call -- should i grab the latest master and publish it? :-)

jywarren commented 7 years ago

added integration steps from #1655 !!

mridulnagpal commented 6 years ago

@jywarren Shall we get on with this now? What's our priority for now?

mridulnagpal commented 6 years ago

@jywarren Let's finish off with this milestone for starters, or you have something else in mind?

jywarren commented 6 years ago

Awesome. Maybe this one?

manual entry "place:buffalo-ny

This'll require rails-side geocode -- we have a gem installed I think? We'd want to check if there is already lat/lon tags set, but if not, try to geocode the tag and use that.

I think it'll be worth testing to see if this is a relatively reliable way to add location (just entering "place:location-name", stripping out the "-", geocoding) - because if it causes too many errors maybe it's not worth it.

We could start by looking at http://publiclab.org/tag/place:* and testing the different existing tags of this kind in the current JavaScript geocoder. Do they seem to work?

jywarren commented 6 years ago

Cleaned up and updated some tasks!!!

mridulnagpal commented 6 years ago

So basically, we enter place: buffalo-ny, it then converts to "Buffalo, New York, ZIPCODE, USA" and then does a search. Right?

jywarren commented 6 years ago

so this would be in the tag input on a PublicLab.org page --

so we'd detect a place:____ tag here: https://github.com/publiclab/plots2/blob/0647cb0a7549821f7442213b9571dddfaebedcbb/app/controllers/tag_controller.rb#L278

Then we'd replace '-' with ' '

Then we'd use the already-installed Geocoder gem to try to find where it is: https://github.com/alexreisner/geocoder

Then we'd add two additional tags: lat:____ and lon:____.

What do you think? Should we instead try to catch this in JavaScript and have a popup that says "Looks like a location -- is this right?" and shows lat/lon? That'd give people a chance to agree/disagree.

Or we could even just let people add the tag, but then show an alert above the tag input area that says "That looked like a location -- click here to add coordinates."

Which do you think is the best experience and the most compact code?

On Wed, May 9, 2018 at 10:52 AM, Mridul Nagpal notifications@github.com wrote:

So basically, we enter place: buffalo-ny, it then converts to "Buffalo, New York, ZIPCODE, USA" and then does a search. Right?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1416#issuecomment-387766023, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJy05shdyNk7GHKSZWfDo0jeX6oDgks5twwKtgaJpZM4NYYC9 .

mridulnagpal commented 6 years ago

The option to add location co-ordinates sounds better, as all the location won't be converted to lat lon as well, thus we could give a pop up as you said.

mridulnagpal commented 6 years ago

@jywarren Also if we use javascript we can sync the co-ordinates with the leaflet-blurred-location library as well, using the same google API we used in leaflet-blurred-location

mridulnagpal commented 6 years ago

@jywarren Any updates?

jywarren commented 6 years ago

Ok so if we do it in JavaScript then we won't need the place tag dash removal in ruby code - we can do that in JavaScript! We will need to detect place tags being added in JavaScript though. I believe the file is app/assets/javascripts/tagging.js

mridulnagpal commented 6 years ago

@jywarren There is a method addTag with tagname and selector as input, we can directly check it there right, if its a place? Also when I do console log in the addTag method it doesn't display on the console when I publish the doc. How do I debug ?

jywarren commented 6 years ago

Yes, that makes sense -- add a filter inside addTag(). I believe addTag() uses the HTML form on the page, rather than making an independent AJAX call. We might try to switch to doing an AJAX call, but I guess it really seems to work OK right now, so why bother?

But consider -- addTag() relies on this code being present in HTML: https://github.com/publiclab/mapknitter/blob/master/app/views/tags/_index.html.erb

In any case, on the tag_controller side, it's OK to submit several tags at once, separated by commas, like one,two,three:etc -- so you could:

  1. [ ] intercepts addTag() and if it has place:___, then
  2. [ ] replace - with (a space) and try to geocode
  3. [ ] if successful, pop up a modal saying "we've detected a location and tried to geocode it; does this look right?" showing a longer text description of the place and buttons of Yes, add coordinates and No, just use the original tag options
  4. [ ] if they click Yes, add ,lat:_____,lon:______ to the submitted tag string, else just send the original place:_____ tag alone

How does this sound?

mridulnagpal commented 6 years ago

Sounds awesome!! @jywarren #2734 Please have a look

mridulnagpal commented 6 years ago

@jywarren Whats next?

jywarren commented 6 years ago

Hi Mridul there are a few open issues in the blurred image repo, want to try those and also some CodeClimate based code structure work?

Thanks!!!

jywarren commented 6 years ago

Hi, we still need a "combined" content + people map syntax, like:

[map:all:_latitude_:_longitude_]

https://publiclab.org/wiki/inline-maps doesn't list it, so once we implement, we can add that new syntax.

We'd love to show BOTH nodes and profiles at https://publiclab.org/puerto-rico

It'd be a combination of:

  1. People maps: https://github.com/publiclab/plots2/blob/master/app/models/concerns/node_shared.rb#L220
  2. Note maps: https://github.com/publiclab/plots2/blob/master/app/models/concerns/node_shared.rb#L174

I think we could probably make private methods that did these two so there's no code duplication.

@mridulnagpal or @sagarpreet-chadha interested in this one? Mridul knows this stuff pretty well.

I think the templates themselves are at:

jywarren commented 6 years ago

I've moved this to its own issue, here: #3090

daemon1024 commented 3 years ago

Is this the meta issue for https://publiclab.org/wiki/gsoc-ideas#Geographic+features+refinements ? I wanted to discuss the proposed features, would this be the correct thread to get insights on it?

jywarren commented 3 years ago

Hi @daemon1024 yes it is, but it's SOOOOO old! I wonder if we should start anew? Many above ideas are done or discarded. What do you think?

daemon1024 commented 3 years ago

@jywarren Sure. Let's start up a fresh planning issue.