Web-map mash-ups with ActivityInfo and Leaflet

ActivityInfo is a great tool for collecting and managing project results from across many partners and offices. You can further leverage your ActivityInfo database by integrating your data into web applications.

In this post, we'll walk through integrating ActivityInfo sites into a Leaflet map. Leaflet is a great lightweight JavaScript mapping library that also works well on mobile devices.

First, you'll need the ID of the activity you want to include. You can find this in the Design tab:

Where to find the activity identifier in the Design tab of ActivityInfo

Here we can see that our Water Point Construction has an id of 1076. We also need to make sure that the activity is set to "All are published" so that the data will be publicly exposed.

With the ID of the activity, you can access the list of sites in GeoJSON format at the URL http://www.activityinfo.org/resources/sites/points?activity=1076. Note that this will only return sites that have been mapped.

Now, let's add these points as a layer to a Leaflet map. If you're not familiar with Leaflet, take a look at their Quick Start Guide.

Want to try out ActivityInfo?

If you sign up to ActivityInfo then you are are automatically using the free plan which is a great way to give the service a try. The free plan includes full access to all features for an unlimited period of time.

Sign up for a free account

Give each person in your organization the power to create valuable information based on your data.