Hi,
As per our current requirement we need to load branch version data in web app where we will pass version name in the url params. could anybody please give some idea how to achieve this using javascript api.
Thanks,
Naveen
Solved! Go to Solution.
The MapImageLayer class has a gdbVersion property that allows you to specify the version for the layer (FeatureLayer does too). Therefore, you would get the version name from the URL, and add it into the constructor for the layer. For example (assuming the name of the version parameter in your URL is "version"):
var myLayer = new MapImageLayer({
url: "https://myserver/arcgis/rest/services/MyService/MapServer",
gdbVersion: new URLSearchParams(window.location.search).get("version")
});
The MapImageLayer class has a gdbVersion property that allows you to specify the version for the layer (FeatureLayer does too). Therefore, you would get the version name from the URL, and add it into the constructor for the layer. For example (assuming the name of the version parameter in your URL is "version"):
var myLayer = new MapImageLayer({
url: "https://myserver/arcgis/rest/services/MyService/MapServer",
gdbVersion: new URLSearchParams(window.location.search).get("version")
});