|
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
|
1271
|
|
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
|
1566
|
|
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
|
1566
|
|
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
|
2139
|
|
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
|
455
|
|
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
|
457
|
|
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
|
930
|
|
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
|
1306
|
|
POST
|
I missed your reply, John, but thanks for chiming in. I've seen the sample you linked but that was not the one. Instead of infowindows, the sample I recall has plain square boxes as the tooltip. I've attached a screen shot of my implementation of the code I posted earlier in this thread as an example of what I'm talking about.
... View more
12-21-2012
10:47 AM
|
0
|
0
|
2140
|
|
POST
|
Depends on what, specifically, you want from HTML5 but HTML5 for pre-IE9 browsers is still possible using some javascript libraries such as Modernizr and HTML5shivs. I'm using an HTML 5 template for a map I'm developing and so far, the only thing I can't get is rounded corners on element borders; I'll take that. (I'm using Modernizr and some of these other javascript "plug-in" libraries) Some more info about this issue in general in this article.
... View more
12-21-2012
10:36 AM
|
0
|
0
|
1306
|
|
POST
|
While I still haven't found the sample I was looking for, I did get the sample in the forum thread I linked to work. Here's the working code for anyone interested: //Attempt to add tooltips to the SnoCo Stream Gage layer
var thisObject = this;
//=============================================================================
// Functions to display and dismiss the tooltp on the SnoCo Stream Gage features
//=============================================================================
this.showTooltip = function(evt) {
var dialog = new dijit.TooltipDialog({
id: "tooltipDialog",
content: "Stage: " + evt.graphic.attributes.curHeight + " Ft<br/>" + dToday + "<br/>" + evt.graphic.attributes.NAME,
style: "position: absolute; width: auto; font: normal normal bold 8pt Tahoma;z-index:100"
});
dialog.startup();
dojo.style(dialog.domNode, "opacity", 0.85);
dojo.style(dialog.domNode, "background", "#333");
dojo.style(dialog.domNode, "color", "#EFEFEF");
dijit.placeOnScreen(dialog.domNode, {x: evt.pageX, y: evt.pageY}, ["TL", "BL"], {x: 10, y: 10});
}
this.closeDialog = function() {
var widget = dijit.byId("tooltipDialog");
if (widget) {
widget.destroy();
}
}
dojo.connect(theFeatureLayer, "onMouseOver", function(evt) {
thisObject.closeDialog();
thisObject.showTooltip(evt);
});
dojo.connect(theFeatureLayer, "onMouseOut", this.closeDialog);
... View more
12-14-2012
11:40 AM
|
0
|
0
|
2140
|
|
POST
|
I could swear that about a month or two ago, I was looking at an ESRI sample showing the use of maptips for polygon features. The sample data used was from someplace in New Mexico or someplace else in the desert southwest. I know it used onMouseOut and onMouseOver and would display a small div frame next to the mouse as long as it stayed within the feature's extent. For the life of me, I cannot find it again. I tried implementing it into my project at the time but had difficulty since my data was continuous and the sample was showing data that was scattered across the map. I ended up removing that code from my project and now I can't find the sample. Argh! Does this description ring any bells and can re-link me to that sample? I just want to add a map tip to a point feature layer of mine. I already have an infoWindow set up for click events so I just want to add a simple map tip for the hover event. I tried implementing the code in this forum post but I guess I don't understand how to "define the required methods." Thanks! Steve
... View more
12-14-2012
09:55 AM
|
0
|
6
|
4211
|
|
POST
|
Wow, thanks for fleshing all that out, Wayne! Your technique definitely reduces the number of lines of code. I played with the process a little bit but stopped because the TableToTable command did not overwrite the SDE table (the destination table). This was due to the fact that I had set the workspace to the OLE DB just like in your posted example. I got to thinking about that and decided that for this specific situation, I think I'm better served by my original solution because under that scenario, my SDE table will ALWAYS exist. This is key because the table is being consumed by a map service. Although the chances are very remote, it's still a possibility that someone could load the map service at the moment that the python update sequence is running, which would cause the web map to fail during loading or refresh. I did embrace the OLE DB part of your example which frees me from needing an install of PYODBC. I think it even was just a couple seconds faster, too. Thanks, again! Steve
... View more
12-11-2012
01:23 PM
|
0
|
0
|
1273
|
|
POST
|
Thanks, guys, for the follow up suggestions. Since I'm dealing with the latest stream gage data, overwriting the contents of my SDE table is desirable. We're not running 10.1 just yet so I think I'm going to run with my updated script for now and revisit the TableToTable option in the future. Thanks again! Steve
... View more
12-11-2012
07:08 AM
|
0
|
0
|
1273
|
|
POST
|
BINGO! Moving the InsertCursor outside of the loop was the issue. After doing that, the same process took 23 seconds. *MUCH* better! Since I'm new to Python, I didn't know about Caleb's suggestion of TableToTable. I am interested in that since that would ideally be even cleaner than what I currently have. The Help docs don't have an example of using an ODBC as source. Can anyone provide an example of that? I'm not sure how to create a tableview on the ODBC connection.
... View more
12-10-2012
09:54 AM
|
0
|
0
|
1273
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 3 | 11-13-2025 07:55 AM | |
| 1 | 09-11-2025 10:18 AM | |
| 1 | 09-11-2025 08:03 AM | |
| 1 | 08-13-2025 09:16 AM |