|
POST
|
Showing the infoWindow was enough. I shouldn't have been setting the infoWindow content. The grid click definition: app.grid.on('.dgrid-row:click', function(event){ var row = app.grid.row(event); var query = new Query(); query.objectIds = [row.data.id]; app.eusLayer.selectFeatures(query).then(function(results){ var resultGeometry = results[0].geometry; app.map.infoWindow.show(resultGeometry); }); }); The infoWindow opens as an attributeInspector.
... View more
01-26-2016
01:04 PM
|
0
|
0
|
1061
|
|
POST
|
My other twist is that my data is address based. I'm sure I'll get stuck once I attempt to add a feature, not by a click, but entering an address. I was just using attribute inspector and an edit toolbar by itself before. I thought I'd give the Editor widget a shot, since it doesn't seem to have as much set up. Not that that will help in the long run, if I can't get it to do what I want.
... View more
01-25-2016
01:33 PM
|
0
|
2
|
2870
|
|
POST
|
Modifying .esriAttributeInspector made the frame containing the field names input etc be larger, but not its outer frame. This meant even more scrolling to see the entire content.
... View more
01-25-2016
01:14 PM
|
0
|
1
|
2870
|
|
POST
|
The current project contains secure information I can't use as an example. It happens to contain one field name that's quite a bit longer than the rest. I wonder if that has anything to do with it. The attributeInspector window is just a little too short and needs a vertical scroll to show the Delete button. It doesn't have a horizontal scroll, maybe because the field names are generally shorter? https://jsbin.com/legida/edit?html,output
... View more
01-25-2016
01:12 PM
|
0
|
0
|
2870
|
|
POST
|
My editor widget works when I click on a feature to edit. I also have a grid list of the features. When the user clicks in the grid, I'd like it to launch the attributeInspector. I've seen examples that open the domNode of the attributeInspector. In this case, I'm not constructing an attributeInspector, I've created a Editor widget and the attributeInspector is just part of it. My grid is declared as: initGrid: function (gridid,gridDiv){
var grid = new (declare([OnDemandGrid, Selection, Keyboard]))({
id: gridid,
selectionMode: 'single',
showHeader: false,
renderRow: function (obj){
var template = '<div class="gridTitle gridInfo">${0}</div><div class="details gridInfo">${1}</div> <div class="details gridInfo"> ${2}</div><div class="details gridInfo">Phone: ${3}</div><div class="details gridInfo">Cell: ${4}</div>';
return domConstruct.create("div", {
innerHTML: dojoString.substitute(template, [obj.name, obj.address, obj.city,obj.phone, obj.cell])
});
},
loadingMessage: 'Loading data...',
noDataMessage: 'No staff located in this area.'
}, gridDiv);
grid.startup();
return grid;
} The grid contents update on an extent change. I've tried reaching into the Editor to get to attributeInspector, but this line isn't working for me. updateGrid: function(){
var queryParams = new Query();
queryParams.geometry = app.currentExtent;
queryParams.spatialRelationship = Query.SPATIAL_REL_CONTAINS;
queryParams.outFields = ["Name", "Address", "City", "Phone", "Cell", "OBJECTID"];
queryParams.outSpatialReference = app.spatialReference;
var queryTask = new QueryTask(app.eusLayer.url);
queryTask.on('error', queryErrorHandler);
queryTask.execute(queryParams, updateGridHandler);
function queryErrorHandler(err){
console.log("error in queryTask is " + err.error);
}
function updateGridHandler(featureSet){
var data = [];
if (app.grid) {
app.grid.refresh();
}
data = arrayUtils.map(featureSet.features, function(feature){
var cellTest = feature.attributes.Cell;
var cellNumber = "";
if (cellTest) {
cellNumber = cellTest;
} else{
cellNumber = "N/A"
}
return {
'id': feature.attributes.OBJECTID,
'name': feature.attributes.Name,
'address': feature.attributes.Address,
'city': feature.attributes.City,
'phone': feature.attributes.Phone,
'cell': cellNumber
};
});
var currentMemory = new Memory({
data: data,
idProperty: 'id'
});
app.grid.set('store',currentMemory);
app.grid.sort('name');
app.grid.on('.dgrid-row:click', function(event){
var row = app.grid.row(event);
var query = new Query();
query.objectIds = [row.data.id];
app.eusLayer.selectFeatures(query).then(function(results){
var resultGeometry = results[0].geometry;
/*
app.map.infoWindow.setFeatures(results);
app.map.infoWindow.show(resultGeometry);
*/
app.map.infoWindow.setTitle("Staff Information");
app.map.infoWindow.setContent(app.myEditor.attributeInspector.domNode);//doesn't work
app.map.infoWindow.show(resultGeometry);
});
});
}
}
);
}); My editor is defined as: initEditor: function (evt, geometryService, map) {
var layers = [];
var templatePicker = new TemplatePicker({
featureLayers: [app.eusLayer],
grouping: true,
rows: "auto",
columns: 3
}, "templateDiv");
templatePicker.startup();
layers.push({featureLayer: app.eusLayer });
var settings = {
map: map,
templatePicker: templatePicker,
geometryService: geometryService,
layerInfos: layers,
toolbarVisible: false
};
var params = { settings: settings };
app.myEditor = new Editor(params, 'editorDiv');
app.myEditor.startup();
} I might not need as much configuration as I have for it. I only have one layer I'm trying to edit.
... View more
01-25-2016
12:56 PM
|
0
|
1
|
2701
|
|
POST
|
In my Editor widget, the height and width of my attributeInspector window seems consistently too small. There are scrollbars for both height and width. Should I be changing the style of the esriPopup? It doesn't seem like I should have to. I don't have a lot of styles set on this. None of the styles provided in the documentation seem to control the height/width of the entire contentpane. .esriPopup.light .contentPane, .esriPopup.dark .contentPane {
padding: 0 1em 1em 1em;
}
.atiLayerName{
display:none;
}
.title{
font-weight: 600;
}
.esriPopup .titlePane, .esriPopup.light .titlePane, .esriPopup.dark .titlePane {
background-color: #cbddeb;
padding: 5px 0 0 5px;
font-size: 1.1em;
font-weight:bold;
} I commented all these, but still I have scrollbars.
... View more
01-25-2016
12:02 PM
|
0
|
9
|
4641
|
|
POST
|
OK, that fixed that, but the map navigation gets turned back off again after moving it one time. I'll have to look at the activateToolbar function next. It's enabling mapNavigation at the end of every graphic-move-stop.
... View more
01-21-2016
11:30 AM
|
0
|
0
|
1272
|
|
POST
|
With the lang.hitch, the use of 'this' doesn't work. It's giving the error 'this.set is not a function'. I get what you're saying, though.
... View more
01-21-2016
11:10 AM
|
0
|
2
|
1272
|
|
POST
|
I understand the way you're describing it, but there's a good chance the user might have an infoWindow open before they start. They may see some information that needs to be changed and then click Start Editing. Even though the graphic seems like it might be selected, because you just clicked it to see the information, it isn't.
... View more
01-21-2016
10:02 AM
|
0
|
1
|
1272
|
|
POST
|
It's still not behaving like I want. You have to select the feature again after the infoWindow has been removed before you can move the graphic.
... View more
01-21-2016
09:40 AM
|
0
|
1
|
2448
|
|
POST
|
The application where the issue exists. I haven't figured how to post some place like jsbin once I have it split into modules.
... View more
01-21-2016
09:33 AM
|
0
|
1
|
2448
|
|
POST
|
You must be a mind reader. I actually did have mapNavigation.enabled set in it. I was so sure that was clue I needed. But I took the line out and it didn't help. In my createEditButton function, I added map.infoWindow.hide() in the section if (val) ..... It removes the infoWindow, navigation is still enabled, so I get map movement, not graphic moving. If I click the feature again, THEN that disables the navigation and I can move the point. I don't want navigation to be disabled just because I enabled editing, though. It feels close, I just don't have the logic right. It will probably help to see it working here: Add graphic by geocode The points get added by geocoding, not by something like templatepicker. It's the reason I'm using this approach, as opposed to something like the Editor widget.
... View more
01-21-2016
09:16 AM
|
0
|
3
|
2448
|
|
POST
|
It's rather convoluted and it doesn't seem relevant, but sure. I changed it to be just a simple string: popupTemplate.setContent("this is my template") and it didn't make any difference to the behavior. function setPopupContent(content){ var template = "<span id='attImage'></span><div class='boldPopup'>${Facility}</div><div>${Address}</div><div>${City},${State}</div>"; // get attachments and update template when we have url var oid = content.attributes[featureLayer.objectIdField]; featureLayer.queryAttachmentInfos(oid).then(function(attachments){ if(attachments.length > 0){ var attachment = attachments[0]; if(attachment.url && attachment.name){ dom.byId("attImage").innerHTML= "<img class='popupImage' alt='siteImage' src='" + attachment.url +"'/>"; } } }); return esriLang.substitute(content.attributes,template); }
... View more
01-21-2016
08:56 AM
|
0
|
1
|
2448
|
|
POST
|
I know there are many threads on editing and navigation, but I still can't figure it out. I want to be able to enable/disable editing on my featureLayer. I have a boolean set as app.editEnabled. I have the button constructed as a toggleButton: createEditButton: function (){ var tglButton = new ToggleButton({ showLabel: true, label: 'Begin Editing', onChange: function(val) { if (val){ this.set('label', 'Stop Editing'); app.editEnabled = true; }else{ this.set('label', 'Begin Editing'); app.editEnabled = false; } } }, "tglEditButton"); }, It is properly changing my Boolean and my button label. var template = new PopupTemplate({ title: null }); template.setContent(setPopupContent); My FeatureLayer is defined as featureLayer = new FeatureLayer(pathName+"/arcgis/rest/services/MDA/sampleGeocodeEdit/FeatureServer/0",{ id:"featureLayer", outFields:['*'], infoTemplate:template }); //symbology defined elsewhere featureLayer.renderer = renderer; featureLayer.setSelectionSymbol(highlightMarkerSymbol); I have a listener on it: on(featureLayer, "click", function(evt){ map.infoWindow.hide(); formatString = ""; objectId = evt.graphic.attributes[featureLayer.objectIdField]; selectQuery.objectIds = [objectId]; featureLayer.selectFeatures(selectQuery); if (app.editEnabled) { myEditor.activateToolbar(evt.graphic,map); } }); in myEditor activateToolbar: function (graphic,map) { map.infoWindow.hide(); map.disableMapNavigation(); map.disablePan(); app.editToolbar.activate(Edit.MOVE, graphic); on(app.editToolbar, 'graphic-move-stop', function(evt){ featureLayer.applyEdits(null, [graphic], null); app.editToolbar.deactivate(); map.enableMapNavigation(); map.infoWindow.hide(); }); } There is where I'm getting stuck. Instead of the graphic moving when I drag the mouse, it still just pans the screen instead. As long as my feature doesn't have an infoTemplate, the graphic drags. Once I include one in my featureLayer constructor, navigation is not disabled and instead of dragging the graphic, it just pans. I've tried hiding the infoWindow, but it isn't getting removed.
... View more
01-21-2016
08:36 AM
|
0
|
14
|
5602
|
|
POST
|
That's better. The tricky part will be that I don't just have two different layers. I actually have multiple, some for points and some for polygons. It seems like this might still work, but I'll have to test it with my actual data.
... View more
01-11-2016
07:11 AM
|
0
|
0
|
2033
|
| 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
|