I have an AGOL webmap that originates from an ArcGIS Server (AGS) mapservice which has been in operation for several months. Last month many new layers were added to the mxd for the mapservice and these layers appeared in the webmap after the mapservice was republished. More changes were made this week and after republishing the changes were seen in the mapservice's REST endpoint, but are not seen in the webmap.
Has anyone ever encountered this scenario and would know how to fix the problem?
Are you adding the whole map service to the webmap? Do you have any definition queries or filters? Looking at the parameters of the exportMap operation should tell you why certain layers don't come through.
Jonathan:
The new layers are available at rest endpt, just not in the webmap.
How exactly do I use the exportMap operation to tell why certain layers don't come through?
So I went into the mxd that is the datasource for the mapservice that is being passed thru AGOL and I retrieved the bounding box for an area where a feature from the new layers should appear, which it does with the exportMap operation. As such why would these new layers show up in the rest endpt and in the exportMap, but not in the AGOL webmap?
I have some more information in regards to the new layers in the mapservice that might be the issue which I had not picked up on until now. There are 4 fields in each new layer with Text data types and Length of 2147483598. Would a field length such as this cause issues with the layers appearing in an AGOL webmap as I can see the layer with the ArcGIS Javascript viewer from the REST endpt?
So you've confirmed that the service works, so it appears to be a client side problem, in this case AGOL or the webmap. I would take a look at the requests from the webmap using Fiddler or the browsers dev tools and determine how the request is different. You can also just try to bring in the service in a new webmap and see if they show up, which would confirm it's a webmap problem. If they don't show up, then it could be a problem with certain field types or lengths, as you're speculating.
Jonathan:
Does this idea:
https://community.esri.com/ideas/13249
cover the phenomenon I am seeing as this is expected behavior which makes updating webappbuilder apps painful. You need to recreate the webmap if new layers are added in existing groups or above existing layers in the mxd (I updated the mxd a month ago with layers that are were all placed after the previous layers and the webmap saw the new layers after republishing the mapservice).
If you're adding the whole map service to the webmap, then no, that doesn't cover it. All layers will be included in the map service so they're all included in exportMap requests, (unless, again, there's a layer filter in the webmap).
Hosted layers have to be added individually, so if you had a hosted service with layer1 in it and then add layer2 to the MXD and republish, layer2 won't show up in the map until you actually add it in.
Hi!
We've seen this issue with a few customer (I'm swedish tech support).
The solution for us has been to use Ago Assistant to edit the json data of the web map and manually add the new layers in the json data of the web map.
The problem might have something to do with popups being enabled or not, but we haven't had the time or opportunity to do extensive testing to verify this, or why this problem occurs.
Easiest when modifying the json would be to copy any of the already existing layers in the json and paste it at the end of the array and remove as much popup info as possible (I think we made it empty) and change the id.
Esri support should be able to help, but let me know if you need some assistance.
Echoing Sveker's point: we do this as well -- use AGOL assistant to update the web map's JSON.
We've found that this happens when custom pop-ups are being used primarily. Support is probably the best option to get this done, but if you're in a time-crunch and are comfortable with JSON, I'm including the workflow we go through to accomplish this for you (and all others who may face the challenge).
The workflow we use is as follows:
"id": 0,
"layerDefinition": {
"source": {
"type": "mapLayer",
"mapLayerId": 0
},
"drawingInfo": {
"renderer": {
"type": "uniqueValue",
"field1": "ParkingStatus",
"defaultSymbol": null,
"uniqueValueInfos": [
{
"value": "1OpenLow",
"label": "Open - Spaces Available",
"symbol": {
"color": [
56,
168,
0,
142
],
"outline": {
"color": [
153,
153,
153,
255
],
"width": 0.75,
"type": "esriSLS",
"style": "esriSLSSolid"
},
"type": "esriSFS",
"style": "esriSFSSolid"
}
},
{
"value": "2OpenHi",
"label": "Open - Near Capacity",
"symbol": {
"color": [
255,
222,
62,
180
],
"outline": {
"color": [
153,
153,
153,
255
],
"width": 0.75,
"type": "esriSLS",
"style": "esriSLSSolid"
},
"type": "esriSFS",
"style": "esriSFSSolid"
}
},
{
"value": "4Full",
"label": "Full",
"symbol": {
"color": [
230,
0,
0,
162
],
"outline": {
"color": [
153,
153,
153,
255
],
"width": 0.75,
"type": "esriSLS",
"style": "esriSLSSolid"
},
"type": "esriSFS",
"style": "esriSFSSolid"
}
},
{
"value": "3Closed",
"label": "Closed for Construction",
"symbol": {
"color": [
252,
146,
31,
165
],
"outline": {
"color": [
153,
153,
153,
255
],
"width": 0.75,
"type": "esriSLS",
"style": "esriSLSSolid"
},
"type": "esriSFS",
"style": "esriSFSSolid"
}
}
]
},
"labelingInfo": [
{
"labelExpression": "[Name]",
"useCodedValues": true,
"maxScale": 0,
"minScale": 0,
"where": null,
"labelPlacement": "esriServerPolygonPlacementAlwaysHorizontal",
"symbol": {
"color": [
47,
79,
79,
255
],
"type": "esriTS",
"backgroundColor": null,
"borderLineColor": null,
"haloSize": 0,
"haloColor": null,
"horizontalAlignment": "center",
"rightToLeft": false,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"text": "",
"rotated": false,
"kerning": true,
"font": {
"size": 7.5,
"style": "italic",
"decoration": "none",
"weight": "bold",
"family": "Arial Unicode MS"
}
}
}
],
"showLabels": true
}
}
If you run into snags, feel free to ping me
Thank you for taking the time to write this up and share - I will be using it extensively!!!