|
POST
|
Try using a function outside of the dojo.connect code block instead of an inline function? Maybe the code is "running over" the deferred part. I've had this happen to me with other aspects of using the javascript API. At any rate, I'm using this technique in the apps I'm working on and it works for me. [EDIT] Noticed that you're using popup templates. My example and my background has been with infoTemplates so I don't know if that's making any difference..
... View more
01-25-2013
08:28 AM
|
0
|
0
|
3249
|
|
POST
|
I'm just wondering out loud here but would "graphic.attributes " also work (where x=column number of desired attribute field)?
... View more
01-25-2013
07:49 AM
|
0
|
0
|
991
|
|
POST
|
It certainly is possible. First, you'll need to define infoTemplates for each feature layer: var template1 = new esri.InfoTemplate();
template1.setContent(SetFeatureLayer1PopupInfo); //call function to set the content
template1.setTitle('Some generic title or another function');
var template2 = new esri.InfoTemplate();
template2.setContent(SetFeatureLayer2PopupInfo); //call function to set the content
template2.setTitle('Some generic title or another function'); Now, when you create your feature layers, you just choose the appropriate infoTemplate and then do the dojo.connect as usual: theFeatureLayer1 = new esri.layers.FeatureLayer("REST Url", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: template1,
outFields: ["*"],
visible: true
});
theFeatureLayer2 = new esri.layers.FeatureLayer("REST Url", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
infoTemplate: template2,
outFields: ["*"],
visible: true
});
dojo.connect(theFeatureLayer1, "onClick", function(evt) {
var query = new esri.tasks.Query();
query.geometry = pointToExtent(map,evt.mapPoint,10);
var deferred = theFeatureLayer1.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
map.infoWindow.resize(550,350);
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}); Later in your code will be the function to create the popup content: function SetFeatureLayer1PopupInfo(graphic) {
fullAttr = graphic.attributes;
someval = fullAttr.FIELDNAME;
content = '<table><tr><td>Field Name:</td><td>' + someval + '</td><tr></table>';
return content;
}
... View more
01-25-2013
07:39 AM
|
0
|
0
|
3249
|
|
POST
|
Jeff, We just did the registration process with ArcGIS Server like you mentioned and it finally looks like it's updating. Marked as answered. Moderators- Feel free to move this thread as Jeff suggested.
... View more
01-11-2013
12:44 PM
|
0
|
0
|
802
|
|
POST
|
This issue is driving me CRAZY and I'm at a lost to explain it, let alone know how to correct it. I'm developing a web map which will report back stream gage heights. That data is stored natively in an Access database but I have a python script which does a bulk extract every 5 minutes and then transfers the records into a standalone table in SDE. The data has an Epoch timestamp so I can confirm that the data inside the standalone table is current. One of the map requirements was that the gages on our map were symbolized by color based on their current flood stage. To facilitate this, I build the layer on the fly as a FeatureLayer using a FeatureCollection whose source is the standalone table previously mentioned. Last bit of context is that the standalone table is a layer tucked within a published map service with two other point datasets. My system was working fine when we still were running ArcGIS Server 10 but since we upgraded to 10.1, my mapped information is stale. At first, I thought the issue might be that the standalone table consistently has over 2,000 records and the map service had a MaxRecordCount of 1,000. We bumped that up to 5,000 for the map service but the individual layer still shows a MaxRecordCount of 1,000 when viewing its properties in the REST services directory. Through some testing, I think I can say that this is not the problem. I performed a query using "1=1" and it returned the 2,000+ records. So I'm left with a situation where my data is just "stale." I'm not responsible for the installation/maintenance of our ArcGIS Server but the person who is told me that one of the changes from 10 to 10.1 is that Server now pulls data locally onto the server. I'm starting to wonder if my app just keeps pointing back to a cached copy of the table's records?? My app has briefly worked twice under 10.1 and both times were immediately after deleting and re-adding the map service that includes the table. This behavior is what leads me to think that I'm a victim of cached data. How can I remedy this??? The app is still in development and not on the public side of our firewall, unfortunately. Steve
... View more
01-11-2013
08:13 AM
|
0
|
2
|
1189
|
|
POST
|
Trying to utilize the TableDataSource but I have no clue what the WorkspaceID is and where it can be found. The help docs don't have much to say about it. I'm trying to access a standalone table located in v10 SDE. Is it simply the name of the SDE database?? Thanks- Steve
... View more
01-10-2013
12:49 PM
|
0
|
2
|
1133
|
|
POST
|
Elena- Did you ever solve your problem? I'm now facing the same thing- my map service has the 5,000 feature limit set but a layer within the service I REALLY need still shows 1,000. Steve
... View more
01-10-2013
08:12 AM
|
0
|
0
|
1695
|
|
POST
|
Cool- I'm glad you've got things going. Regarding the alignment, you can add some CSS aligning options in the style="" portion of the HTML code I suggested for which ever part of the HTML table needs it (table header (TH), table row (TR), table data (TD)): text-align: <left|center|right> If you also need to tweak the vertical alignment, add one of these CSS options as well: vertical-align: <top|center|bottom> HTML Tables have an ALIGN and VALIGN option but it's been depreciated in favor of the CSS formatting tags. These old options will work unless you're working with HTML 5. W3 HTML TD Tag Reference
... View more
01-07-2013
06:12 AM
|
0
|
0
|
2068
|
|
POST
|
I would follow the approach you have so far with just a couple tweaks. Here's my two cents: Use your printIt function but pass the datagrid object instead of it's innerHtml Inside of the function, loop through the rows in your dataGrid and then add rows to an HTML table I can't guarantee this code works since I'm not at work and don't have access to my own datagrid related code but hopefully you can see what I'm thinking: function printIt(myGrid)
{
var win = window.open();
self.focus();
win.document.open();
win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>');
win.document.write('body, td { font-family: Verdana; font-size: 12pt;}');
win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>');
win.document.write('<table style=\"width:100%\"><th style=\"font-weight:bold\">Facility</th><th style=\"font-weight:bold\">Address</th><th style=\"font-weight:bold\">City</th><th style=\"font-weight:bold\">Phone</th>');
myGrid.store.fetch({
onComplete: function (items) {
dojo.forEach(items, function (item, index) { ...
win.document.write('<tr><td>' + item.FACILITY + '</td><td>' + item.ADDRESS + '</td><td>' + item.CITY + '</td><td>' + item.PHONE + '</td></tr>');
})
}
});
win.document.write('</table>');
win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>');
win.document.close();
win.print();
win.close();
}
... View more
01-04-2013
04:33 PM
|
0
|
0
|
2068
|
|
POST
|
Hi Chris, Glad the code helped you! I'm currently on vacation until next week so I can't try anything but I don't have quick answer for you right now. I remember wanting to change the background color of the tooltip as well without success. I'll try to look at it again next week but, for now, you might want to try an inspect the Dojo CSS. You might have to override the default CSS with "!important" in your own CSS file. Maybe that's why specifying via javascript object properties isn't working?...
... View more
01-04-2013
11:45 AM
|
0
|
0
|
3772
|
|
POST
|
Does this thread answer your question? It uses esri.graphicsExtent() based on the selected featureset
... View more
01-03-2013
05:29 PM
|
0
|
0
|
646
|
|
POST
|
Hi Kelly, Yes- you are correct- it is a layer based on a feature collection. I missed that note in the API reference. So do I have any other options for querying my layer besides objectId? In my app, the feature collection gets replaced every 5 minutes after a new query to a database so I don't think I can use objectIDs as a viable query tool. I only have 8-12 features (they're stream gages) so I can just loop through the features but I'm just curious what to do if your feature collection has a lot more features in it. Thanks! Steve
... View more
12-22-2012
06:49 PM
|
0
|
0
|
651
|
|
POST
|
So here's a weird one. I have a little function to zoom to the extent of a point feature based on the ID provided to the function. In it's original form, the function took the FID as the passed parameter like so: function zoomPointRow(id){
thePointLayer.clearSelection();
var query = new esri.tasks.Query();
query.objectIds = [id];
thePointLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){
var thePoint = features[0].geometry;
var theExtent = pointToExtent(map,thePoint,10);
map.setExtent(theExtent);
});
}; This works fine and worked fine with my current project until I had to change things slightly. In my new project, I'm trying to use this function with a featureLayer that I build on the fly when the map loads (like if you were importing a JSON feed, etc). Instead of using FID, I decided to just alter the query to search for an attribute value associated with the feature like this: function zoomRow(id){
theFeatureLayer.clearSelection();
var query = new esri.tasks.Query();
query.where = "SENSORID=" + id;
theFeatureLayer.queryFeatures(query,function(features){
gagePoint = features[0].geometry;
theExtent = pointToExtent(map,gagePoint,10);
map.setExtent(theExtent);
});
}; The function is called from the onClick event of an HTML <a> tag. Now, when I click my link to fire off the function, I get the following error in the console: "Error: FeatureLayer::_query - query contains one or more unsupported parameters http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/layers/FeatureLayer.xd.js Line 19" It can't get any more simpler than this so what gives? Unfortunately, the app in development is not on the public side of the firewall.. Thanks! Steve [EDIT] I should say that I changed the code from selectFeatures to queryFeatures in attempts to try different things. Both methods return the same error.
... View more
12-21-2012
11:07 AM
|
0
|
2
|
1124
|
|
POST
|
Slightly off topic but shoot- if anything, supporting IE-7 is easier than IE-8. At least IE-7 supports dojo charts better. Trying to implement dojo charts under IE-8 has been a nightmare for me and I finally gave up and went with the depreciated Google Image chart API. I know it can work but every attempt of mine to come up with a solution came up short. The demise of pre-9 IE browsers can't come soon enough!
... View more
12-21-2012
10:54 AM
|
0
|
0
|
1911
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-12-2026 01:43 PM | |
| 1 | 03-12-2026 08:41 AM | |
| 2 | 03-10-2026 10:10 AM | |
| 1 | 02-18-2026 09:20 AM | |
| 3 | 01-22-2026 02:03 PM |