I'm new to ESRI Map. I'm working on latest version of JavaScript API.
I'm trying to load GeoJSON from this link into my Map. I'm able to load GeoJSON from ESRI Feature Service URL.
I wanted to load GeoJSON from an object. My code goes like this.
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/widgets/Legend",
"dojo/domReady!"
], function(
Map, MapView, FeatureLayer, Legend
) {
var defaultSym = {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
outline: { // autocasts as new SimpleLineSymbol()
color: "lightgray",
width: 0.5
}
};
var renderer = {
type: "simple", // autocasts as new SimpleRenderer()
symbol: defaultSym
};
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-85.050200, 33.125524],
zoom: 4
});
var usOutline = ...... A single feature from the feature collection in link.
var featureLayer = new FeatureLayer({
source: usOutline.geometry,
title: 'Hello',
geometryType: "Polygon",
renderer: renderer
});
map.add(featureLayer);
});
How can I load the GeoJSON?