Feature Layer and its related Thumbnails

2498
22
Jump to solution
02-12-2019 01:36 PM
JuliermePinheiro
New Contributor III

Hi,

I am trying to display a feature layer thumbnail in a <div id="quickLook"></div>. On click or next feature button click I want to display the layer thumbnail. The path for the thumbnail is in a GeoJSON Attribute <thumbnail>. I am hitting a wall trying to figure out to accomplish that. My first attempt bellow was not successful:

function createForestLayer(graphics) {
        if (graphics) {
          wgs84Graphics = graphics;
        } else {
          graphics = wgs84Graphics;
        }
        // display projected graphics as a FeatureLayer
        countriesLayer = new FeatureLayer({
          title: "esri",
          source: graphics,
          objectIdField: "OBJECTID",
          fields: myFields,

          renderer: myRenderer,

          popupTemplate: myPopup,

          template: createTemplate

 })

function createTemplate(){
const myFeatureTemplate = new FeatureTemplates({

container: "quickLook",
layers: countriesLayer,
filterFunction: createItem
});
}


function createItem(){
const myTemplate = new TemplateItem({
layer: countriesLayer,
template: myFeatureTemplate,
thumbnail: {
contentType: "png",
imageData: "./data/satellite.png",
height: 300,
width: 300
}
});
}

Any help on that will be very appreciated

Kind regards

Julierme

22 Replies
JuliermePinheiro
New Contributor III

Wonderful Job, Mr. Scheitlin.

Thank you very much for your help.

I appreciated it. Just amazing work.

Greetings from Brazil.

I will be glad to pay for your support.

Kind regards

Julierme

0 Kudos
JuliermePinheiro
New Contributor III

Dear Mr. Scheitlin,

Thank you very much for your reply. Please, rename the file from

./script/satellite_path.txt to ./script/satellite_path.js

Find attached the hole project. Just unzip the file in your web server.

Kind regards

Julierme

On Thu, Feb 28, 2019 at 11:53 AM Robert Scheitlin, GISP <geonet@esri.com>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

OK thanks for all the files. The fix is still my last post to you.

0 Kudos