publiclab / leaflet-environmental-layers

Collection of different environmental map layers in an easy to use Leaflet library, similar to https://github.com/leaflet-extras/leaflet-providers#leaflet-providers
https://publiclab.github.io/leaflet-environmental-layers/example/
GNU General Public License v3.0
99 stars 77 forks source link

ability to generate a report via a modal form that includes the current map view #32

Open jywarren opened 6 years ago

jywarren commented 6 years ago

People often want to annotate a location with some text, for example if it's a pollution site. We should make something that opens a form you can add text to, and has a configurable function to submit it to a remote URL!

This could be partially broken out as a separate leaflet-form library at some point...

Good reference here - https://publiclab.org/notes/warren/09-20-2017/compile-screenshots-and-urls-for-aerial-images-of-harvey-damages-in-a-spreadsheet-for-reporting

It could also include the layers that are being viewed during the report!

sagarpreet-chadha commented 6 years ago

Hi @jywarren

Can you elaborate these points : 1.) Form or something like that should open on map and then we add some text and automatically take latitude and longitude , AND the layers currently selected , right ? 2.) And which remote URL should we use ? 3.) And where to use this information collected ?

Thanks !

jywarren commented 6 years ago

I think we should think about a default URL where it could submit - maybe to publiclab.org/post?title=_&body=__&tags=_ for starters? But think about it as a general purpose form.

Does that make sense?

On Sun, Jul 15, 2018 at 2:44 AM Sagarpreet Chadha notifications@github.com wrote:

Hi @jywarren https://github.com/jywarren

Can you elaborate these points : 1.) Form or something like that should open on map and then we add some text and automatically take latitude and longitude , AND the layers currently selected , right ? 2.) And which remote URL should we use ? 3.) And where to use this information collected ?

Thanks !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/leaflet-environmental-layers/issues/32#issuecomment-405071123, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ2eEPHydp1nIH42_NeT5R97QKatbks5uGuSSgaJpZM4VPcW9 .

sagarpreet-chadha commented 6 years ago

Okay makes sense .

Can you help me break this issue into steps ?

jywarren commented 6 years ago

Yeah - perhaps the first thing would be to make a listener and a button, where the button can be pressed to run a given function where:

function onFormOpen(parameters) {

and then run a second on:

function onFormSubmit(parameters) {

so that you can access parameters.location.latitude, parameters.location.longitude, and parameters.location.layers, maybe?

So before all that, maybe some general purpose function to return the layers, although Leaflet may have a standard way to do this?

How's that for a start?

On Tue, Jul 17, 2018 at 2:21 PM Sagarpreet Chadha notifications@github.com wrote:

Okay makes sense .

Can you help me break this issue into steps ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/leaflet-environmental-layers/issues/32#issuecomment-405679529, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJzHZcTF6j7EBBZQr6i4glIocmGlVks5uHiscgaJpZM4VPcW9 .

sagarpreet-chadha commented 6 years ago

Hi @jywarren ...should we write this code in plots2 after we integrate leaflet-environmental-layers ? or inside <script> tag in index.html for now ?

jywarren commented 6 years ago

Let's start by writing it into leaflet-environmental-layers, because perhaps other people will want to integrate such a function into their own pages. We can provide template HTML to make this work, but make it flexible enough to adapt to other websites too. What do you think?

On Thu, Jul 19, 2018 at 2:21 PM Sagarpreet Chadha notifications@github.com wrote:

Hi @jywarren https://github.com/jywarren ...should we write this code in plots2 after we integrate leaflet-environmental-layers ? or inside

Githubissues.
  • Githubissues is a development platform for aggregating issues.