I turned a state boundary feature class into a geojson
file called region2_boundary.json:
{
"type" : "FeatureCollection",
"crs" : {
"type" : "name",
"properties" : {
"name" : "ESRI:102008"
}
},
"features" : [
{
"type" : "Feature",
"id" : 1,
"geometry" : {
"type" : "Polygon",
"coordinates" : [
[
[
1708004.4871000014,
329793.41640000045
],
....
}
I have placed it into my Scripts
folder in my ASP.Net app at the same level as my app.js
. I am trying to bring it in as a layer in my app.js
code, but there seems to be a problem. I keep getting the error:
Uncaught ReferenceError: GeoJsonLayer is not defined
I am thinking that I am just using a bad filepath/url in my boundaries
variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?
require([
"esri/map",
"esri/basemaps",
"esri/dijit/BasemapToggle",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/tasks/ImageServiceIdentifyTask",
"esri/tasks/ImageServiceIdentifyParameters",
"esri/layers/WebTiledLayer",
"esri/dijit/Search",
"esri/config",
"esri/request",
"esri/tasks/IdentifyTask",
"esri/tasks/IdentifyParameters",
"esri/tasks/query",
"esri/tasks/QueryTask",
"dojo/json",
"dojo/promise/all",
"dojo/domReady!"], function(
Map,
esriBasemaps,
BasemapToggle,
ArcGISDynamicMapServiceLayer,
ImageServiceIdentifyTask,
ImageServiceIdentifyParameters,
WebTiledLayer,
Search,
esriConfig,
esriRequest,
IdentifyTask,
IdentifyParameters,
Query,
QueryTask,
JSON,
all) {
...
var boundaries = "./region2_boundary.json";
var geoJsonLayer1 = new GeoJsonLayer({
data: boundaries
});
...
map = new esri.Map("map", {
//basemap: "streets",
basemap: "topo",
center: [-66.664513,18.200178], //PR
zoom: 9,
layers: [geoJsonLayer1]
});
EDIT I have added my dependencies above.