Here is my code:
var map;
require([
"esri/widgets/Sketch",
"esri/Map",
"esri/layers/GraphicsLayer",
"esri/views/MapView",
"esri/geometry/Polygon",
"esri/layers/FeatureLayer",
"esri/symbols/SimpleLineSymbol",
"esri/Graphic",
"esri/symbols/SimpleFillSymbol",
"esri/Color"
],
function(Sketch, Map, GraphicsLayer, MapView, Polygon, FeatureLayer, SimpleLineSymbol, Graphic, SimpleFillSymbol, Color) {
const layer = new GraphicsLayer();
const map = new Map({
basemap: "streets",
layers: [layer]
});const view = new MapView({
container: "map",
map: map,
zoom: 5,
center: [-3.118092, 54.509865]
});// set dynamic url for feature layer
function initOperationalLayer() {
var featureLayer = new FeatureLayer("https://environment.data.gov.uk/arcgis/rest/services/EA/NitrateVulnerableZones2017Final/FeatureServer/0",{
mode: FeatureLayer.MODE_ONDEMAND,
map.add(featureLayer);
}
initOperationalLayer();
});
Please see this screen shots:
You can set the visibility of your layer by this. min Scale
Thanks!
I set the min Scale and its working.
But I have one issue that I mentioned in the previous question that it takes more time to load.
I have attached the video:
Here is the link: Untitled: Feb 13, 2020 11:15 AM.webm - Google Drive
Can you please provide me the solution for this loading issue.