I have the code using javascript 3.31
With out zoom in and zoom out I am not able load the features on map
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/layers/GraphicsLayer",
"esri/Graphic"
],
function(
Map, MapView, FeatureLayer, GraphicsLayer, Graphic
) {
var map = new Map({
basemap: "oceans"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-0.118092, 51.509865],
zoom: 6
});
var featureLayer2 = new FeatureLayer({
url: "https://environment.data.gov.uk/arcgis/rest/services/EA/NitrateVulnerableZones2017Final/FeatureServer/0",
mode: FeatureLayer.MODE_ONDEMAND
});
var graphicsLayer = new GraphicsLayer();
map.add(graphicsLayer);