|
POST
|
I just found that you can use the dojo attachpoint for the button. This is the html of the close button in the infowindow: [HTML]<a class="hide" dojoattachpoint="_hide" dojoattachevent="onclick:hide" style="margin-left: 303px; "><div class="sprite"></div></a>[/HTML] Here is how you can listen for the click event of the close button. dojo.connect(map.infoWindow._hide, "onclick", function(){
//your code here for handling the close button click.
});
... View more
03-20-2012
03:49 PM
|
1
|
0
|
430
|
|
POST
|
I am using the attribute inspector with a feature layer on my map. I need to know when a user closes the infoWindow by clicking the x or close button. The map.infoWindow "onhide" event fires every time the user clicks on the map, so this will not do. Does anyone know how how to create an event listener for the onClick event of the close button on the infWindow dijit? The button doesn't have an id attribute that I can refer to, and i haven't been able to find anything in the Dojo dijit documentation to help me.
... View more
03-20-2012
03:35 PM
|
0
|
1
|
3964
|
|
POST
|
I am part way there, but still having difficulty opening a separate attribute inspector for the related table. I'd like to use the attribute inspector because it can handle the valiation for me. From the documentation, it looks like you should be able to open the attribute inspector in a div outside the map. As I understand it, the attribute inspector requires a feature layer and selected features in that feature layer. Therefore, I query the related records using queryRelatedRecords, and then select them using the selectFeatures method on the featureLayer for the related records. When I create the attribute inspector for the related records I assign it to a new div, but still the related records show up in the attribute inspector associated with editor widget and the primary point feature layer. The div that it is supposed to show up in says "No features selected" (screen shots of app and debugger values attached). This doesn't work, because I need to add a save button to the attribute inspector for the related records. Is it possible to have two separate attribute inspectors open at the same time? Is there some other better way to do this?
//global variable for the related record feature layer
relatedRecordMaintLayer = new esri.layers.FeatureLayer("https://myserver.net/ArcGIS/rest/services/internal/Sanitation_Inpsection/FeatureServer/1", {
mode: esri.layers.FeatureLayer.MODE_SELECTION, //QUERY_SELECTION is working as well
outFields: ['OBJECTID','PointID','Date','MaintType']
});
.......
//I am able to display the key field for the related record in a table, and this is the function to show the attribute inspector for the related record that is clicked on in the table.
function showRelated(objID){
var flQuery = new esri.tasks.Query();
flQuery.where = "OBJECTID = " + objID + "";
flQuery.returnGeometry = "false";
propMaintLayer.selectFeatures(flQuery,esri.layers.FeatureLayer.SELECTION_NEW,function (selection)
{
var layerInf = [{'featureLayer':propMaintLayer,
'showAttachments':false,
'isEditable': true,
'fieldInfos': [
{'fieldName': 'OBJECTID', 'isEditable':false, 'tooltip': 'Object ID', 'label':'Object ID:'},
{'fieldName': 'Date', 'isEditable':true,'tooltip': 'Inspection Date MM/DD/YYYY','label':'Date:'},
{'fieldName': 'MaintType', 'isEditable':true, 'label':'Maintenance Type:'},
{'fieldName': 'PointID', 'isEditable':false, 'tooltip': 'Foreign key', 'label':'Foreign Key:'},
]}];
attInspector = new esri.dijit.AttributeInspector({
layerInfos:layerInf
},
dojo.create("div",{id:"relateDiv"},"liRelate" + objID,"last")
);
}
);
}
}
... View more
03-14-2012
01:31 PM
|
0
|
0
|
2390
|
|
POST
|
Well I am part way there. I am able to query the related records and show them in a list. Clicking on one of the items in the list should launch the attribute inspector such that I can edit the corresponding row in the related table. I'd like to use the attribute inspector because I believe it will take care of validation and allow me to track and save edits. As I understand it, the attribute inspector operates on selected features for a feature layer. Therefore I added the related table as a feature layer and perform a selectFeatures on it. When the selectFeatures callback is called, I can see in the debugger that my featureLayer has the correct feature (table row) selected. However, the attribute inspector (which references the same featureLayer) has an empty array for its _selection attribute, and displays "no features selected". The API reference says that you can use a table to create a featurelayer, but could there be an issue with using a feature layer for a standalone table and doing a selection on it? Or perhaps can the attribute inspector not operate on a featureLayer that is a standalone table? Below is my code, and attached are the debugger screen shots.
//the feature layer created in the init function
propMaintLayer = new esri.layers.FeatureLayer("https://myserver.com/ArcGIS/rest/services/internal/Sanitation_Inpsection/FeatureServer/1", { mode: esri.layers.FeatureLayer.MODE_SELECTION, outFields: ['OBJECTID','PointID','Date','MaintType']});
//and the function called when a related record is clicked
function selectRelated(objID){
var flQuery = new esri.tasks.Query();
flQuery.where = "OBJECTID = " + objID + "";
flQuery.returnGeometry = "false";
propMaintLayer.selectFeatures(flQuery,esri.layers.FeatureLayer.SELECTION_NEW,function (selection)
{
var layerInfos = [{'featureLayer':propMaintLayer,
'showAttachments':false,
'isEditable': true,
'fieldInfos': [
{'fieldName': 'OBJECTID', 'isEditable':false, 'tooltip': 'Object ID', 'label':'Object ID:'},
{'fieldName': 'Date', 'isEditable':true,'tooltip': 'Inspection Date MM/DD/YYYY','label':'Date:'},
{'fieldName': 'MaintType', 'isEditable':true, 'label':'Maintenance Type:'},
{'fieldName': 'PointID', 'isEditable':false, 'tooltip': 'Foreign key', 'label':'Foreign Key:'},
]}];
attInspector = new esri.dijit.AttributeInspector({
layerInfos:layerInfos},
dojo.create("div",{id:"relateDiv"},"liRelate" + objID,"last")
);
}
);
}
... View more
03-13-2012
11:58 AM
|
0
|
0
|
2390
|
|
POST
|
Hello, I've seen the sample for Editing Related Records, but this sample just lets you change one value in the related table of a one to one relationship. I would like to a user to be able to click on an existing point feature, be able to change attributes for that point feature, as well as have access to one or more related records. The related features could be displayed in the attribute inspector, or in a side panel as a list. In any case a user would need to be able to click on one of the existing related records to edit it, delete a related record, and add a new related record. Both the feature class and related table are in SDE with an established relationship class, and are part of the mapservice I am referencing. Has anyone done something similar or have any ideas on how to get started? Thanks, Sebastian Roberts
... View more
03-12-2012
02:22 PM
|
1
|
13
|
8234
|
|
POST
|
Hi Curtis, Thanks for your reply. That improved performance greatly. I just moved my temp directory creation inside the loop so that a new directory is created for every loop iteration (every 30 feature clasess), and now it is on target to finish in about 3 hours rather than 30. Sebastian for x in groups:
#create the tempworkspace
tempWS = tempWorkspacePrefix + str(tempWorkspaceSuffix)
if not arcpy.Exists(tempDIR + os.sep + tempWS):
arcpy.CreateFolder_management(tempDIR, tempWS)
arcpy.env.workspace = tempDIR + os.sep + tempWS
while......................(rest of the loop as in my previous post)
tempWorkspaceSuffix = tempWorkspaceSuffix + 1;
... View more
02-17-2012
12:49 PM
|
0
|
0
|
1775
|
|
POST
|
Jill, Did you find any solution? As we have added more overlapping parcels to our feature class (we now have 860), I too seem to be running into memory issues. My script was crashing, so I added another loop that uses a smaller cursor and repeatedly deletes the searchCursor. It no longer crashes, but interestingly enough, a "zone" is processed in about 20 seconds at the outset, and then towards the end of the 800 features, it slows down to about 5 minutes to process one zone. Below is the python code that I am using.
#create overlapping polygons with intersect tool (intersect with self, only creates partial parcels where overlapping)
arcpy.Intersect_analysis([inputParcelLayer],FeatureIntersect,"NO_FID","","")
#make feature layer, join with self intersected parcels, use result as overlapping parcels for zonal stats
arcpy.MakeFeatureLayer_management(inputParcelLayer,"parcelsoverlap")
arcpy.AddJoin_management("parcelsoverlap","APN",FeatureIntersect,"APN","KEEP_COMMON")
arcpy.CopyFeatures_management("parcelsoverlap", FeatureZone)
tempDIR = arcpy.GetSystemEnvironment("TEMP")
#create scratch workspace name
tempWorkspace = "tempWorkspaceForZonalStats"
if not arcpy.Exists(tempDIR + os.sep + tempWorkspace):
arcpy.CreateFolder_management(tempDIR, tempWorkspace)
arcpy.env.workspace = tempDIR + os.sep + tempWorkspace
#input variables
strFIDname = arcpy.Describe(FeatureZone).OIDFieldName
zone = "zone"
arcpy.env.cellSize = 2 #needed to reduce cell size because zonal stats crashes if the polygon is smaller than raster resolution
gc.enable() #enable garbage collection
arcpy.CheckOutExtension("Spatial")
cellAssign = "CELL_CENTER"
priority = "NONE"
newSelection = "NEW_SELECTION"
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management(FeatureZone, zone)
#Loop through features
numFeats = int(arcpy.GetCount_management(FeatureZone).getOutput(0))
groups = []
bracket = 30
while(bracket < numFeats):
groups.append(bracket)
bracket = bracket + 30
groups.append(numFeats+1)
for x in groups:
whileClause = '"OBJECTID" >= ' + str(x-30) + ' and "OBJECTID" < ' + str(x)
print whileClause
inRows = arcpy.SearchCursor(FeatureZone,whileClause)
#inRows = arcpy.SearchCursor(FeatureZone)
inRow = inRows.next()
while inRow:
#selct the fid to process
strID = inRow.getValue(strFIDname)
print ' processing objID: ' + str(strID) + 'of ' + str(numFeats) + ' total features.'
strQry = '"%s" = %s' % (strFIDname, strID)
arcpy.SelectLayerByAttribute_management(zone, newSelection, strQry)
#create a unique name for the zone
uniqueZone = arcpy.CreateUniqueName("zone.shp", arcpy.env.workspace)
uniqueTable = arcpy.CreateUniqueName("ZSasT", arcpy.env.workspace)
#create a temporary feature to use for zonal stats as table
arcpy.CopyFeatures_management(zone, uniqueZone)
outZSaT = ZonalStatisticsAsTable(uniqueZone, joinField, valueRaster, uniqueTable, "NODATA", "ALL")
#move to next record.
inRow = inRows.next()
del inRow
del inRows
... View more
02-17-2012
08:25 AM
|
0
|
0
|
1775
|
|
POST
|
Thanks cminde7 and Sashom, I was having the same problem, and your solution fixed it. I had to make a change because I symbolize my layer with only one marker symbol (instead of categories or class breaks), so I don't have an array of infos. So the code below might be more robust and be able to deal with both situations. function fixIELayers(evt)
{
// IE FIX FOR IMAGES NOT SHOWING IN FEATURE LAYER!!!
if (dojo.isIE)
{
var currentLayer = Hydrants; //map.getLayer(map.layerIds );
if(currentLayer && currentLayer.renderer && currentLayer.renderer.infos)
{
for (var i=0; i<currentLayer.renderer.infos.length; i++)
{
var url1=currentLayer.renderer.infos.symbol.url;
var url2=esri.config.defaults.io.proxyUrl+'?';
if (url1.indexOf(url2) != -1)
continue;
var url3=url2+url1;
currentLayer.renderer.infos.symbol.url = url3;
}
}else if(currentLayer && currentLayer.renderer && currentLayer.renderer.symbol)
{
var url1=currentLayer.renderer.symbol.url;
var url2=esri.config.defaults.io.proxyUrl+'?';
if (url1.indexOf(url2) == -1)
{
var url3=url2+url1;
currentLayer.renderer.symbol.url = url3;
}
}
}
}
... View more
02-10-2012
09:34 AM
|
0
|
0
|
1331
|
|
POST
|
Just found this post. Jamie's script worked great. I am using this for zonal stats in a parcel model so only have a small subset of overlapping tax parcels (condos only). In my case, I do an intersect with just one input (the parcel layer) to extract only the overlapping condo tax parcels. I added this to the beginning of Jamie's script, then process only these parcels with the script. In a second model, I do a selection to subtract these condo tax parcels form the county wide parcel feature layer. I can then do a regular zonal statistics on the feature layer for all the remaining non overlapping polygons. Just thought I would share this as a way to speed up the process if your dataset has a small subset of overlapping polygons. #create overlapping polygons with intersect tool (intersect with self to get overlapping)
arcpy.Intersect_analysis([inputParcelLayer],FeatureZone,"NO_FID","","")
... View more
11-18-2011
01:57 PM
|
0
|
0
|
1775
|
|
POST
|
Richard, I did finally resolve this with the help of an Esri support request. Just as you said, I needed to change the environment settings for the M values to "enabled", and set an M resolution of .0001 and M tolernace of .001. Thanks for your response. I appologize for not remembering to update my post after resolving it with the help of Esri. Regards, Sebastian Roberts
... View more
11-14-2011
07:28 AM
|
0
|
0
|
1257
|
|
POST
|
I am using the Esri local government javascript template for reporting Elections Results. On monitors with lower resolution, the results info window often shows up with the title bar off the top of the map. The average user tries in vain to click somewhere on the infowindow and drag it down, and doesn't realize the only way to see the whole thing is to pan the map. Can I make it draggable by just clicking anywhere on the window to move it? Alternatively, can I at least make the title bar always appear somewhere on the map? I've seen the show(location) method, but would need an example that always makes the title bar appear on the map. Finally, if it isn't possible to make it draggable by clicking anywhere in the infowindow, is it at least possible to make it draggable by dragging in the title bar?
... View more
11-03-2011
08:21 AM
|
0
|
1
|
3762
|
|
POST
|
Sarah, I haven't used the TOC, so I am not sure how it manages the layers, but in my widget that uses radio buttons, I just put the layers in an array, and then in the radio click handler I turn all layers off that don't correspond to the click event. Putting all the operational layers that exist in the main config.xml file into an array: private function getLayers():void
{
if (configData && configData.opLayers){
for (var i:int=0; i< configData.opLayers.length; i++)
{
layerArray.addItem(configData.opLayers.label);
}
} excluding any layers listed as exclude in the widget's config file private function excludeLayers(): void
{
if (configXML){
// exclude these layers
var layers:XMLList = configXML..excludelayer as XMLList;
for (var j:Number = 0; j < layers.length(); j++){
for(var i:int=0; i< layerArray.length; i++){
if(layerArray == layers ){
layerArray.removeItemAt(i);
}
}
}
}
} create radio buttons: for(var i:uint = 0; i < layerArray.length; i++)
{
radioBtn = new RadioButton;
radioBtn.groupName = "radioBtnGroup";
radioBtn.label = layerArray;
radioBtn.styleName = "WidgetText";
radioBtn.value = i;
radioBtn.height = 18
radioBtn.setStyle("textRollOverColor","#D0D0D0 ")
vBoxRadio.addChild(radioBtn);
} radio click handler: private function radioClickHandler(event:ItemClickEvent):void
{
// update the visible layers to only show the layer selected
for(var i:uint = 0; i < layerArray.length; i++)
{
if (layerArray == event.label){
map.getLayer(layerArray).visible = true;
}else{
map.getLayer(layerArray).visible = false;
}
}
}
... View more
08-26-2011
08:07 AM
|
0
|
0
|
1046
|
|
POST
|
I have a fairly simple application where I want to create a measure system of miles for a subset of our roads. The route is created correctly with measure units in meters, but when I attempt to use miles, the issue I have is as follows. I did a test with only one street. The street and route feature class are in a feature dataset with a state plane projection, units in meters. I used the default M resolution for the output feature dataset of 0.0001 (also tried 0.00001). The street is 0.6 miles long. Using the Create Routes tool I applied a measure factor of 0.000621371192 (conversion from meters to miles). The route created has vertices with zero measures where the steet is less than 0.5 miles in length, then vertices with measure values of 1 for vertices where the street is above .5 miles in length. (see attached image). I also tried to add a miles field to the street and reference this when creating the route with the same effect. How can I keep the measure from being rounded to the nearest integer?
... View more
07-21-2011
04:26 PM
|
0
|
2
|
1781
|
|
POST
|
I am exploring the use of parcel fabric to edit our parcels. We currently have a topology defined for parcels with feature classes such as Zoning. The rule associating the two is "zoning area boundary must be covered by boundary of Parcels". We have marked about 1000 exceptions to this rule where zoning unfortunately does not follow parcel boundaries (zoning follows a natural or adminstrative boundary, or crosses a road right of way). If we try to associate zoning with the fabric so that it can be adjusted and kept in synch, how would a zoning polygon which is only partially coincident with parcel boundaries behave when we try to automatically adjust?
... View more
06-22-2011
09:20 AM
|
0
|
1
|
636
|
|
POST
|
Andrew, Did you ever find out if this tool is or will be avalaible, perhaps as an add-in? I am specifically looking for the fishbone tool or and creating address ranges for road centerlines from points.
... View more
05-10-2011
12:29 PM
|
0
|
0
|
1622
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-02-2015 12:08 PM | |
| 1 | 02-08-2016 08:22 AM | |
| 1 | 08-13-2015 10:32 AM | |
| 1 | 08-13-2015 09:44 AM | |
| 1 | 05-04-2015 03:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|