|
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
|
3657
|
|
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
|
1881
|
|
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
|
3657
|
|
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
|
5728
|
|
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
|
1715
|
|
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
|
1715
|
|
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
|
1715
|
|
POST
|
I have a python script which runs fine but takes far too long to run so I'm hoping some of the more experienced python coders can offer suggestions about where I can be more efficient. The script I've written will hopefully be run as a windows task at a given time interval to constantly update a table in SDE which will be consumed by a web map. As I said, the table is in SDE but the source data is a table in an Access database. Due to a daily database maintenance period, the Access database cannot be touched unless the presence/absence of two files is true (hence the conditional statement about the files). If it's ok to proceed, here's what happens: Delete all records from the SDE table Connect to the Access database Step through the records in an Access Query and transfer that information into the SDE table It took roughly 20 minutes to transfer 2200 records. That seems WAY too slow so any suggestions would be greatly appreciated! Here's the code: import sys import os import pyodbc import arcpy from datetime import datetime from arcpy import env file01 = r"\\Path\to\File01" #This file must exist file02 = r"\\Path\to\File02" #This file must NOT exist expression = '1=1' #SQL shorthand which select all records theTable = "tblGageData" # The tables within DIADvisor must not be accessed during its daily database maintenance. # OneRain recommends checking for the existence and non-existence of two specific files. # If both conditions are true, it is safe to proceed with accessing the data within the # dvLive Access database if os.path.exists(file01) and not os.path.exists(file02): print "Processing start time: " + str(datetime.now()) env.workspace = r"Database Connections\SdeConnection.sde" try: # Set some local variables tempTableView = "gageTableView" # Execute MakeTableView arcpy.MakeTableView_management(theTable, tempTableView) # Execute SelectLayerByAttribute to select all records arcpy.SelectLayerByAttribute_management(tempTableView, "NEW_SELECTION", expression) # Execute GetCount and if some records have been selected, then execute # DeleteRows to delete the selected records. if int(arcpy.GetCount_management(tempTableView).getOutput(0)) > 0: arcpy.DeleteRows_management(tempTableView) # Now connect to the DIADvisor access database and import the most recent data # This requires the PYODBC module for Python cstring = r'DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Path\to\Access\Database\Database.mdb;Provider=MSDASQL;' conn = pyodbc.connect(cstring) cursor = conn.cursor() sqlString="SELECT * FROM LAST3DAYS" counter = 0 # Loop through the results returned via the ODBC connection for cRow in cursor.execute(sqlString): curSensorId = cRow.SENSOR_ID curEpoch = cRow.EPOCH curData = cRow.DATA counter += 1 #Insert a new row into the SDE table with the current DIADvisor record's information curSde = arcpy.InsertCursor(r"Database Connections\SdeConnection.sde\tblGageData") row = curSde.newRow() row.SENSOR_ID = curSensorId row.EPOCH = curEpoch row.DATA = curData curSde.insertRow(row) # Close the ODBC connection and perform some variable cleanup cursor.close() conn.close() del row del conn del curSde del cRow del cursor print "Number of record(s) in the DIADvisor database: " + str(counter) print "Processing end time: " + str(datetime.now()) except Exception as e: # If an error occurred, print line number and error message import traceback, sys cursor.close() conn.close() tb = sys.exc_info()[2] print "Line %i" % tb.tb_lineno print str(e) else: sys.exit()
... View more
12-10-2012
08:35 AM
|
0
|
12
|
2747
|
|
POST
|
I can think of one way of doing this but it may not fit in with how you've designed your website. Here it goes- On your webpage, use an IFRAME for the map. In the IFRAME, load an HTML page of your javascript API map that uses 100% of the browser's width and height. In your map initialization javascript, include some code to check the URL to see if any parameters were passed to it. I've done this before and it looked something like this: [INDENT] //Evaluate the URL of this HTML page to determine if any parameters were passed with it
var htmlPagePath = window.location.toString();
var qLocation = htmlPagePath.indexOf('?');
if (qLocation < 1)
{
passedLatLong = false;
}
else
passLatLong = true;
}
.
.
.
//If a coordinate location was passed as a parameter, zoom the map to it
if (passedLatLong)
{
//Extract the lat/long coordinates passed as a parameter with the URL
var coordStr = window.location.toString().substr(qLocation + 1,window.location.toString().length);
var coords = new Array();
coords = coordStr.split(',');
//Create a lat/long point
var bridgeLoc = new esri.geometry.Point(coords[0],coords[1], new esri.SpatialReference({wkid:4326}));
//set the map extent based on the lat/long coordinate passed. The coordinate must be converted
//to Web Mercator since the web services used have been defined with that projection..
map.setExtent(pointToExtent(map,esri.geometry.geographicToWebMercator(bridgeLoc),3));
}
Hopefully you now see where I'm going with this. When your users click on your "external link" on the page, have the onClick event reload the IFRAME but append a parameter to the URL (FID, lat/long, etc) and then your map init() routine will recognize the parameter and respond accordingly.
[/INDENT] Again, this approach may not fit in with what you want to do but it's possible. Good luck! Steve
... View more
11-30-2012
09:44 AM
|
0
|
0
|
729
|
|
POST
|
With respect to your second question, you could accomplish this using a dojo listener event based on a row click event. Here's an example I'm using to zoom to a feature represented by a row in a datagrid: dojo.connect(dijit.byId("grid"), 'onRowClick', function(e) {
var rowdata = grid.getItem(e.rowIndex);
var theId = rowdata.OBJECTID;
theFeatureLayer.clearSelection();
var query = new esri.tasks.Query();
query.objectIds = [theId];
theFeatureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){
var theExtent = features[0].geometry.getExtent().expand(2.5);
map.setExtent(theExtent);
});
});
In your situation, just swap the field name in my example (OBJECTID) for the name of your field containing the URL. The rest of the routine would be pure javascript to open a URL in a new window: //Get the screen resolution and scale it back 10% (for use with the new window)
var theWidth= 0.9 * screen.width;
var theHeight= 0.9 * screen.height;
var theOptions = 'height=' + theHeight + ',left=25,top=25,width=' + theWidth;
window.open(theUrl,'_blank',theOptions);
... View more
11-30-2012
07:31 AM
|
0
|
0
|
1075
|
|
POST
|
Are the services coming from SDE? If not, double check the paths for the datasets. I always get tripped up because my map service used network drive letters when they should have been UNC format. Remember, your server won't know what a G, L, or Z drive is so that's one reason that features won't show up in a map service.
... View more
11-29-2012
09:06 AM
|
0
|
0
|
1441
|
|
POST
|
Have a look at this sample. It's primary purpose is to demonstrate how to use dojo charts with popups but the sample also shows you an example of using a tabbed container within a popup.
... View more
11-29-2012
07:27 AM
|
0
|
0
|
661
|
|
POST
|
I hope this is the appropriate forum for this- Our organization is trying to convert an old, kludgy stream gage web app to a GIS web app using the javascript API. We're currently running ArcGIS Server version 10 but should upgrade to 10.1 at some point. We're not talking about a lot of data- only 8-12 stream gages. The data itself is stored in an Access database and we'd like the map service to have a refresh interval of 5 or 10 minutes. The map service won't be a GIS dataset per se because I plan to construct a featureLayer on the fly like a JSON feed due to some custom symbology requirements. As such, I'll be publishing a particular table from that Access database which contains the last three days worth of values from each gage since my web map popups will create some hydrographs. From experience, map services based on file based sources (shapefiles, etc) lock up the files which will prevent the update process outside of the GIS realm. SO- how do I publish my data for consumption by a web map that doesn't prohibit any processes outside of GIS from completing an update??
... View more
11-28-2012
08:37 AM
|
0
|
1
|
2388
|
|
POST
|
Hi Alex, Sorry to bump but I'm curious if you ever resolved this for the app you were working on? Steve
... View more
11-14-2012
10:55 AM
|
0
|
0
|
1244
|
|
POST
|
Provided by ESRI? No- with one qualification. If you are under maintenance for any of the ArcGIS Desktop applications, you should also have the ESRI Data and Maps bundle of datasets which I believe includes a shaded relief image. These used to be provided as a set of DVDs but now is a download when you download your software. Your best non-ESRI source for this information would be the USGS: http://earthexplorer.usgs.gov/ You might also find additional data at your state or local level depending on your area of interest.
... View more
11-08-2012
01:45 PM
|
0
|
0
|
384
|
| 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 |