Kelly,
Hello. I was wondering can the mediaInfos that works with the PopupTemplate work with the infotemplate in the example you helped me with?
like this example:
http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=query_dojochart
I would like to be able to insert a chart.
Thanks
Robert,
Sure you can just replace the InfoTemplate with esri/dijit/PopupTemplate and then you can use mediaquery. Here's an example:
var taxParcelTemplate = new PopupTemplate({ title: "{Postal Address}", description: "Owner of record: {First Owner Name}", mediaInfos:[{ type: "barchart", value:{ fields:["Current Assessed Value", "Current Summer Taxes Owed", "Current Taxable Value", "Current Winter Taxes Owed"] } }] }); feature.setInfoTemplate(taxParcelTemplate);
Kelly,
If it would have been a snake it would have bit me! Sheesh. Thanks again. I think I get caught up in looking at too many examples instead of just looking at what I already have. Thanks again for your quick response.
If you are interested in what I am doing here is a link to a draft.
http://uwmaps.wygisc.org/WRDS/index.html#
the very last button on the right bottom has some identify tools the last layer called PRISM data 30yr precipitation is the one I used with the charting.
Thanks again!
Robert Kirkwood
Wyoming Geographic Information Science Center
University of Wyoming | Agriculture C, Rm 321
Phone: (307) 766-6281 | Cell: (307) 399-8094
p.s. not the last button but the one above the globe Icon
Robert Kirkwood
Wyoming Geographic Information Science Center
University of Wyoming | Agriculture C, Rm 321
Phone: (307) 766-6281 | Cell: (307) 399-8094
perfect!
One option might be to just add the layers you want to query to your application as feature layers in Selection only mode. When you add each feature layer define the info template for that layer. Note that in this example we don't have to query for attachment info because we've set showAttachments to true when defining the info template for the feature layer that has attachments. Then when you click the map you can use the feature layer's selectFeatures method to select the features of interest and display them in the popup.
Here's a jsfiddle that shows this:
http://jsfiddle.net/Wav9r/
parcelInfoTemplate = new esri.InfoTemplate(); parcelInfoTemplate.setTitle("Parcel Information"); parcelInfoTemplate.setContent(parcelSetWindowContent);
function doIdentify(event){ map.infoWindow.hide(); map.graphics.clear(); labelPt = event.mapPoint; parcelIdentifyParams.geometry = event.mapPoint; parcelIdentifyParams.mapExtent = map.extent; var deferred = parcelIdentifyTask.execute(parcelIdentifyParams); deferred.addCallback(function(response){ var feature = response[0].feature; showInfoWindow(feature,labelPt); }); } } function showInfoWindow (feature, labelPt) { feature.setInfoTemplate(parcelInfoTemplate); map.infoWindow.setTitle("Parcel Information"); map.infoWindow.setContent(feature.getContent()); map.infoWindow.show(labelPt); } function parcelSetWindowContent(graphic) { var nameTest1 = graphic.attributes.NAME1; var addressTest = graphic.attributes.SITEADDRES; var addressTest2 = graphic.attributes.SITEADDRESS;//very freaky that some seem to have one 's' and other two var legalTest1 = graphic.attributes.LEGAL1; var legalTest2 = graphic.attributes.LEGAL2; var legalTest3 = graphic.attributes.LEGAL3; var legalTest4 = graphic.attributes.LEGAL4; var fullLegalString; var twpRangeSecString; var twpTest = graphic.attributes.TOWNSHIP; var rngTest = graphic.attributes.RANGE; var secTest = graphic.attributes.SECTION; if (twpTest != 'undefined' && twpTest != 'Null') { twpRangeSecString = "TWP:" + graphic.attributes.TOWNSHIP; } if (rngTest != 'undefined' && rngTest != 'Null') { twpRangeSecString = twpRangeSecString + " RNG:" + graphic.attributes.RANGE; } if (secTest != 'undefined' && secTest != 'Null') { twpRangeSecString = twpRangeSecString + " SEC: " + graphic.attributes.SECTION; } var acreageTest = graphic.attributes.ACRES; var buildingNameTest = graphic.attributes.BUILDING_NAME; var bookTest = graphic.attributes.BOOK1; var pageTest = graphic.attributes.PAGE1; var initString = "";//used to see if there is really any content in the attribute values //There is problem with Null being detected as a 4 character length string instead of just nothing //checking to see if the value is longer than 4 characters because of this initTable = "<table id='infoWindowTable' data-dojo-type='dojox.grid.DataGrid' class='infoTable' ><tr><th></th><th></th></tr>"; if (nameTest1.length > 1) { initTable = initTable + "<tr><td><b>Owner:</b></td><td>" + nameTest1+ "</td></tr>"; initString = nameTest1; } if (buildingNameTest) { if (buildingNameTest.length > 4) { initTable = initTable + "<tr><td><b>Building:</b></td><td>" + buildingNameTest+ "</td></tr>"; initString = initString + buildingNameTest; } } if (addressTest) { if (addressTest.length > 4) { initTable = initTable + "<tr><td><b>Site Address:</b></td><td>" + addressTest + "</td></tr>"; initString = initString + addressTest; } } if (addressTest2) { if (addressTest2.length > 4) { initTable = initTable + "<tr><td><b>Site Address:</b></td><td>" + addressTest2 + "</td></tr>"; initString = initString + addressTest2; } } initTable = initTable + "</table><br><a id='btnZoom' onClick='zoomTo();'>Zoom To</a>"; //some counties provided so little information in a field that there wasn't enough information to put //in an infoWindow if (initString.length < 3) { initTable = "Limited data provided, see side panel."; } return initTable; }