An easy way to load GeoJSON data into your ArcGIS map
JavaScript HTML
Latest commit b2f4095 Feb 25, 2015 @alaframboise alaframboise Merge pull request #31 from btfou/master
Added fire load event after features added to layer and renderer if passed in


An easy way to load GeoJSON resources into your ArcGIS map. This is a simple custom layer that uses Terraformer to convert GeoJSON to ArcGIS JSON. It "should" support all GraphicLayer operations. e.g. popups, rendering...

View demo app live



  • Load GeoJSON from a file
  • Load GeoJSON from a server
  • Load GeoJSON data from a FeatureCollection


// Example 1: Load from a file
var geoJsonLayer1 = new GeoJsonLayer({
    url: ""

// Example 2: Load from a server
var geoJsonLayer2 = new GeoJsonLayer({
    url: ""

// Example 3: Load from a FeatureCollection
var geoJsonLayer3 = new GeoJsonLayer({
    data: myFeatureCollection 

// Add to map
// options:
//      url: String
//          Path to file or server endpoint. Server must be on the same domain or cors enabled. Or use a proxy.
//      data: Object[]
//          Optional: FeatureCollection of GeoJson features. This will override url if both are provided.
//      maxdraw: Number
//          Optional: Limit the maximum graphics to draw. Default is 1000.

Developer Notes

  • All GeoJSON data needs to be in geographic coordinates (wkid 4326).
  • All GeoJSON resources must reside on the same domain as the app unless a CORS enabled server or a proxy is used. NOTE: GitHub gh-pages servers are not CORS enabled!
  • Terraformer does not support dojo require() and must be loaded directly into the page.
<!-- Terraformer -->
<script src="./vendor/terraformer/terraformer.min.js"></script>
<script src="./vendor/terraformer-arcgis-parser/terraformer-arcgis-parser.min.js"></script>


<!DOCTYPE html> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>ArcGIS GeoJSON Layer</title>  
<!-- ArcGIS API for JavaScript CSS-->
<link rel="stylesheet" href="//">
<!-- Web Framework CSS - Bootstrap ( and Bootstrap-map-js ( -->
<link rel="stylesheet" href="//" rel="stylesheet">
<link rel="stylesheet" href="//">
html, body, #mapDiv {
  height: 100%;
  width: 100%;

<!-- ArcGIS API for JavaScript library references -->
<script src="//"></script>

<!-- Terraformer reference -->
<script src="./vendor/terraformer/terraformer.min.js"></script>
<script src="./vendor/terraformer-arcgis-parser/terraformer-arcgis-parser.min.js"></script>

      function (Map, GeoJsonLayer, on, dom) {

        // Create map
        var map = new Map("mapDiv", {
            basemap: "gray",
            center: [-122.5, 45.5],
            zoom: 5

        map.on("load", function () {

        // Add the layer
        function addGeoJsonLayer(url) {
            // Create the layer
            var geoJsonLayer = new GeoJsonLayer({
                url: url
            // Zoom to layer
            geoJsonLayer.on("update-end", function (e) {
            // Add to map
    <div id="mapDiv"></div>




Find a bug or want to request a new feature? Please let us know by submitting an issue. Thank you!


Anyone and everyone is welcome to contribute. Please see our guidelines for contributing.


Copyright 2013 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.