|
POST
|
I rely on the user forums so much when I'm trying to learn a new API, so I've been working to give back a little. Glad it helped. Grids are hard in particular, I think, because the 3 I see regularly, dojox/grid/datagrid, dojox/grid/EnhancedGrid and dGrid look so much the same at a glance, but they are not!
... View more
11-18-2013
09:35 AM
|
0
|
0
|
1243
|
|
POST
|
I think I realized what I did wrong. I emptied the 4.6.0 folder first and then put the contents of the download in its place. I went back and copy/pasted from the downloaded file, letting it overwrite as it wanted. I'm not seeing the error anymore.
... View more
11-15-2013
10:48 AM
|
0
|
0
|
1680
|
|
POST
|
I was leaning toward replacing the contents, because otherwise why might you want to make a copy first? Here's what I did: I went to the link http://www.adobe.com/devnet/air/air-sdk-download.html and downloaded something that was called "Adobe AIR SDK & Compiler (version 3.9)" That seemed to be the latest and greatest, it didn't seem like I should have to go into some archive to get an older file. There is mention of something 'for Flex users', but I assume that is for people that are maybe developing in some other IDE? I unzipped this and put the contents into my existing folder C:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0, replacing all the files that were in their originally. When I got to the steps of creating a new Mobile project, I left this as my SDK, because didn't I just replace it's contents? And I specified the SWC file for the 3.4 API from ESRI because it sounds like 3.5 is for AGS 10.1 and I'm still at 10.0. I followed all the steps Next > Next > etc until I have a new empty project. At this point, even before I put any content into the mxml file, I'm getting an error: Cannot resolve attribute 'firstView' for component type spark.components.Application. Researching a bit on this, it sounds like the problem is related to either not the right version of the SDK or something related to how I have it configured. So I'm not getting very far!
... View more
11-15-2013
10:18 AM
|
0
|
0
|
1680
|
|
POST
|
I've been away from the Flex API for a while, but I need to learn how to create a mobile app, and this environment still seems to be the way to go. In the instructions for Mobile specific application https://developers.arcgis.com/en/flex/guide/tutorial-mobile-specific-application.htm it says that I need to overlay the updated Adobe AIR SDK on the FLEX SDK. I've read all the instructions on the links that are offered and I still don't get it. Where am I supposed to put the AIRSDK file that I downloaded? I have Adobe Flash Builder 4.6, so the current SDK is located under C:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0 Do I still keep this folder and put the AIR sdk in the skds folder? Replace the contents of the folder 4.6.0 with what I downloaded?
... View more
11-15-2013
09:17 AM
|
0
|
6
|
2655
|
|
POST
|
I rearranged your function and added some styles, just to make sure you had something defined on your grid. I've had problems with grids if I don't have some of these defined: .resultsGrid { } .resultsGrid .dgrid-cell { width: 100px; } .resultsGrid .dgrid-scroller { max-height: 200px; overflow: auto; position: relative; } Here's the rearranged function. It is populating now for me. I moved the definition of the grid into the function as well. Don't forget you need startup after you declare your grid. function populateNorthGrid() { // create query task var queryTaskNorth = new QueryTask(window.northParcelSched); // create query var queryNorthTable = new Query(); queryNorthTable.where = "1=1"; //SQL Query: use the field name like in the attribute table, and then the attibute you want to pull out //queryNorthTable.outFields = ["*"]; queryNorthTable.outFields = ["Date", "Event", 'OBJECTID']; queryNorthTable.spatialReference = new SpatialReference({wkid: 102100 }); // execute the query task // create an object that holds the data from table queryTaskNorth.execute(queryNorthTable, function(results) { var northTableData = array.map(results.features, function(feature) { return { // the fields in order as they are shown on the attribute table "dateField": feature.attributes.Date, "eventField": feature.attributes.Event, "id":feature.attributes.OBJECTID }; // return feature.attributes; }); // create new memory store to hold data // use tableData object to populate it // console.log(northTableData); var northMemoryStore = new Memory({ data: northTableData, idProperty:'OBJECTID' }); var northSchedGrid = new (declare([Grid, Selection]))({ bufferRows: Infinity, // make sure all rows from table show up columns: { //"id": "OBJECTID", "dateField": "Date", // specify the display names "eventField": "Event" }, store: northMemoryStore, class: 'resultsGrid' }, "northSchedGridDIV"); // northSchedGrid.set("store", northMemoryStore); northSchedGrid.startup(); }); }
... View more
11-15-2013
07:08 AM
|
0
|
0
|
1243
|
|
POST
|
You're losing me here. Which one are you trying to troubleshoot? The one called finalApp.html? I can see that the query task isn't executing at all with the map.on load event. I'm not sure you have specified all the minimum parameters you need in your Query, so you have no results because the querytask isn't ever executing. I added a "esri/SpatialReference" and added this to the definition of queryNorthTable
queryNorthTable.spatialReference = new SpatialReference({wkid: 102100 });
At least now it executes. Why are you passing Memory as a argument to the populateNorthGrid function? I don't see that it's necessary at all. I also believe that an idProperty is required for your Memory definition. You should probably include that in your outFields definition.
var northMemoryStore = new Memory({ data: northTableData, idProperty:'OBJECTID' });
... View more
11-15-2013
06:43 AM
|
0
|
0
|
1243
|
|
POST
|
Occasionally I do have my request time out while generating the PDF. I haven't been able to pin it to whether it's my browser, or the way I have my print service defined. It's not consistent enough to be repeatable by others in my office who have tried it. I tried both synchronous and asynchronous configuration. I wanted to have it set as asynchronous, but for some reason that never did work for me, so I had to switch. It's also more of a problem on our production server as opposed to test, so maybe it's a permission problem too. I think the whole function is in the other thread. Here's the relevant section where the name is specified.
var printTask = new PrintTask(printServiceUrl,printParams);
deferred = printTask.execute(printParams);
deferred.addCallback(function (response){
var d = new Date();
var dateTime = d.getTime();
var outputUrl = response.url + '?time=' + dateTime;
status.innerHTML = "";
var select = registry.byId("templateSelect");
var selectOptions = select.getOptions();
select.set("value", "Choose Print Format");
window.open(outputUrl,"_blank");
});
... View more
11-13-2013
04:36 AM
|
0
|
0
|
2441
|
|
POST
|
I had a similar problem myself. Basically the PDF getting generated don't have unique names on them. As the temporary files are cleared out (something that is happening on the AGS server side), the names are re-used. But the browser remembers the name from before and shows you what it cached. I had started out using the print widget, but switched to printTask instead. That way I was able to control the name of the output PDF, adding a date stamp that would make the name unique. Then the browser wouldn't be drawing old cached PDFs. This is maybe fixed at 10.2, but I'm still at 10.1. Here's a thread where this was discussed: http://forums.arcgis.com/threads/87125-Synchronous-Custom-Printing-output-names-are-not-unique?highlight=printtask+PDF
... View more
11-12-2013
07:18 AM
|
0
|
0
|
2441
|
|
POST
|
I don't think there's a really elegant way to do it, but you should be able to at least have the graphic appear highlighted on the right feature. There are multiple ways to define infoTemplates, popups etc, so I don't know if the way I go about it fits into what you have done or not. You may have all this established in your code already, but here's how I go about it: I like a large yellow circle with a transparency on it so it stands out. I define my symbol at beginning, along with my popup, which I use in my map definition.
highlightMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255,255,0]), 2),
new Color([255,255,0,0.5]));
var popup = new Popup({
fillSymbol: new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,200,0]), 2), new Color([255,255,0,0.30])) ,
markerSymbol: highlightMarkerSymbol
}, dojo.create("div"));
map = new Map("mapDiv", {
basemap: "topo",
center: [-92.593, 38.5],
infoWindow:popup,
sliderPosition: "top-left",
sliderStyle: "large",
zoom: 7
});
I'm not using a featurelayer, I'm just defining the infoTemplate in the results handler of my Identify Task. Since I'm clicking on the map, and I have my infoWindow defined as popup in my map constructor, this is giving me my highlight symbol automatically without explicitly telling it to 'draw a graphic'. This example looks a little different because I have my Identify set as deferred with 'promise/all' so I had to also manage which layer my identify was coming from
var formatResults = arrayUtils.map(results, function(result){
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = result.layerName;
feature.setInfoTemplate(generateInfoTemplate);
generateInfoTemplate.setTitle("Layer Information");//don't need a graphic, it's drawing from the infoWindow:popup in the map constructor
return feature;
});
if (formatResults.length === 0) {
map.infoWindow.clearFeatures();
} else {
map.infoWindow.setFeatures(formatResults);
map.infoWindow.show(idPoint);
}
{/CODE]
When I'm outside the map, in my grid, the items in that list aren't aware they are associated with a graphic, they're just data. But the data includes the objectID, so I'm running a query to get back to what the corresponding graphic is. This is a function that needs to work from one of two grids I have, so there's extra lines and incoming parameters here:
//highlights the feature when the user selects from the grid
function highlightFeatureFromGrid(event, dGrid, qTask) {
app.map.graphics.clear();
app.map.infoWindow.hide();
var row = dGrid.row(event);
var query = new Query();
var objid = [row.data.objectid];
query.where = "OBJECTID = " + objid;
query.returnGeometry = true;
query.outFields = ["*"];
query.outSpatialReference = spatialReference;
qTask.execute(query, function (results) {
var feature = results.features[0];//should only be on feature by that id in that layer
var graphic;
if (results.displayFieldName == 'VENDORID'){
feature.setInfoTemplate(venInfoTemplate);
}else {
feature.setInfoTemplate(offSatInfoTemplate);
}
app.map.centerAndZoom(feature.geometry, 12);
graphic = new Graphic(feature.geometry, highlightMarkerSymbol,feature.attributes, feature.infoTemplate);
app.map.graphics.add(graphic);
app.map.infoWindow.setContent(feature.getContent());
app.map.infoWindow.setTitle(feature.getTitle());
app.map.infoWindow.show(feature.geometry);
});
}
Assuming that gfx in your example is an esri Graphic and not something else, you ought to be able to just construct and draw a new Graphic over the top using the parameters of the existing one. It ain't elegant, but it works.
... View more
11-07-2013
12:48 PM
|
0
|
0
|
1886
|
|
POST
|
That sounds like wishful thinking. To me, graphics are all just something short lived, so I'm not surprised to have to continually recreate and clear them as I go.
... View more
11-07-2013
11:39 AM
|
0
|
0
|
1886
|
|
POST
|
I'm not sure if I'm following your question exactly, but the short answer is you ought to be able to use a mix of infoTemplate and infoWindow.show. You mention clicking on a list, how are you determining which feature that it goes with, featureLayer.selectFeatures? QueryTask? When I'm selecting from something external to the map, it's almost always a grid. I select the feature from the map based on a queryTask. To see the highlighted symbol, I've been creating a graphic, using the geometry of the results of that query, adding it right before I set the infoWindow content. And at the top of that function I always hide the infoWindow and clear the map graphics, so I don't have the symbol from a previous click.
... View more
11-07-2013
07:48 AM
|
0
|
0
|
1886
|
|
POST
|
I'm glad you got it figured out. I have gotten turned around before with what class 'result' is that's getting returned. Depending on what the task was you just executed, it isn't always the same. Once I realized that, I started putting breakpoints in at the very top of my callback handler so I check right away, instead of focusing several lines down.
... View more
11-07-2013
07:27 AM
|
0
|
0
|
2165
|
|
POST
|
I can get the map to open, but your services must not be public facing because nothing loads after the frame.
... View more
11-06-2013
04:29 AM
|
0
|
0
|
2165
|
|
POST
|
Maybe this is too obvious, but do you have variables for graphic and graphicsLayer defined earlier? I'm forever leaving out that little word 'var' when I get in a hurry.
... View more
11-05-2013
11:37 AM
|
0
|
0
|
2165
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|