<?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 How to create a list of rasters contained in an image service in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-list-of-rasters-contained-in-an/m-p/509027#M47312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is a long story but&amp;nbsp;this website was built a few years back using javscript 3.5 API and it is currently broken. &amp;nbsp;So i am hoping some really smart person out there can have a look and help me out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a link to full site. &amp;nbsp;&lt;A class="link-titled" href="http://geonis.lternet.edu/" title="http://geonis.lternet.edu/"&gt;GeoNIS&lt;/A&gt;&amp;nbsp; but the only location that has any data is AND, it is the top one&amp;nbsp;on the list on the right hand side of page. &amp;nbsp;click it to zoom there. &amp;nbsp;or use this&amp;nbsp;link &amp;nbsp;&lt;A class="link-titled" href="http://geonis.lternet.edu/index.html?packageid=knb-lter-and" title="http://geonis.lternet.edu/index.html?packageid=knb-lter-and"&gt;GeoNIS&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here is the&amp;nbsp;problem i am having ...I can not generate&amp;nbsp;the&amp;nbsp;list of rasters that are contained within the imageservice. &amp;nbsp;it seems like the problem is in the section where it is supposed to create a stack of images. &amp;nbsp;I included that section of code &amp;nbsp;below but you can get all the code from the website. &amp;nbsp;The rest of the functionality seems to be working. &amp;nbsp;there is a link for the mapservice with the vector data &amp;nbsp; there is a link to the imageservice with the raster data. &amp;nbsp;there are check boxes for each layer in the mapservice. &amp;nbsp;the images (0) is the problem there are four rasters in there. &amp;nbsp;the package list even works and shows all the information for each layer in both the mapservice and the imageservice. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;jamie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. &amp;nbsp;the coding is pretty messy and it was not me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create the image stack and click handlers for the image menu&lt;BR /&gt; $.getJSON(window.mapInfo.imageUrl + "?f=pjson&amp;amp;callback=?", function (response) {&lt;BR /&gt; if (!response.error) {&lt;BR /&gt; var imageParams = new esri.layers.ImageServiceParameters();&lt;BR /&gt; imageParams.noData = 0;&lt;BR /&gt; window.imageStack = new esri.layers.ArcGISImageServiceLayer(&lt;BR /&gt; mapInfo.imageUrl, {&lt;BR /&gt; id: 'imageStack',&lt;BR /&gt; imageServiceParameters: imageParams,&lt;BR /&gt; opacity: 0.75&lt;BR /&gt; }&lt;BR /&gt; );&lt;BR /&gt; window.imageLayer = true;&lt;BR /&gt; dojo.connect(imageStack, 'onLoad', function (images) {&lt;BR /&gt; var i, imageTitleLink, imageChecks;&lt;BR /&gt; imageTitleLink = $('&amp;lt;a /&amp;gt;')&lt;BR /&gt; .attr('href', '#')&lt;BR /&gt; .text("Images (" + Object.keys(imageData).length + ")")&lt;BR /&gt; .click(function () {&lt;BR /&gt; $('#image-checks').slideToggle('fast');&lt;BR /&gt; });&lt;BR /&gt; $('#image-checks-title').prepend($('&amp;lt;p /&amp;gt;').append(imageTitleLink));&lt;BR /&gt; imageChecks = $('&amp;lt;ul /&amp;gt;').appendTo('#image-checks');&lt;BR /&gt; $.each(imageData, function () {&lt;BR /&gt; checkbox = $('&amp;lt;label /&amp;gt;').text(this.layername).addClass('drop-down-font');&lt;BR /&gt; checkbox.prepend($('&amp;lt;input /&amp;gt;')&lt;BR /&gt; .attr('type', 'checkbox')&lt;BR /&gt; .attr('name', 'checkbox-' + this.layername)&lt;BR /&gt; .attr('id', 'checkbox-' + this.layername)&lt;BR /&gt; .click({'layername': this.layername}, function (event) {&lt;BR /&gt; var visibleImage, mosaicRule;&lt;BR /&gt; if (embeddedMap.layerIds.indexOf('imageStack') !== -1) {&lt;BR /&gt; visibleImage =&lt;BR /&gt; imageStack.mosaicRule.where.split('=')[1].split('\'')[1];&lt;BR /&gt; }&lt;BR /&gt; mosaicRule = new esri.layers.MosaicRule({&lt;BR /&gt; "method": esri.layers.MosaicRule.METHOD_LOCKRASTER,&lt;BR /&gt; "ascending": true,&lt;BR /&gt; "operation": esri.layers.MosaicRule.OPERATION_FIRST,&lt;BR /&gt; "where": "Name='" + event.data.layername + "'"&lt;BR /&gt; });&lt;BR /&gt; imageStack.setMosaicRule(mosaicRule);&lt;BR /&gt; $(event.target).parents().eq(2).find(':checked').prop('checked', false);&lt;BR /&gt; $(event.target).prop('checked', true);&lt;BR /&gt; if (embeddedMap.layerIds.indexOf('imageStack') === -1) {&lt;BR /&gt; embeddedMap.addLayer(imageStack);&lt;BR /&gt; window.imageLayer = true;&lt;BR /&gt; }&lt;BR /&gt; else if (visibleImage === event.data.layername) {&lt;BR /&gt; embeddedMap.removeLayer(&lt;BR /&gt; embeddedMap.getLayer('imageStack')&lt;BR /&gt; );&lt;BR /&gt; $(event.target).parent().children().prop('checked', false);&lt;BR /&gt; window.imageLayer = false;&lt;BR /&gt; }&lt;BR /&gt; $('#active-layers').show();&lt;BR /&gt; $.each(window.imageData, function () {&lt;BR /&gt; $('#image' + this.layername).addClass('hidden');&lt;BR /&gt; });&lt;BR /&gt; $('#image' + event.data.layername).removeClass('hidden');&lt;BR /&gt; $('#image' + event.data.layername).trigger('click');&lt;BR /&gt; if (!window.imageLayer &amp;amp;&amp;amp; layerStack.visibleLayers &amp;amp;&amp;amp;&lt;BR /&gt; layerStack.visibleLayers.length === 1 &amp;amp;&amp;amp;&lt;BR /&gt; (layerStack.layerInfos[layerStack.visibleLayers[0]].name ===&lt;BR /&gt; 'LTER site boundary')) {&lt;BR /&gt; $('#active-layers').hide();&lt;BR /&gt; }&lt;BR /&gt; })&lt;BR /&gt; );&lt;BR /&gt; imageChecks.append($('&amp;lt;li /&amp;gt;').append(checkbox));&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt; $('#image-checks-title').html('&amp;lt;a href="#"&amp;gt;Images (0)&amp;lt;/a&amp;gt;');&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Sep 2016 22:13:36 GMT</pubDate>
    <dc:creator>jamiehollingsworth</dc:creator>
    <dc:date>2016-09-22T22:13:36Z</dc:date>
    <item>
      <title>How to create a list of rasters contained in an image service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-list-of-rasters-contained-in-an/m-p/509027#M47312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is a long story but&amp;nbsp;this website was built a few years back using javscript 3.5 API and it is currently broken. &amp;nbsp;So i am hoping some really smart person out there can have a look and help me out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a link to full site. &amp;nbsp;&lt;A class="link-titled" href="http://geonis.lternet.edu/" title="http://geonis.lternet.edu/"&gt;GeoNIS&lt;/A&gt;&amp;nbsp; but the only location that has any data is AND, it is the top one&amp;nbsp;on the list on the right hand side of page. &amp;nbsp;click it to zoom there. &amp;nbsp;or use this&amp;nbsp;link &amp;nbsp;&lt;A class="link-titled" href="http://geonis.lternet.edu/index.html?packageid=knb-lter-and" title="http://geonis.lternet.edu/index.html?packageid=knb-lter-and"&gt;GeoNIS&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here is the&amp;nbsp;problem i am having ...I can not generate&amp;nbsp;the&amp;nbsp;list of rasters that are contained within the imageservice. &amp;nbsp;it seems like the problem is in the section where it is supposed to create a stack of images. &amp;nbsp;I included that section of code &amp;nbsp;below but you can get all the code from the website. &amp;nbsp;The rest of the functionality seems to be working. &amp;nbsp;there is a link for the mapservice with the vector data &amp;nbsp; there is a link to the imageservice with the raster data. &amp;nbsp;there are check boxes for each layer in the mapservice. &amp;nbsp;the images (0) is the problem there are four rasters in there. &amp;nbsp;the package list even works and shows all the information for each layer in both the mapservice and the imageservice. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;jamie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. &amp;nbsp;the coding is pretty messy and it was not me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create the image stack and click handlers for the image menu&lt;BR /&gt; $.getJSON(window.mapInfo.imageUrl + "?f=pjson&amp;amp;callback=?", function (response) {&lt;BR /&gt; if (!response.error) {&lt;BR /&gt; var imageParams = new esri.layers.ImageServiceParameters();&lt;BR /&gt; imageParams.noData = 0;&lt;BR /&gt; window.imageStack = new esri.layers.ArcGISImageServiceLayer(&lt;BR /&gt; mapInfo.imageUrl, {&lt;BR /&gt; id: 'imageStack',&lt;BR /&gt; imageServiceParameters: imageParams,&lt;BR /&gt; opacity: 0.75&lt;BR /&gt; }&lt;BR /&gt; );&lt;BR /&gt; window.imageLayer = true;&lt;BR /&gt; dojo.connect(imageStack, 'onLoad', function (images) {&lt;BR /&gt; var i, imageTitleLink, imageChecks;&lt;BR /&gt; imageTitleLink = $('&amp;lt;a /&amp;gt;')&lt;BR /&gt; .attr('href', '#')&lt;BR /&gt; .text("Images (" + Object.keys(imageData).length + ")")&lt;BR /&gt; .click(function () {&lt;BR /&gt; $('#image-checks').slideToggle('fast');&lt;BR /&gt; });&lt;BR /&gt; $('#image-checks-title').prepend($('&amp;lt;p /&amp;gt;').append(imageTitleLink));&lt;BR /&gt; imageChecks = $('&amp;lt;ul /&amp;gt;').appendTo('#image-checks');&lt;BR /&gt; $.each(imageData, function () {&lt;BR /&gt; checkbox = $('&amp;lt;label /&amp;gt;').text(this.layername).addClass('drop-down-font');&lt;BR /&gt; checkbox.prepend($('&amp;lt;input /&amp;gt;')&lt;BR /&gt; .attr('type', 'checkbox')&lt;BR /&gt; .attr('name', 'checkbox-' + this.layername)&lt;BR /&gt; .attr('id', 'checkbox-' + this.layername)&lt;BR /&gt; .click({'layername': this.layername}, function (event) {&lt;BR /&gt; var visibleImage, mosaicRule;&lt;BR /&gt; if (embeddedMap.layerIds.indexOf('imageStack') !== -1) {&lt;BR /&gt; visibleImage =&lt;BR /&gt; imageStack.mosaicRule.where.split('=')[1].split('\'')[1];&lt;BR /&gt; }&lt;BR /&gt; mosaicRule = new esri.layers.MosaicRule({&lt;BR /&gt; "method": esri.layers.MosaicRule.METHOD_LOCKRASTER,&lt;BR /&gt; "ascending": true,&lt;BR /&gt; "operation": esri.layers.MosaicRule.OPERATION_FIRST,&lt;BR /&gt; "where": "Name='" + event.data.layername + "'"&lt;BR /&gt; });&lt;BR /&gt; imageStack.setMosaicRule(mosaicRule);&lt;BR /&gt; $(event.target).parents().eq(2).find(':checked').prop('checked', false);&lt;BR /&gt; $(event.target).prop('checked', true);&lt;BR /&gt; if (embeddedMap.layerIds.indexOf('imageStack') === -1) {&lt;BR /&gt; embeddedMap.addLayer(imageStack);&lt;BR /&gt; window.imageLayer = true;&lt;BR /&gt; }&lt;BR /&gt; else if (visibleImage === event.data.layername) {&lt;BR /&gt; embeddedMap.removeLayer(&lt;BR /&gt; embeddedMap.getLayer('imageStack')&lt;BR /&gt; );&lt;BR /&gt; $(event.target).parent().children().prop('checked', false);&lt;BR /&gt; window.imageLayer = false;&lt;BR /&gt; }&lt;BR /&gt; $('#active-layers').show();&lt;BR /&gt; $.each(window.imageData, function () {&lt;BR /&gt; $('#image' + this.layername).addClass('hidden');&lt;BR /&gt; });&lt;BR /&gt; $('#image' + event.data.layername).removeClass('hidden');&lt;BR /&gt; $('#image' + event.data.layername).trigger('click');&lt;BR /&gt; if (!window.imageLayer &amp;amp;&amp;amp; layerStack.visibleLayers &amp;amp;&amp;amp;&lt;BR /&gt; layerStack.visibleLayers.length === 1 &amp;amp;&amp;amp;&lt;BR /&gt; (layerStack.layerInfos[layerStack.visibleLayers[0]].name ===&lt;BR /&gt; 'LTER site boundary')) {&lt;BR /&gt; $('#active-layers').hide();&lt;BR /&gt; }&lt;BR /&gt; })&lt;BR /&gt; );&lt;BR /&gt; imageChecks.append($('&amp;lt;li /&amp;gt;').append(checkbox));&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt; $('#image-checks-title').html('&amp;lt;a href="#"&amp;gt;Images (0)&amp;lt;/a&amp;gt;');&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 22:13:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-list-of-rasters-contained-in-an/m-p/509027#M47312</guid>
      <dc:creator>jamiehollingsworth</dc:creator>
      <dc:date>2016-09-22T22:13:36Z</dc:date>
    </item>
  </channel>
</rss>

