POST
|
Good afternoon, In the default Editor widget, an edited feature's infoTemplate is displayed when the user places an object on the map. That infoTemplate has a 'Delete' button at the bottom (see the screenshot below). Can this button be moved or placed somewhere else? Alternately, can I create my own button that would call the same function to remove that feature from the map? I ask because my app will not use the default infoTemplate for editing data and I want users to have access to that delete function. Thanks in advance for taking a look! Jim [ATTACH=CONFIG]23961[/ATTACH]
... View more
05-02-2013
09:31 AM
|
0
|
0
|
1092
|
POST
|
Hi Jim, I was able to reproduce the same error message. Calling destroy() should prevent this. After calling the destroy method, I checked the dijit.registry and the editorDiv widget was not there. I'm not sure where else this could be stored. This may be a bug. I'm curious, when you enable editing do you have to execute your menu selection twice when you start an edit session for the first time? When I start my edit session for the first time, I have to click on the 'Start Editing' button twice. Steven beat me to it (by some time, I need to check the forum more often!). Since my code has the dojo.connect call before adding the layer, I did not see the behavior you mentioned. About calling destroy() on the widget, I found the issue. Destroy() doesn't do enough - according to the Dojo documentation, destroy() doesn't remove a widget's descendants. So the error crops up because parts of the widget are never destroyed. I changed the destroy() call to destroyRecursive(false) and it solved the problem. Now, each time the 'Edit' button is activated, it creates a 'new' editor, so there's no more conflicts. From the Dojo documentation: This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it is removed from the manager object. source: http://dojotoolkit.org/api/1.7/dijit/_Widget/destroyRecursive Hope this helps Jake!
... View more
04-30-2013
07:27 AM
|
0
|
0
|
402
|
POST
|
Sorry to revive an older thread, but I found the thread while debugging a similar activate editing button in my app. I have a 'Done' button in the container with my editor that turns the editor off, and then a menu selection that turns editing on. When the user clicks 'Done' I call 'editorWidget.destroy()' and remove the DOM nodes. When the editor is reactivated I recreate the nodes. However, in my console, I get an error message - "Tried to register widget with id==editorDiv but that id is already registered". I thought calling destroy() prevents that from happening? The editor seems to work despite the error, but I don't want this error to display to users. Any thoughts on this? Thanks, Jim
... View more
04-26-2013
06:57 AM
|
0
|
0
|
402
|
POST
|
The 'onEditsComplete' event returns 3 arrays as it's arguments addResults, updateResults, deleteResults http://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#onEditsComplete dojo.connect(editorWidget, 'onEditsComplete', function(addResults, updateResults, deleteResults){
console.log('addResults: ', addResults);
console.log('updateResults: ', updateResults);
console.log('deleteResults: ', deleteResults);
}); Similarly, you can capture the results before they are sent to the server, by listening for 'onBeforeApplyEdits' http://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#onBeforeApplyEdits I think you can modify the edits, but cannot cancel them if something doesn't meet your criteria. Rene, that's precisely what I needed! I connected to 'onBeforeApplyEdits' and got the data payload before sending to the server. From there I found the XY I needed.
dojo.connect(featureLayer, "onBeforeApplyEdits", function(e){
var newPointX = e[0].geometry.x, newPointY = e[0].geometry.y;
//Go to town from here
});
Sincerely appreciate the help, thanks!
... View more
04-23-2013
06:35 AM
|
0
|
0
|
237
|
POST
|
Hi Jim, You can do this using the "onEditsComplete" event along with the "onDrawEnd" event. Here is an example: dojo.connect(operationsPointLayer, "onEditsComplete", function(){
var tb = new esri.toolbars.Draw(map);
tb.activate(esri.toolbars.Draw.POINT);
dojo.connect(tb, "onDrawEnd", function(geometry){
console.log("X: " + geometry.x + ", Y: " + geometry.y);
});
tb.deactivate();
} Thanks again for your help Jake... I tried 'onDrawEnd' the way you suggested, but no dice. When I logged the 'onEditsComplete' event, I got a result, but not the one I expected:
//Event object
{
declaredClass : "esri.layers.FeatureEditResult",
objectId : "208281",
success : "true"
}
Since I get the ObjectId from onEditsComplete, maybe I can search the map for that object and get the XY that way? I'm not sure if there's a more efficient or better way to do it... Also, a question on the draw functions: Doesn't picking a selection in the Editor widget turn on the draw toolbar just for that selection? When I tested it, I had to select an editor to drop a point, and then select again to drop another point. Is there a way to look at the data from the edit pre-flight, like a 'beforeEdits' event? My Google-Fu didn't find anything like that. Thanks again for taking a look!
... View more
04-23-2013
05:45 AM
|
0
|
0
|
237
|
POST
|
Apologies if a similar question was asked before... When using the default editing widget (using code from this sample), how can I capture the the geometry of the user-added feature? Using Firebug I can see this data in the JSON payload sent to the server during the ApplyEdits operation (i.e. XY coordinates of a new point). Is there an event I can connect to in order to capture that data? I tried: //Try #1, didn't fire or give an error dojo.connect(editorWidget, 'onDrawEnd', function(evt){ console.log(evt); }); //Try #2, nothing dojo.connect(map.getLayer(featureLayer.id), 'onclick', function(evt){ console.log(evt); }); Thanks for your help! Jim
... View more
04-22-2013
09:40 AM
|
0
|
4
|
736
|
POST
|
James You can do this with the api you just need to handle many of the update events yourself. The feature layer has an applyEdits method that can be used to add, update and delete features. Here's code for a simple use case where we are editing a point feature layer with only one feature template. In this app just click the 'Add Note' button and you'll see a new note added to the map and the attribute inspector will appear. <snip> Kelly, This is also very helpful, I think this will come in handy! Thank you both for your assistance! Enjoy the weekend!
... View more
04-12-2013
11:30 AM
|
0
|
0
|
650
|
POST
|
I marked the last answer as the solution because it looks like changing the CORS settings would get the code above working just fine. Ultimately, we decided to not fight the API and will work with the Editor widget after all. I already have the widget configured with our map services. We'll use it to vary the types of points a user can add to the service. Thanks for your help!
... View more
04-12-2013
11:06 AM
|
0
|
0
|
650
|
POST
|
I tried using the sample code above, as well as dojo.xhrPost and dojo.xhrGet. I cannot get the feature layer to accept a point this way. I get two errors - one says 405 (Method not allowed) and the other says my address "is not allowed by Access-Control-Allow-Origin". Not sure why I'd get a CORS error with a POST, as I don't get this error when POSTing to other internal servers. Any thoughts?
... View more
04-12-2013
10:02 AM
|
0
|
0
|
650
|
POST
|
@Jake, Thanks for the idea and the code sample. I'll give it a test after lunch and let you know how it works out. Just curious, any thoughts or ideas on why that functionality doesn't have an out-of-the-box solution in the API? Jim
... View more
04-12-2013
08:15 AM
|
0
|
0
|
650
|
POST
|
Good morning, I am working with a large Javascript-based app using the 3.2 JS API and ArcGIS 10 map services. We need to add editing capabilities to the app. The editor will be kicked off with a button click, and the user can add points or edit existing points. Where I'm getting stuck, however, is how to implement the editor. My Google-Fu failed to answer my question, and I've reviewed all the editing samples in the documentation. It appears that each sample relies on a large on-screen panel to select graphics types. All I want users to do is click the map to add a point, and then get the infoWindow pop-up form where they can input data. I do not want any other widgets, toolbars, or templatepickers on-screen. Basically, I want the point editing capabilities in this sample without the sidebar on the left: http://developers.arcgis.com/en/javascript/jssamples/ed_default_editingwidget.html Can anyone point me in a direction (existing apps, blogs, etc) to help me implement this type of editor, or at least to get started? Thanks!
... View more
04-12-2013
06:31 AM
|
0
|
8
|
1408
|
POST
|
I believe I solved this one, so I'll post what I did, hoping it helps someone else... In addition to map highlights, the requirements called for a compass rose. Decided to just add a DIV with a custom image, so I created one in PNG. When I tested print layout, the compass rose didn't print, but the map highlights did! To test further, I took the image out. Sure enough, with the next print test, no highlights! My theory at this point was that IE omitted the topmost graphics layer from printing. I whipped up a 1x1 pixel #FFF PNG and added that to the top of the map and... voila! The map printed properly, complete with highlight and compass rose. This solution is quite hackish, but then again, what IE code isn't? 🙂 I added two spans to the map DIV with the following CSS: #compass { background : transparent url('../../../../images/compass.png') center no-repeat; height:100px; left:0; position:absolute; top:0; width:100px; z-index:10; } #onepixel { background : transparent url('../../../../images/1by1.png') center no-repeat; height:1px; left:0; position:absolute; top:0; width:1px; z-index:9; } Thanks jeff.pace for taking a look at the issue!
... View more
05-21-2012
06:18 AM
|
0
|
1
|
436
|
POST
|
jeff.pace what function are you using to print? This is more than likely due to the wonderful fact the IE does not support svg and therefore using a vml graphics renderer. I'm using good ol' CTRL+P, which is what my users would most likely do as well. Any way to convert the graphics from SVG to VML? Thanks for taking a look, Jim EDIT: Did some Googling, looks like VML is IE proprietary (of course). Found some info on converting from SVG to VML with XSLT but I don't know if that can be done with the ESRI graphics? I'm not all that familiar with XSLT...
... View more
05-17-2012
08:43 AM
|
0
|
0
|
436
|
POST
|
Good afternoon, I'm building dynamic reports that pull tract data from our database. I include a map of the location at the bottom of the page. When I print the report in standard-compliant browsers, everything displays properly. When using Internet Explorer 8, however, only the map itself prints - the map.graphics layer does not print. Searched for a solution to this issue to no avail... this thread was the closest I found but had no resolution that seemed effective. Tried selecting 'Print background images & colors' in IE preferences - no dice. I don't believe I'm doing anything wrong with my function call to draw the graphics (they do display across all browsers on-screen), here it is for reference: sendQuery = task.execute(query); sendQuery.then(function(loc) { symbol = new esri.symbol.SimpleFillSymbol(); symbol.setColor(new dojo.Color([255,0,0,0.5])); gfx= loc.features[0].geometry; map.graphics.add(new esri.Graphic(gfx, symbol)); }); The obvious answer, 'print from FF', unfortunately doesn't work because IE support is a requirement for the report. Any thoughts or code snippets that can get me going in the right direction would be greatly appreciated! Thanks in advance! Jim
... View more
05-17-2012
08:21 AM
|
0
|
5
|
1166
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|