Want to talk about wastewater? Join us for Open Call on Jul. 27 to kick-off this topic and then every Tuesday through September. Click here for call-in details!

Public Lab Research note

Map of Projects

by mridulnagpal | March 01, 2017 21:31 01 Mar 21:31 | #13979 | #13979

About me

Name : Mridul Nagpal

Github : https://github.com/mridulnagpal

LinkedIn: https://www.linkedin.com/in/mridul-nagpal-0663bb131/

Affiliation : International Institute of Information Technology, Hyderabad - 500032

Location: Hyderabad, India

Email: mridulnagpal07@gmail.com

Project Title: Map of all Projects

Gitter: mridulnagpal

Project description

The project I will be doing this summer will be :-

Map of all Projects of PublicLab:

Public Lab is an open community that works online through this interactive wiki where people can pose questions, post their research and reach out to others. Research questions are focused on addressing local issues, and are driven by on-the-ground community work.

These research/wiki notes have some special tags added to them to make them easier to reach and comprehend. My project will be to add some more tags making these notes even better. These notes may be about any event that is going to take place someplace. My project would be to add a tag that would add a map to this note. Other features of the project are following:

  • Creating a module for PublicLab to add maps to research/wiki notes
  • The module will be available on npm
  • It will use an html template to render all the information regarding the location of the event
  • Testing of the module will be done using Jasmine
  • Privacy features to manage who all can see the location you added
  • A map consisting of all the nearby projects by PublicLab using google's geolocation API
  • Information about the organizers, requirements, # participants, etc. all available through the map
  • Interactive markers to highlight all the places of interest nearby and far out as you pan out

Summary :

There can be a browseable map to display all of the projects of PublicLab nearby on a piece of map. There will be markers on the place of events, which when clicked will tell about the details of the project, people involved, etc. . We can also link the markers to the page showing the requirements for the project and all about it. You could even have options such as interested so that other people can see the same. We can directly link these maps to the wikis using power tags and let the author input some details regarding the same.The resultant repository will be a package like the publiclab.Editor (https://www.npmjs.com/package/publiclab-editor) which will be integrated to plots2 repo.


What problem does your project solve?

This project will make the events by PublicLab more easily accessible and provide a better interface to people. The organizer can identify himself as the organizer and can specify the equipments required for the project. We can even link the map to the PublicLab store for the required equipment. This can also help the organizer get an estimate on the number of people attending the event. This will let one explore multiple notes on the basis of location using a single platform.

A prototype to add location to content/profile:

image description


I will use Agile Development Methodology for this project. Given below is a rough timeline for my project, subject to change by mentor intervention:

  • Community Bonding period (22 April - 23 May): I will go through the source code of PublicLab.Editor( https://github.com/publiclab/PublicLab.Editor/), Inline Markdown Editor (https://github.com/publiclab/inline-markdown-editor) and polish my approach for this project.
  • Week 1 (23 May - 29 May): Creating a standardized User location storing system which store a User's location to his/her profile (the columns are already present in the database just needs integration with the new built page using https://github.com/publiclab/plots2/blob/master/app/controllers/location_tags_controller.rb).
  • Week 2 (30 May - 5 June): Design and implement a display for displaying maps on a User's profile (Using bootstrap and CSS according to the feedback by the mentor).
  • Week 3 (6 June - 12 June): Integrating map features such as privacy options, removing maps to the backend using ruby controllers and database.
  • Week 4 (13 June - 19 June): Enable viewing people on the basis of their location (done using controller in ruby and maps using leaflet library).
  • Week 5 (20 June - 26 June): Using Jasmine to write the controller tests for the functionality and other unit tests required. And fixing the bugs so far.

Mid term evaluation

  • Week 6 (27 June - 3 July): Integrating abstract map functions to wiki/research notes as well.
  • Week 7 (4 July - 10 July): Adding external information such as gear required, organizers, etc. to any event notes' map.
  • Week 8 (11 July - 17 July): Fixing any bugs/Buffer time.
  • Week 9 (18 July - 31 July): Building a Location Notification system (Writing a controller to retrieve people/research notes on the basis of location).
  • Week 11 (1 Aug - 15 Aug): Continuing with the notification system (adding tests using Jasmine, validation and perfecting the system).
  • Week 12 (15 Aug - 29 Aug): Buffer Time.

Final term Evaluation are submitted to Google

Data model after completion of project:

image description


All the resources I will be requiring are on the internet such as PublicLab.Editor, Jasmine documentation, leaflet documentation, etc. And I would of course require the guidance of my mentor.


I have forked and built plots2. I have been contributing to it for a little time as well. All tests pass, I have it set up on my local and it works smoothly.

Fork: https://github.com/mridulnagpal/plots2


I have experience with Django, Ruby on Rails, Javascript, C++, HTML, CSS. I have been working on this project for approximately a month now.

Here are all of my PR's:

And some more...


I have been part of National Graphics Competition and scored a grade A for a project which included 3 members. I find it easy to mix up with people and am comfortable to work in a team. I also have been building a web project for my college with my team.


Being in college under the load of assignment I do not get much time to think about the better of the world. Therefore I think this would be the best platform for me to atleast do something for the greater good rather than my own. I also have keen interest in web development and this project will let me enhance my skills.


I would try my level best to make whole of my project well documented and easy for users to interact with. I will make sure that LocationTags using maps will be easy to interact with.


I understand that this project is equivalent to a full time summer job and will work on it according the timeline I have mentioned above.


Mridul, I have some ideas on how to architect the mapping features. I'm interested in how we might break it out into a general purpose privacy-oriented location choosing interface in JavaScript, and include it into our project that way. Like we've done with the rich editor and inline markdown editor. I'll post some more notes on your proposal later today. Thanks for your interest!



This also allows us to make clearer test suites for how the system should behave. And maybe recruit contributors from other projects who need this functionality in their own work.

Reply to this comment...

This is a really exciting project idea!

Reply to this comment...

Hi, Mridul - it sounds like there are a few distinct features we're hoping to get built. I think one really key one you've been working on a lot could be described as a stand-alone module, perhaps called "blurred-location-form" -- a JavaScript module which is added to (or creates) a Leaflet map and location input just like you've created, and outputs a standardized "blurred" location -- a location rounded to the nearest decimal latitude/longitude.

  • based around the Leaflet library
  • available on npm
  • uses HTML template like PublicLab.Editor
  • we could start with an example repository
  • behavior tests with Jasmine
  • abstract geolocation -- could be done later, but so you could swap Google geolocation for another system
  • default "warning texts" to explain the privacy features

Another sub-project might be a plots2 system for finding vague location of any type: person, wiki, note:

  • ability to display in a map a collection of nodes.each do |node| on a Leaflet map
  • node.isBlurred and node.blurredLocation -- do we display blurred locations, or just full-resolution locations? Could a blurred location be indicated by a region for some zoom levels, and a marker when you zoom out enough?
  • unit test "isBlurred"
  • determine how blurred locations are stored, as floats, strings, etc
  • test display of location, vague location

This is a start, but could be fleshed out even further. I'd love to see a test-driven approach to these modules. Does this kind of breaking-out into modules make sense to you?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Yeah this makes complete sense. Could you tell me some places where I can find more information on such things?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Yes, actually if you wanted to try to install an external module like https://github.com/publiclab/PublicLab.Editor/ or https://github.com/publiclab/inline-markdown-editor and try building them and familiarizing yourself with:

  1. how to build the source
  2. how testing works
  3. how they integrate with plots2

that would be a great start. Then you might consider building a static version of your work to date in a folder, as in the examples on the above projects -- and getting your code from plots2 running on those static page examples. What do you think?

Of course you can also just plan out these steps as part of your proposal, before doing them.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Hi, Mridul - i was also thinking about how, if we standardize the way of storing the location information, we could then (to some degree) separate the code for displaying locations from that of selecting locations. Some code might be shared, like the grid display code. But other code might be quite separate -- maybe not a completely separate library, but at least written and stored separately. Maybe that's a good way to think about the two different lists of features I wrote above.

Have you had a chance to try downloading and "building" one of the modules I mentioned above? I'd love to accept a pull request for one of them if you want to give it a try.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@warren Yes I have downloaded and built PublicLab Editor and was understanding the source code. I think I should start building a new repo regarding only location section as done in PublicLab Editor. What do you suggest? I have also updated my proposal, can you please review.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

That sounds like a good next step, great! You can copy in your existing map code as closely as possible and try to "build" it using grunt and, perhaps, browserify. Take a close look at how this is done in the two examples I sent; they're each a little different but will be helpful examples. Do you see how require() methods work to combine multiple pieces of code?

Also, see how we might develop an abstract function instead of a use-specific one, here:

Week 3 (6 June - 12 June): Add privacy options and option to remove location from profile.

Instead of doing this just for a profile, we could make a generic method for selecting a privacy-blurred location, as you've mostly done already. Then, this step would be integrating this into the back-end system for storing such a location. Make sense?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@warren Got it. Will start with the new repo right now, any feedback on the proposal?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@warren Started with the repo will work on it side by side. (https://github.com/mridulnagpal/map_module)

Reply to this comment...


Reply to this comment...

@xose Thanks alot. Any feedback on the proposal ?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Hi, @mridulnagpal -- great work, let me think of some things that'd help start getting this together:

  • If you make a branch called gh-pages, you can try it out online in GitHub, kind of like how we've done here: https://publiclab.github.io/inline-markdown-editor/examples/
  • I think a good README would be great, similarly to the other example modules, that shows exactly how to instantiate your code
  • The example HTML file could include comments showing the <!-- START OF EXAMPLE --> and the end -- so people know what's strictly necessary.

I think a name might do well to include leaflet -- what do you think about leaflet-blurred-location?

How are you thinking of doing Jasmine testing? I often start just with an empty test suite that asserts true just to see that it properly runs. And then I put the documentation on how to run tests in the README. You can just copy a lot of the README from the other example modules I've linked to as you begin to add those functions.

This is looking great -- once we iterate a bit, we can make it under the Public Lab account, and have that be the "main" repository. Thanks for your hard work on this!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Superb https://mridulnagpal.github.io/leaflet-blurred-location/examples/ Adding a README and starting with the test integration as well. Thanks :)

Reply to this comment...

Hi @mridulnagpal Sorry for neatpicking but I saw you mentioned "using Drupal" at some places like

Week 3 (6 June - 12 June): Integrating map features such as privacy options, removing maps to the backend using ruby controllers and Drupal.

Week 7 (4 July - 10 July): Adding external information such as gear required, organizers, etc. to any event notes' map (By using Drupal to add location to the notes).

Drupal is a different framework and isn't used in plots2. Perhaps you tried to convey something else?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@ananyo2012 Oh I did not know about that I meant integrating it to backend using the node system we use. Thanks for the heads up :)

Reply to this comment...

Hi, @mridulnagpal! I've looked through your plan in detail and wanted to propose some revisions and a way to break up the work into phases a bit more. I've posted my thoughts over in a new repository named as yours is -- but under the publiclab name:


Some things we'd like to de-prioritize, and others we'd like to do in a different order. Would you mind taking a look and telling me what you think? I hope it makes sense and I'm happy to help flesh it out further.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Login to comment.