<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing definition expression in 4.x with MapImageLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72995#M6586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion.&amp;nbsp; I tried it and even tried setting a timeout.&lt;/P&gt;&lt;P&gt;setTimeout(refreshFunction, 5000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function refreshFunction() {&lt;BR /&gt; lyrMaintPoints.refresh();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code works fine if I only reset one definition query at a time.&amp;nbsp; If I try resetting the definitionExpression on multiple layers, then the screen won't refresh.&amp;nbsp; Even if I zoom in, the symbols won't resolve to smaller icons.&amp;nbsp; The identifyParams.layerDefinitions changes work fine.&amp;nbsp; It's the layer definitionExpression that seems to be the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The response is extremely slow even when I try toggling the visibility of layers.&amp;nbsp; I used a refresh there as well, and it takes another ten seconds after the refresh before I see results on the screen.&lt;/P&gt;&lt;P&gt;If I try setting the definitionExpression and then toggle layer visibility, the layer visibility doesn't work (because the symbols are frozen from the definitionExpression).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To verify that my definitionExpressions were valid, I tried them all in ArcMap.&amp;nbsp; I also tried them one by on in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The one thing to note about my GIS layers is that some of them are the same feature class but with different definition expressions (e.g., Drywells).&amp;nbsp; Could that be the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Feb 2018 18:50:21 GMT</pubDate>
    <dc:creator>LoriEmerson_McCormack</dc:creator>
    <dc:date>2018-02-21T18:50:21Z</dc:date>
    <item>
      <title>Changing definition expression in 4.x with MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72993#M6584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing definition expressions in 4.x takes a long time to see results in the map, and the results are inconsistent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The map service&amp;nbsp;is set up to do inspections, and when an inspection is completed, the symbol color changes color.&amp;nbsp; If there is no inspection (AKA No Maintenance Record), the symbol is red (value of NULL).&amp;nbsp; I have a checkbox on the map that lets the user see only those symbols that still need to be inspected.&lt;/P&gt;&lt;P&gt;The GIS layers in the map service are joined to a&amp;nbsp;view of the inspection table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&amp;nbsp; After I change the definition expression, do I need to refresh my map somehow?&amp;nbsp; Does my click event code look reasonable?&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// definition expressions use table names and attribute names because joined to a view&lt;/P&gt;&lt;P&gt;var defExprCatchBasinNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'catch+basin' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprCatchBasinAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'catch+basin' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;BR /&gt; var defExprCatchBasinPipeNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'catch+pipe' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprCatchBasinPipeAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'catch+pipe' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;BR /&gt; var defExprDrywellNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'drywell' AND ( PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT &amp;lt;&amp;gt; '.TRUE.' AND PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT &amp;lt;&amp;gt; 'T') AND ( PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprDrywellAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'drywell' AND ( PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT &amp;lt;&amp;gt; '.TRUE.' AND PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT &amp;lt;&amp;gt; 'T') AND ( PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;BR /&gt; var defExprDrywellPipeNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'dry+pipe' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprDrywellPipeAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'dry+pipe' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;BR /&gt; var defExprPretreatDrywellNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'drywell' AND ( PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT = '.TRUE.' OR PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT = 'T') AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprPretreatDrywellAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'drywell' AND ( PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT = '.TRUE.' OR PUBLISHED.STORMWATER.Storm_Struc_points.PRETREAT = 'T') AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;BR /&gt; var defExprSandFilterNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'Sand Filter' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprSandFilterAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'Sand Filter' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;BR /&gt; var defExprSwaleNoMaint = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'swale' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL) AND ENGINEERSdev.dbo.vwSWUFacilityMaintRecordExists.SymbolColor IS NULL";&lt;BR /&gt; var defExprSwaleAll = "PUBLISHED.STORMWATER.Storm_Struc_points.STRUCTURE = 'swale' AND (PUBLISHED.STORMWATER.Storm_Struc_points.Non_County &amp;lt;&amp;gt; 'yes' OR PUBLISHED.STORMWATER.Storm_Struc_points.Non_County IS NULL)";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// index values of the layers in the map service&lt;/P&gt;&lt;P&gt;var indexCatchBasin = 7;&lt;BR /&gt; var indexCatchBasinPipe = 8;&lt;BR /&gt; var indexCulvertPipe = 9;&lt;BR /&gt; var indexDetentionPond = 10;&lt;BR /&gt; var indexDrywellsGroup = 11;&lt;BR /&gt; var indexDrywell = 12;&lt;BR /&gt; var indexDrywellPipe = 13;&lt;BR /&gt; var indexPretreatDrywell = 14;&lt;BR /&gt; var indexMaintJunction = 15;&lt;BR /&gt; var indexSandFilter = 17;&lt;BR /&gt; var indexSwale = 18;&lt;BR /&gt; var indexMunicipalBdry = 19;&lt;BR /&gt; var indexParcels = 20;&lt;BR /&gt; var indexMaintDist = 21;&lt;BR /&gt; var indexMunicipalShaded = 22;&lt;BR /&gt; var indexSWUDrainageNetwork = 24;&lt;BR /&gt; var indexSWUServiceArea = 25;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var initialExtent = new Extent(&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;-117.83, 47.23,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;-117.03, 48.055,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;SpatialReference({ wkid: 4326 })&lt;BR /&gt; );&lt;/P&gt;&lt;P&gt;var map = new Map({&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;basemap: "topo"&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;var view = new MapView({&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;container: "viewDiv",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;map: map,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;extent: initialExtent&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;view.constraints = {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;minScale: 2000000, // User cannot zoom out beyond a scale of 1:2,000,000&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;maxScale: 0, // User can overzoom tiles&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;rotationEnabled: false // Disables map rotation&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;/********************&lt;BR /&gt; * Add home button&lt;BR /&gt; ********************/&lt;BR /&gt; var homeButton = new Home({&lt;BR /&gt; view: view&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;// Add the home widget to the top left corner of the view&lt;BR /&gt; view.ui.add(homeButton, "top-left");&lt;/P&gt;&lt;P&gt;/********************&lt;BR /&gt; * Add layer&lt;BR /&gt; ********************/&lt;/P&gt;&lt;P&gt;var lyrMaintPoints = new MapImageLayer({&lt;BR /&gt; url: urlMaintPts,&lt;BR /&gt; sublayers: [&lt;BR /&gt; {&lt;BR /&gt; id: 25, // indexSWUServiceArea&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 24, // indexSWUDrainageNetwork&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 23,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 22, // indexMunicipalShaded&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 21, // indexMaintDist&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 20, // indexParcels&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 19, // indexMunicipalBdry&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 18, // indexSwale&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 17, // indexSandFilter&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 16,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 15, // indexMaintJunction&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 14, // indexPretreatDrywell&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 13, // indexDrywellPipe&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 12, // indexDrywell&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 11, // indexDrywellsGroup&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 10, // indexDetentionPond&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 9, // indexCulvertPipe&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 8, // indexCatchBasinPipe&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 7, // indexCatchBasin&lt;BR /&gt; visible: true&lt;BR /&gt; }, {&lt;BR /&gt; id: 6,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 5,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 4,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 3,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 2,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 1,&lt;BR /&gt; visible: false&lt;BR /&gt; }, {&lt;BR /&gt; id: 0,&lt;BR /&gt; visible: false&lt;BR /&gt; }]&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;map.add(lyrMaintPoints);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;// click event on the map checkbox to show features where No Maintenance Record exists&lt;BR /&gt; $('#checkbox-NoMaintRecord').on('click', function (event) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if ($(this).is(":checked")) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(this).parent().addClass('filter-layer');&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerCB = lyrMaintPoints.findSublayerById(indexCatchBasin);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerCB.definitionExpression = defExprCatchBasinNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerCBP = lyrMaintPoints.findSublayerById(indexCatchBasinPipe);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerCBP.definitionExpression = defExprCatchBasinPipeNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerDW = lyrMaintPoints.findSublayerById(indexDrywell);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerDW.definitionExpression = defExprDrywellNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerDWP = lyrMaintPoints.findSublayerById(indexDrywellPipe);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerDWP.definitionExpression = defExprDrywellPipeNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerPrDW = lyrMaintPoints.findSublayerById(indexPretreatDrywell);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerPrDW.definitionExpression = defExprPretreatDrywellNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerSF = lyrMaintPoints.findSublayerById(indexSandFilter);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerSF.definitionExpression = defExprSandFilterNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerSW = lyrMaintPoints.findSublayerById(indexSwale);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerSW.definitionExpression = defExprSwaleNoMaint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexCatchBasin] = defExprCatchBasinNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexCatchBasinPipe] = defExprCatchBasinPipeNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexDrywell] = defExprDrywellNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexDrywellPipe] = defExprDrywellPipeNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexPretreatDrywell] = defExprPretreatDrywellNoMaint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexSandFilter] = defExprSandFilterNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexSwale] = defExprSwaleNoMaint;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyParams.layerDefinitions = identifyLayerDefinitions;&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(this).parent().removeClass('filter-layer');&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerCB = lyrMaintPoints.findSublayerById(indexCatchBasin);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerCB.definitionExpression = defExprCatchBasinAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerCBP = lyrMaintPoints.findSublayerById(indexCatchBasinPipe);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerCBP.definitionExpression = defExprCatchBasinPipeAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerDW = lyrMaintPoints.findSublayerById(indexDrywell);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerDW.definitionExpression = defExprDrywellAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerDWP = lyrMaintPoints.findSublayerById(indexDrywellPipe);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerDWP.definitionExpression = defExprDrywellPipeAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerPrDW = lyrMaintPoints.findSublayerById(indexPretreatDrywell);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerPrDW.definitionExpression = defExprPretreatDrywellAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerSF = lyrMaintPoints.findSublayerById(indexSandFilter);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerSF.definitionExpression = defExprSandFilterAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var sublayerSW = lyrMaintPoints.findSublayerById(indexSwale);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sublayerSW.definitionExpression = defExprSwaleAll;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexCatchBasin] = defExprCatchBasinAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexCatchBasinPipe] = defExprCatchBasinPipeAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexDrywell] = defExprDrywellAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexDrywellPipe] = defExprDrywellPipeAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexPretreatDrywell] = defExprPretreatDrywellAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexSandFilter] = defExprSandFilterAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyLayerDefinitions[indexSwale] = defExprSwaleAll;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;identifyParams.layerDefinitions = identifyLayerDefinitions;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;} // end else stmt&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 21:37:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72993#M6584</guid>
      <dc:creator>LoriEmerson_McCormack</dc:creator>
      <dc:date>2018-02-20T21:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Changing definition expression in 4.x with MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72994#M6585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Try adding&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;lyrMaintPoints.refresh();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 22:00:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72994#M6585</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-20T22:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Changing definition expression in 4.x with MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72995#M6586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion.&amp;nbsp; I tried it and even tried setting a timeout.&lt;/P&gt;&lt;P&gt;setTimeout(refreshFunction, 5000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function refreshFunction() {&lt;BR /&gt; lyrMaintPoints.refresh();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code works fine if I only reset one definition query at a time.&amp;nbsp; If I try resetting the definitionExpression on multiple layers, then the screen won't refresh.&amp;nbsp; Even if I zoom in, the symbols won't resolve to smaller icons.&amp;nbsp; The identifyParams.layerDefinitions changes work fine.&amp;nbsp; It's the layer definitionExpression that seems to be the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The response is extremely slow even when I try toggling the visibility of layers.&amp;nbsp; I used a refresh there as well, and it takes another ten seconds after the refresh before I see results on the screen.&lt;/P&gt;&lt;P&gt;If I try setting the definitionExpression and then toggle layer visibility, the layer visibility doesn't work (because the symbols are frozen from the definitionExpression).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To verify that my definitionExpressions were valid, I tried them all in ArcMap.&amp;nbsp; I also tried them one by on in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The one thing to note about my GIS layers is that some of them are the same feature class but with different definition expressions (e.g., Drywells).&amp;nbsp; Could that be the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 18:50:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72995#M6586</guid>
      <dc:creator>LoriEmerson_McCormack</dc:creator>
      <dc:date>2018-02-21T18:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing definition expression in 4.x with MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72996#M6587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I would suggest commenting out all but one of the def expressions&amp;nbsp;and test and then adding one more each time to try and narrow down the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 13:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72996#M6587</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-22T13:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing definition expression in 4.x with MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72997#M6588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I commented out all of the def expressions except one, and it worked.&amp;nbsp; I tried it for each def expression and they all worked by themselves.&amp;nbsp; I tried with two def expressions, and it worked.&amp;nbsp; I tried it for three def expressions (it worked for some combinations of def expression but not others).&lt;/P&gt;&lt;P&gt;I also tried setting the def expressions using a loop so only one sublayer definition expression was changed at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there is something wrong with setting sublayer definition expressions using 4.6.&amp;nbsp; Perhaps the length of the definition expression strings is exceeded?&lt;/P&gt;&lt;P&gt;Setting the identifyParams.layerDefinitions works fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 22:55:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72997#M6588</guid>
      <dc:creator>LoriEmerson_McCormack</dc:creator>
      <dc:date>2018-02-23T22:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Changing definition expression in 4.x with MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72998#M6589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;So based on what you did, you could not narrow it down to a particular expression then. Sounds like a call to tech support is in order then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 22:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-definition-expression-in-4-x-with/m-p/72998#M6589</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-23T22:59:47Z</dc:date>
    </item>
  </channel>
</rss>

