|
POST
|
for some reason, when selecting a feature onEdit mode, the EditTemplate window is not showing up. I have it setup to custom fields as code below: appEditor = {
Edit: function (evt) {
// alert(evt);
if (evt === "Permit") {
if (editorWidget) {
editorWidget.destroy();
editorWidget = null;
}
var txtSewerPermit = new dijit.form.TextBox({
id: "txtSP",
required: false,
promptMessage: "Add Sewer Permit",
style: "height:1.8em; width:260px;margin:2px; background-color:#ffd800"
});
var txtWaterPermit = new dijit.form.TextBox({
id: "txtWP",
required: false,
promptMessage: "Add Water Permit",
style: "height:1.8em; width:260px;margin:2px; background-color:#ffd800"
});
var templateLayers = [permit];
var eDiv = document.createElement("div");
eDiv.id = "editDiv";
document.getElementById('EditContent1').appendChild(eDiv);
var eDivTools = document.createElement("div");
eDivTools.id = "editDivTools";
document.getElementById('EditContent1').appendChild(eDivTools);
map.infoWindow.resize(400, 350);
var editLayerPermit1 = [{
featureLayer: permit,
showDeleteButton: false,
fieldInfos: [
{ 'fieldName': 'Date', 'label': '<table><tr><td style="width:260px;height: 1.8em; margin:2px">Date: </td></tr></table>' },
{ 'fieldName': 'ADDRESS', 'label': '<table><tr><td style="width:260px;height: 1.8em; margin:2px">Address: </td></tr></table>' },
{ 'fieldName': 'SewerPermit', 'label': 'Sewer Permit: ', customField: txtSewerPermit },
{ 'fieldName': 'WaterPermit', 'label': 'Water Permit: ', customField: txtWaterPermit },
{
'fieldName': 'SERVICE_ID', 'label': 'Add Permit: ', customField: "<br /><b> Sewer Permit</b>: <br />" +
"<div id='progressNumberSP' style='padding:2px; color:red'></div><input type='file' name='fileToUploadSP' id='fileToUploadSP' onclick='if(!getNoneTxt){this.disabled = true; return false}' onchange='uploadFileSP(this.files[0]);' />" +
"<br /><br /><b>Water Permit</b>: <div id='progressNumberWP' style='padding:2px; color:red'></div><input type='file' name='fileToUploadWP' id='fileToUploadWP' onchange='uploadFileWP(this.files[0]);' />"
}
]
}]; // editLayers;
var templatePicker = new esri.dijit.editing.TemplatePicker({
featureLayers: templateLayers,
rows: 'auto',
columns: 3
}, 'editDiv');
templatePicker.startup();
var settings = {
map: map,
templatePicker: templatePicker,
layerInfos: editLayerPermit1, //editLayerSitePlan1
toolbarVisible: true,
enableUndoRedo: true
};
var params = {
settings: settings
};
editorWidget = new esri.dijit.editing.Editor(params, 'editDivTools');
editorWidget.startup();
}
} here is the error I get: TypeError: undefined is not a function {stack: (...), message: "undefined is not a function"} "TypeError: undefined is not a function at v._createField (http://js.arcgis.com/3.10/js/esri/dijit/AttributeInspector.js:30:440) at h._hitchArgs (http://js.arcgis.com/3.10/init.js:173:204) at Object.h.forEach (http://js.arcgis.com/3.10/init.js:225:144) at v._createTable (http://js.arcgis.com/3.10/js/esri/dijit/AttributeInspector.js:28:56) at v._setCurrentLInfo (http://js.arcgis.com/3.10/js/esri/dijit/AttributeInspector.js:19:432) at v._showFeature (http://js.arcgis.com/3.10/js/esri/dijit/AttributeInspector.js:23:86) at v._updateSelection (http://js.arcgis.com/3.10/js/esri/dijit/AttributeInspector.js:20:101) at v.onLayerSelectionChange (http://js.arcgis.com/3.10/js/esri/dijit/AttributeInspector.js:10:321) at h._hitchArgs (http://js.arcgis.com/3.10/init.js:173:204) at h.(anonymous function).g [as onSelectionComplete] (http://js.arcgis.com/3.10/init.js:239:390) ---------------------------------------- rejected at a (http://js.arcgis.com/3.10/init.js:196:337) at k (http://js.arcgis.com/3.10/init.js:196:89) at f.then.b.then [as then] (http://js.arcgis.com/3.10/init.js:198:308) at S.selectFeatures (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:38:212) at http://js.arcgis.com/3.10/js/esri/dijit/editing/SelectionHelper.js:5:469 at Object.h.forEach (http://js.arcgis.com/3.10/init.js:225:179) at l.selectFeatures (http://js.arcgis.com/3.10/js/esri/dijit/editing/SelectionHelper.js:5:325) at l.selectFeaturesByGeometry (http://js.arcgis.com/3.10/js/esri/dijit/editing/SelectionHelper.js:7:214) at v._updateSelection (http://js.arcgis.com/3.10/js/esri/dijit/editing/Editor.js:39:519) at null.<anonymous> (http://js.arcgis.com/3.10/js/esri/dijit/editing/Editor.js:33:428) ---------------------------------------- Error at f.then.b.then [as then] (http://js.arcgis.com/3.10/init.js:198:253) at S.selectFeatures (http://js.arcgis.com/3.10/js/esri/layers/FeatureLayer.js:38:212) at http://js.arcgis.com/3.10/js/esri/dijit/editing/SelectionHelper.js:5:469 at Object.h.forEach (http://js.arcgis.com/3.10/init.js:225:179) at l.selectFeatures (http://js.arcgis.com/3.10/js/esri/dijit/editing/SelectionHelper.js:5:325) at l.selectFeaturesByGeometry (http://js.arcgis.com/3.10/js/esri/dijit/editing/SelectionHelper.js:7:214) at v._updateSelection (http://js.arcgis.com/3.10/js/esri/dijit/editing/Editor.js:39:519) at null.<anonymous> (http://js.arcgis.com/3.10/js/esri/dijit/editing/Editor.js:33:428) at h.hitch (http://js.arcgis.com/3.10/init.js:174:23) at v._updateCurrentFeature (http://js.arcgis.com/3.10/js/esri/dijit/editing/Editor.js:17:126)"
... View more
03-09-2015
10:37 AM
|
0
|
2
|
4172
|
|
POST
|
Hi Rene, Sorry I am still having problems with this. here is the code map.graphics.add(new Graphic(evt.geometry, symbol)); var point = evt.geometry.getCentroid(); var point2 = new esri.geometry.Point(Number(point.x), Number(point.y), map.spatialReference); var mp = esri.geometry.geographicToWebMercator(point2); console.log(point2.x + " , " + point2.y); console.log(mp); and here is the output : and it is still failing when calling locator.locationToAddress()
... View more
02-06-2015
12:37 PM
|
0
|
1
|
2097
|
|
POST
|
Hi Robert, yes I did try that still no luck. the image bellow shows the fields that need to be auto filled.
... View more
02-04-2015
08:34 PM
|
0
|
2
|
1511
|
|
POST
|
I am trying to auto populate the custom fields in the editor but no luck. here is what I thought would work by assigning the value to the textBox but nothing...
var someValue = "My value";
var myTextBox = new dijit.form.TextBox({
id: "firstname",
value: someValue
});
var txtEmail = new dijit.form.TextBox({
id: "email",
value: "my email here"
});
var layerInfos = [{
'featureLayer':featureLayer,
'showAttachments':false,
'showDeleteButton':true,
'fieldInfos':[
{'fieldName':'name','label':'Name','customField': myTextBox},
{'fieldName':'email','label':'Email','customField': txtEmail}
]
}];
... View more
02-04-2015
08:12 PM
|
0
|
5
|
5771
|
|
POST
|
Thank you Dene. I am trying your approach which I think should be able to work. the getCentroid method works fine but when calling the reverse geocode I get this error: Invalid query parameters which I believe may be related to the coordinates x and y?
... View more
02-02-2015
08:45 AM
|
0
|
3
|
2097
|
|
POST
|
I have this logic that I am trying to accomplish: I would like to get the centroid point of the polygon after being created and then perform the reverse geocode from that point to get informtions such as the full address, the county and township. Any advice on accomplishing this? Also, since the update on editor is done automatically, I am wondering if there could be an event handler for editor complete or update complete!?
... View more
01-31-2015
04:40 PM
|
0
|
8
|
5853
|
|
POST
|
is the TOC not working anymore in 3.12 API? <script src="http://js.arcgis.com/3.12/"></script> <script type="text/javascript"> var djConfig = { parseOnLoad: true, packages: [{ "name": "agsjs", "location": "http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/build/agsjs" }] }; </script> it worked for 3.11 and now in 3.12 just getting this error even if I access the file locally. the reference is set to: "agsjs/dijit/TOC"
... View more
01-29-2015
09:41 AM
|
0
|
3
|
3741
|
|
POST
|
is there a streets intersection finder (geocoder) as in google map in the 3.12 API? I am looking for something similar as on google map where the user types in two streets names and locate the intersection point: ex: n high st and hudson st,
... View more
01-10-2015
11:28 AM
|
0
|
3
|
13223
|
|
POST
|
Thank you Ken for your reply. I am really having a hard time with this legend. here is the desired output I want, and at the moment it displaying as image below which is way too long: I am not sure may be I am using your script wrong?
... View more
01-08-2015
08:05 AM
|
0
|
1
|
2426
|
|
POST
|
is there a way to have all layers collapsed in TOC on first load? I tried toc = new TOC({ map: map, layerInfos: [{ layer: layer, title: "Title", collapsed: true .... Nothing, I also tried republishing the service by having all layers collapsed but the widget did not cary that behavior.
... View more
01-07-2015
10:21 AM
|
0
|
8
|
6599
|
|
POST
|
I rewrote the function initEditor and this time when I select the template, I get this error: "Uncaught TypeError: Cannot read property 'activate' of undefined" here is the function that Call on button click: function initEditor(evt) { var templatePicker = new TemplatePicker({ featureLayers: [permit, sitePlan], grouping: true, rows: "auto", columns: 3 }, "templateDiv"); templatePicker.startup(); var layers = map.on("layers-add-result", function (result) { return { featureLayer: result.layer }; }); //var layers = dojo.connect(map, "onLoad", function (result) { // return { featureLayer: result.layer }; //}); console.log("Hi Test"); var settings = { map: map, templatePicker: templatePicker, layerInfos: layers, toolbarVisible: true, showAttributesOnClick: true, createOptions: { polylineDrawTools: [esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYLINE], polygonDrawTools: [esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON] }, toolbarOptions: { reshapeVisible: true } }; var params = { settings: settings }; var myEditor = new esri.dijit.editing.Editor(params, 'editorDiv'); //define snapping options var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CROSS, 15, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0, 0.5]), 5 ), null ); map.enableSnapping({ snapPointSymbol: symbol, tolerance: 20, snapKey: keys.ALT }); myEditor.startup(); }
... View more
10-28-2014
02:27 PM
|
0
|
0
|
691
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-12-2024 07:03 AM | |
| 1 | 12-11-2024 02:20 PM | |
| 2 | 06-27-2023 09:06 PM | |
| 1 | 12-17-2021 08:58 AM | |
| 3 | 12-17-2021 09:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-12-2024
05:34 PM
|