This is the code that I have written till now.
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/MapImageLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleFillSymbol",
"dojo/domReady!"
],
function(
Map, MapView, MapImageLayer, SimpleRenderer, SimpleFillSymbol
) {
var permitsLyr = new MapImageLayer({
url: "http://apps.geoportal.icimod.org/ArcGIS/rest/services/Nepal/District/MapServer",
sublayers: [
{
id: 1,
visible: true,
},
{
id: 0,
visible: true,
}
],
});
/*****************************************************************
* Add the layer to a map
*****************************************************************/
var map = new Map({
// basemap: "dark-gray",
layers: [permitsLyr]
});
var view = new MapView({
container: "viewDiv",
map: map
});
/*****************************************************************
* Animate to the layer's full extent when the layer loads.
*****************************************************************/
permitsLyr.then(function() {
view.goTo(permitsLyr.fullExtent);
});
});
Now, I would like to change default renderer given in the District - Nepal/District as
Drawing Info:
Simple Fill Symbol:
Simple Line Symbol:
How do I change the default color and style for it? Also, using its attribute "DIST_CODE", I also want to apply different color for different polygons.
I am new to this field. So, help me out.
Solved! Go to Solution.
Yeah.
Actually, the discussion with Saroj was helpful. So, I asked everything in the same. I shall later edit the title and publish my codes accordingly.
Thanks for your concern
Glad I could help you.
Have a look at this sample. Labeling features on the client | ArcGIS API for JavaScript 3.18
I usually label the features before publishing the maps in the ArcGIS Server. That way I can call all the maps along with labels using ArcGISDynamicMapServiceLayer module.
In case of ArcGIS API for JavaScript 4.1 what do I need to look into? It says that, it supports only for sceneview ..
Yeah, in the mapserver it already have the labeling information, but it is not showing on my side. So, I thought I shall label it myself.
You can label it yourself programmatically. I use ArcGIS API 3.18 because I work with 2D maps and I need Editing functionalities that are fully supported by version 3.18. I am not sure about 4.1 as far as labeling programatically is concerned. But I would guess the codes should be very similar in 3.18 and 4.11.
Okay! I will look into it.
What are the steps to create MapServer in our own server? What kind of data do I need to have?