<?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 Raster Layer: Change FilePath in ArcGIS Server with JavaScript API Questions</title>
    <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/raster-layer-change-filepath/m-p/828232#M467</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to dinamically change the file displayed in a raster layer, using javascript API .&lt;/P&gt;&lt;P&gt;How can I do that ?&lt;/P&gt;&lt;P&gt;I can point to the sublayer, but I can not see this property to change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import MapView from 'esri/views/MapView'&lt;BR /&gt;import EsriMap from 'esri/Map'&lt;BR /&gt;import MapImageLayer from 'esri/layers/MapImageLayer'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;let mapCtrl&lt;BR /&gt;let objMap&lt;BR /&gt;let objLayer&lt;/P&gt;&lt;P&gt;const createMap = (state, action) =&amp;gt; {&lt;BR /&gt; objLayer = new MapImageLayer({ url:'http://rjgis01.reger.ons:6080/arcgis/rest/services/Mapa_GIS/MapServer' })&lt;/P&gt;&lt;P&gt;objMap = new EsriMap({&lt;BR /&gt; basemap: 'gray',&lt;BR /&gt; layers: [objLayer]&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;mapCtrl = new MapView({&lt;BR /&gt; container: action.domNode,&lt;BR /&gt; map: objMap,&lt;BR /&gt; zoom:5,&lt;BR /&gt; center:[-58.13, -14.30]&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; return { ...state, mapCtrl }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;const filterMap = (state, action) =&amp;gt; {&lt;/P&gt;&lt;P&gt;objLayer.when(function() {&lt;BR /&gt; objLayer.sublayers.map(function(grouplayers) {&lt;BR /&gt; grouplayers.sublayers.map(function(sublayer){&lt;BR /&gt; if (sublayer.title.indexOf('Raster Prob') &amp;gt; -1)&lt;BR /&gt; {&lt;BR /&gt; console.log('sublayer.source.type = ' + sublayer.source.type)&lt;BR /&gt; console.log('sublayer.datasource = ' + sublayer.datasource)&lt;BR /&gt; sublayer.visible = true&lt;BR /&gt; }&lt;BR /&gt; })&lt;BR /&gt; })&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;return state&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;const map = (state = INITIAL_STATE, action) =&amp;gt; {&lt;BR /&gt; switch (action.type) {&lt;BR /&gt; case 'CREATE_MAP':&lt;BR /&gt; return createMap(state, action)&lt;BR /&gt; case 'FILTER_MAP':&lt;BR /&gt; return filterMap(state, action)&lt;BR /&gt; default:&lt;BR /&gt; return state&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;export default map&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 May 2019 20:06:45 GMT</pubDate>
    <dc:creator>LiglioCavalcante</dc:creator>
    <dc:date>2019-05-13T20:06:45Z</dc:date>
    <item>
      <title>Raster Layer: Change FilePath</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/raster-layer-change-filepath/m-p/828232#M467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to dinamically change the file displayed in a raster layer, using javascript API .&lt;/P&gt;&lt;P&gt;How can I do that ?&lt;/P&gt;&lt;P&gt;I can point to the sublayer, but I can not see this property to change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import MapView from 'esri/views/MapView'&lt;BR /&gt;import EsriMap from 'esri/Map'&lt;BR /&gt;import MapImageLayer from 'esri/layers/MapImageLayer'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;let mapCtrl&lt;BR /&gt;let objMap&lt;BR /&gt;let objLayer&lt;/P&gt;&lt;P&gt;const createMap = (state, action) =&amp;gt; {&lt;BR /&gt; objLayer = new MapImageLayer({ url:'http://rjgis01.reger.ons:6080/arcgis/rest/services/Mapa_GIS/MapServer' })&lt;/P&gt;&lt;P&gt;objMap = new EsriMap({&lt;BR /&gt; basemap: 'gray',&lt;BR /&gt; layers: [objLayer]&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;mapCtrl = new MapView({&lt;BR /&gt; container: action.domNode,&lt;BR /&gt; map: objMap,&lt;BR /&gt; zoom:5,&lt;BR /&gt; center:[-58.13, -14.30]&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; return { ...state, mapCtrl }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;const filterMap = (state, action) =&amp;gt; {&lt;/P&gt;&lt;P&gt;objLayer.when(function() {&lt;BR /&gt; objLayer.sublayers.map(function(grouplayers) {&lt;BR /&gt; grouplayers.sublayers.map(function(sublayer){&lt;BR /&gt; if (sublayer.title.indexOf('Raster Prob') &amp;gt; -1)&lt;BR /&gt; {&lt;BR /&gt; console.log('sublayer.source.type = ' + sublayer.source.type)&lt;BR /&gt; console.log('sublayer.datasource = ' + sublayer.datasource)&lt;BR /&gt; sublayer.visible = true&lt;BR /&gt; }&lt;BR /&gt; })&lt;BR /&gt; })&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;return state&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;const map = (state = INITIAL_STATE, action) =&amp;gt; {&lt;BR /&gt; switch (action.type) {&lt;BR /&gt; case 'CREATE_MAP':&lt;BR /&gt; return createMap(state, action)&lt;BR /&gt; case 'FILTER_MAP':&lt;BR /&gt; return filterMap(state, action)&lt;BR /&gt; default:&lt;BR /&gt; return state&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;export default map&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2019 20:06:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/raster-layer-change-filepath/m-p/828232#M467</guid>
      <dc:creator>LiglioCavalcante</dc:creator>
      <dc:date>2019-05-13T20:06:45Z</dc:date>
    </item>
  </channel>
</rss>

