Part of our work at Esri is to build open-source projects that support people building fun and new mapping applications. We are happy to announce four open source Javascript projects we've been working on in the last few months!

Esri-Leaflet is a Javascript library to help developers build lightweight applications using the Leaflet Javascript mapping library.

Geoservices.js is a Javascript client for accessing ArcGIS Online services from the browser or Node.js.

Terraformer is a geometry toolkit for working with different geometry formats and building geo databases.

Pushlet is a simple API for sending notifications through the Apple and Google push notification services.

Esri-Leaflet

Esri-Leaflet is a Javascript library to help developers build lightweight applications using the Leaflet Javascript mapping library.

It works well with Terraformer for converting data between different geo formats, and geoservices-js for making advanced requests to ArcGIS REST services such as place finding and reverse geocoding.

If you're familiar with Leaflet, you'll feel right at home using this library. All of the Leaflet conventions are followed, so you can use ArcGIS services in a familiar style.

One of the major benefits of using Esri-Leaflet over accessing the ArcGIS map tiles directly is this library handles displaying the correct attributions depending on the visible map area.

Esri-Leaflet also has support for displaying retina basemaps!

Demographic Data Service

Below is an example of displaying a tiled ArcGIS map service over the gray basemap in an Esri Leaflet map.

For example, Terraformer can load in a file of all the US counties, build an R-Tree index, and can then quickly query which county a given latitude/longitude is within.

Pushlet

Pushlet is a simple API for sending notifications through the Apple and Google push notification services.

If you've ever had the pleasure of working directly with the Apple APNS API, you know how difficult it can be to get it right. To connect to APNS, you have to configure SSL certificates to authenticate, and then it requires maintaining a persistent socket connection to the servers rather than making a new connection for each push notification.

Pushlet is a stateless wrapper around the API designed to make it easier to use, like you'd use a typical HTTP API. Pushlet uses Redis as a temporary data store to store certificates, and maintains the socket connections to the APNS service so you don't have to worry about it.

Using Pushlet to send a notification is as simple as making a POST request to the Pushlet endpoint like the following:

after Pushlet successfully connects to APNS and delivers the message, it will wait for a specified time to see if the socket is closed (Apple's way of indicating an error condition) and if the socket remains open, responds with "ok".

{
"response": "ok"
}

Of course once you're certain your certificates are configured properly and have successfully sent push notifications to your devices, you can disable the timeout and speed up the HTTP response.