|
POST
|
Steve, I keep getting an error of : Uncaught TypeError: Cannot read property 'layers' of undefined Does your initEditing function start with this: function initEditing(event) {
var featureLayerInfos = arrayUtils.map(event.layers, function (layer) {
... View more
12-09-2015
10:34 AM
|
0
|
0
|
1975
|
|
POST
|
Robert, map.on("layers-add-result", initEditing); function initEditing(event) {
var featureLayerInfos = arrayUtils.map(event.layers, function (layer) {
return {
"featureLayer": layer.layer,
"isEditable": true,
'showAttachments': true,
"showDeleteButton": false,
"fieldInfos": [{
'fieldName': 'Caller_Name',
'isEditable': false,
'tooltip': 'Caller Name',
'label': 'Caller Name:'
}, {
'fieldName': 'Priority',
'isEditable': true,
'tooltip': 'Priority',
'label': 'Priority:'
}, {
'fieldName': 'Location',
'isEditable': false,
'label': 'Location:'
}, {
'fieldName': 'Phone',
'isEditable': false,
'label': 'Phone:'
}, {
'fieldName': 'Notes',
'isEditable': true,
'label': 'Notes:'
}, {
'fieldName': 'CallType',
'isEditable': true,
'label': 'CallType:'
}]
};
});
var settings = {
map: map,
layerInfos: featureLayerInfos
};
var params = {
settings: settings
};
var editorWidget = new Editor(params, 'editorDiv');
editorWidget.startup();
//snapping defaults to Cmd key in Mac & Ctrl in PC.
//specify "snapKey" option only if you want a different key combination for snapping
map.enableSnapping();
}
... View more
12-09-2015
08:47 AM
|
0
|
11
|
1659
|
|
POST
|
Robert, I mostly realize what is happening, I just am not 100% sure how to fix it. What is happening now is that when the editor tries to reinitialize I get this error: Uncaught TypeError: Cannot read property 'layers' of undefined I realize that this: var featureLayerInfos = arrayUtils.map(event.layers, function (layer) { is a local variable but I am unsure how to make it global.
... View more
12-09-2015
08:21 AM
|
0
|
13
|
2704
|
|
POST
|
Robert, I am getting hung up on the destroyEditor part. var search = new Search({
map: map
}, "search");
search.startup();
search.on("select-result", lang.hitch(this, function () {
//if edit tool is enabled we'll have to delete/create
//so info window behaves correctly.
on.once(this.map.infoWindow, "hide", lang.hitch(this, function () {
search.clearGraphics();
console.log("Cleared Search Graphics");
_destroyEditor();
console.log("Test");
initEditing();
}));
}));
function _destroyEditor() {
if (this.editor) {
this.editor.destroy();
console.log("Destroyed editor");
this.editor = null;
}
}
function initEditing(event) {
var featureLayerInfos = arrayUtils.map(event.layers, function (layer) {
return {
"featureLayer": layer.layer,
"isEditable": true,
'showAttachments': true,
"showDeleteButton": false,
"fieldInfos": [{
'fieldName': 'Caller_Name',
'isEditable': false,
'tooltip': 'Caller Name',
'label': 'Caller Name:'
}, {
'fieldName': 'Priority',
'isEditable': true,
'tooltip': 'Priority',
'label': 'Priority:'
}, {
'fieldName': 'Location',
'isEditable': false,
'label': 'Location:'
}, {
'fieldName': 'Phone',
'isEditable': false,
'label': 'Phone:'
}, {
'fieldName': 'Notes',
'isEditable': true,
'label': 'Notes:'
}, {
'fieldName': 'CallType',
'isEditable': true,
'label': 'CallType:'
}]
};
});
var settings = {
map: map,
layerInfos: featureLayerInfos
};
var params = {
settings: settings
};
var editorWidget = new Editor(params, 'editorDiv');
editorWidget.startup();
//snapping defaults to Cmd key in Mac & Ctrl in PC.
//specify "snapKey" option only if you want a different key combination for snapping
map.enableSnapping();
}
... View more
12-09-2015
07:54 AM
|
0
|
15
|
2704
|
|
POST
|
Jeffery, If you have the capability to do offline editing or your editing will be in an area where you will not have service, Wifi only would work. I have a iPad that has service and it is nice to have since I can pull new data or update the office with new developments without connecting to wifi. What data collecting are you thinking? Example: If you are collecting data such as trees then I would not see a need for service since the trees will not change rapidly but if you are collecting about a disaster, such as a flood, situations change quickly and being to add data or add new layers would be important.
... View more
12-09-2015
07:28 AM
|
1
|
1
|
1263
|
|
POST
|
Robert, Sort of, I got the search to clear, but I cannot get the editor to reinitialize. I am still working with the code.
... View more
12-09-2015
07:22 AM
|
0
|
16
|
2704
|
|
POST
|
I have searched for an example for a few hours and cannot find any.
... View more
12-04-2015
04:05 PM
|
0
|
1
|
2704
|
|
POST
|
I did find a work around. Which was what I suspected was the issue. It hangs up because it is set to zoom in too far. if you use the code: geoLocate = new LocateButton({
map: map,
setScale: false
}, "LocateButton");
geoLocate.startup(); It will work and not reload the page on an iPad.
... View more
12-04-2015
02:33 PM
|
1
|
0
|
1058
|
|
POST
|
I have used Locate Button before in webapps and not had an issue. I opened Locate Button | ArcGIS API for JavaScript on my ipad and iphone it reloads every time I hit the locate button. Has anyone else had this happen to them? Maybe it is bug in 3.15?
... View more
12-04-2015
01:16 PM
|
0
|
1
|
3675
|
|
POST
|
I know this is not the exact place to post this but I was wondering if it ever happened again? I have used Locate Button before on webapps and not had an issue. I opened Locate Button | ArcGIS API for JavaScript on my ipad and it reloads every time I hit the locate button. Maybe it is bug in 3.15?
... View more
12-04-2015
12:28 PM
|
0
|
1
|
2570
|
|
POST
|
Thejus, Do I add a formatter to the field in the columns section? var columns = [{
label: "", //wasn't able to inject an HTML <div> with image here
field: "OBJECTID",
formatter: makeZoomButton
}, {
label: "Location",
field: "Location"
}, {
label: "Priority",
field: "Priority"
,formatter:codedValueDomain
},{
... View more
12-04-2015
09:00 AM
|
0
|
1
|
478
|
|
POST
|
I am getting a weird result when I search for a location. I have the Editor widget and Search basic combined. When I search for a location, I can zoom to it. Then when I click on any other point to edit it, I get this result: Has anyone dealt with this? i think I am looking for a way to clear search when I click anywhere not the search point. Even when I clear the search bar I still cannot click on a point to edit:
... View more
12-04-2015
08:36 AM
|
0
|
22
|
8482
|
|
POST
|
Ashish, Can you post the code that you got to work?
... View more
12-04-2015
08:19 AM
|
1
|
0
|
1366
|
|
POST
|
I get an error of: Cannot read property '<Priority>' of undefined where priority is my field name
... View more
12-04-2015
08:13 AM
|
0
|
3
|
2520
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-28-2025 01:53 PM | |
| 1 | 08-24-2022 09:40 AM | |
| 1 | 07-19-2018 04:41 PM | |
| 1 | 04-05-2024 03:12 PM | |
| 1 | 07-04-2024 11:42 AM |