POST
|
I am having an issue replacing an ! as a character from my record. I want to replace a ! as a [blank]. I tried using this statement, but it does not work: arcpy.CalculateField_management(CISAddressSDEFL, "NEIGHBOUR", "!NEIGHBOUR!.replace(\"!\", \"\")", "PYTHON", "") All other special characters work, but not the !. Any ideas on how to perform a replace?
... View more
04-03-2017
02:15 PM
|
0
|
1
|
1138
|
POST
|
Nana, Try the attachment that I posted. Host in on your c:\inetpub\wwwroot. Like I said, still a couple of modifications that I can make.
... View more
03-24-2017
09:58 AM
|
0
|
0
|
1713
|
POST
|
Nana, My apologies for the late response. I do have a sample I can send. Do you want me to send it by email or another method? There is still some minor modifications that need to be done, but I think it will get you started.
... View more
03-22-2017
08:30 AM
|
0
|
2
|
1713
|
POST
|
Hello everyone. I have recently created a edit move tool, where a user can click a button and activate the tool, then click on a feature to move it. When done, they can click on the button to stop edits. It looks something like this: The tool works well, but I am looking to add in a tool tip to follow the cursor when the start move is clicked. Something like this: Anyone have any ideas on how I accomplish setting up a tool tip following a click of a button? Thank you for any information you might have.
... View more
03-03-2017
08:08 AM
|
0
|
1
|
1227
|
POST
|
Robert, You are correct. Going to re-work this a bit and just work with the graphics layer.
... View more
12-07-2016
07:35 AM
|
0
|
0
|
519
|
POST
|
Hello everyone. I posted in another thread, but wanted to be more specific. I have three graphic layers set up for three feature layers. The idea is to allow the user to perform a draw on the map until they are ready to post the graphic as an apply edits. The initial draw writes to the standard map.graphics layer and is cleared each time a new draw is performed. I have this working and set up where a graphic layer draws after the edits are posted.
... View more
12-06-2016
07:20 PM
|
0
|
3
|
1739
|
POST
|
John, I am still having some issues. Not sure how to clone a graphic. I can get the graphics layer to draw and stick, but when changing the map extent, it will vanish. Here is my current code: // *********************************************************************** // * Traffic Intersection 2 - Draw/Edit Tool Operations * // *********************************************************************** // Activate Draw Toolbar 2 function activateTool2() { drawToolbar2.activate(Draw.POINT); } // Create Draw and Edit Toolbars 2 function createToolbar2() { drawToolbar2 = new Draw(map); editToolbar2 = new Edit(map); drawToolbar2.on("draw-complete", addGraphicToMap2); } function addGraphicToMap2(evt) { map.graphics.clear(); newAttributes2 = {"Editor": "HS2"}; newFeature2 = new Graphic(evt.geometry, null, newAttributes2); // Adding the Geometry with Symbol to the Graphic Layer 2 symbol2GraphicsLayer.add(newFeature2, symbol2); // Adds Graphic Layer to the Map 2 map.addLayer(symbol2GraphicsLayer); value2 = map.graphics.add(new Graphic(evt.geometry, symbol2, newAttributes2)); console.log("Graphic geometry for Hot Spot 2: ", value2); } function addGraphicToTrafficInt2(evt) { value5 = trafficInt2.applyEdits([newFeature2], null, null); console.log("Graphic Applied to Feature Layer (1)", value5) // Setting the Symbol and the Graphic to the Graphic Layer 2 newFeature2.setSymbol(symbol2); symbol2GraphicsLayer.add(newFeature2); alert("You have successfully added Hot Spot 2") drawToolbar2.deactivate(); editToolbar2.deactivate(); registry.byId("Point2").on("click", function editDisconnect2(){ drawToolbar2.deactivate(); editToolbar2.deactivate(); alert("Hot Spot 2 has already been added.") }); dojo.disconnect(handle5); }; // *********************************************************************** // * Traffic Intersection 3 - Draw/Edit Tool Operations * // *********************************************************************** // Activate Draw Toolbar 3 function activateTool3() { drawToolbar3.activate(Draw.POINT); } // Create Draw and Edit Toolbars 3 function createToolbar3() { drawToolbar3 = new Draw(map); editToolbar3 = new Edit(map); drawToolbar3.on("draw-complete", addGraphicToMap3); } function addGraphicToMap3(evt) { map.graphics.clear(); newAttributes3 = {"Editor": "3"}; newFeature3 = new Graphic(evt.geometry, null, newAttributes3); // Setting the Symbol and the Graphic to the Graphic Layer 3 symbol3GraphicsLayer.add(newFeature3, symbol3); // Adds Graphic Layer to the Map 3 map.addLayer(symbol3GraphicsLayer); value3 = map.graphics.add(new Graphic(evt.geometry, symbol3, newAttributes3)); console.log("Graphic geometry for Hot Spot 3 is: ", value3); } function addGraphicToTrafficInt3(evt) { value6 = trafficInt3.applyEdits([newFeature3], null, null); console.log("Graphic Applied to Feature Layer (2)", value6) // Setting the Symbol and the Graphic to the Graphic Layer 3 newFeature3.setSymbol(symbol3); symbol3GraphicsLayer.add(newFeature3); alert("You have successfully added Hot Spot 3") drawToolbar3.deactivate(); editToolbar3.deactivate(); registry.byId("Point3").on("click", function editDisconnect3(){ drawToolbar3.deactivate(); editToolbar3.deactivate(); alert("Hot Spot 3 has already been added.") }); dojo.disconnect(handle6); }; Also, I can get the graphic layer to stick, but when panning on the map until the graphic disappears from the view, it then disappears. Here is an example of the three graphics layers at once: And when performing a pan until the blue pushpin is outside of the current view: Then pan back over and the blue pushpin is gone: How can I get my graphic layers from disappearing? Only want them to disappear when the map is closed. This is a tricky one. Thanks for any additional help.
... View more
12-06-2016
06:55 PM
|
0
|
0
|
777
|
POST
|
Good morning. I have a working app, but I have running into an issue with the graphics. I have the app set up, where the user can make a number of picks (draw points) on the map until they are ready to submit (applyEdits) to the feature layer. Right now, I use the standard map graphics layer and clear the graphic each time the user makes a click on the map. I do not want to display the graphic each time the user makes a pick, only have it display as they make an individual pick. Now for the tricky part. After the user makes their final pick and decides to submit, I want the graphics to remain on the map until the application closes. To do this, I have set up a Graphics layer, The problem is, when I pass in the geometry (feature), the graphic displays as I want, but only if the Feature Layer is set to Visible: True. I need the Feature Layer to remain Visible: False, since the data will be sensitive to the Public. When the Feature Layer is set to Visible: False, The graphics layers becomes hidden as well. So in short, how can I have the feature layer where the visibility is set to false, yet have the Graphics layer display? Below are samples of my work flow and some code: 1. Drawing the Point and submitting after 3 picks (the third pick is the point I want to submit) Buttons used to perform draw and submit Performing a Draw using the Draw Hot Spot 1. On the third pick, I want to submit. The graphic is cleared as I want. Notice how the graphic disappears each time it is re-drawn. I want this to occur by design. Pick 1 Pick 2 Pick 3 When hitting the Submit Hot Spot Button, it posts to the feature layer with an alert. Now when going to Draw Hot Spot 2, notice how a new graphic is drawn, but the blue pushpin disappears. This is what I do not want. Now for the code: Graphics Layer: // Symbols - Picture Marker Symbols symbol1 = new PictureMarkerSymbol('http://gis.edmondok.com/tfstudy/graphics/pushpin_blue.png', 30, 30); symbol2 = new PictureMarkerSymbol('http://gis.edmondok.com/tfstudy/graphics/pushpin_green.png', 30, 30); symbol3 = new PictureMarkerSymbol('http://gis.edmondok.com/tfstudy/graphics/pushpin_red.png', 30, 30); // Graphics Layers with Picture Symbols var symbol1GraphicsLayer = new GraphicsLayer(); var symbol2GraphicsLayer = new GraphicsLayer(); var symbol3GraphicsLayer = new GraphicsLayer(); Feature Layer: // Feature Layers // 01. Traffic Intersections 1 //var trafficInt1 = new FeatureLayer("http://services6.arcgis.com/rCwK7cyJnCFF9MvM/arcgis/rest/services/TrafficIntersections/FeatureServer/0", { var trafficInt1 = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/6", { mode: FeatureLayer.MODE_SNAPSHOT, visible: false, outFields: ["*"] }); Draw and Editing // Create Draw and Edit Toolbars 1 function createToolbar1() { drawToolbar1 = new Draw(map); editToolbar1 = new Edit(map); drawToolbar1.on("draw-complete", addGraphicToMap1); } function addGraphicToMap1(evt) { map.graphics.clear(); newAttributes1 = {"direction": "1"}; newFeature1 = new Graphic(evt.geometry, null, newAttributes1); value1 = map.graphics.add(new Graphic(evt.geometry, symbol1, newAttributes1)); console.log("Graphic geometry for Hot Spot 1 is: ", value1); } function addGraphicToTrafficInt1(evt) { value4 = trafficInt1.applyEdits([newFeature1], null, null); console.log("Graphic Applied to Feature Layer (0)", value4) // Graphics Layer and Adding Geometry newFeature1.setSymbol(symbol1); symbol1GraphicsLayer.add(newFeature1); map.addLayer(symbol1GraphicsLayer); alert("You have successfully added Hot Spot 1") drawToolbar1.deactivate(); editToolbar1.deactivate(); registry.byId("Point1").on("click", function editDisconnect1(){ drawToolbar1.deactivate(); editToolbar1.deactivate(); alert("Hot Spot 1 has already been added.") }); dojo.disconnect(handle4); }; Anyone have any ideas? As always, thanks for the feedback.
... View more
12-02-2016
07:27 AM
|
0
|
2
|
1870
|
POST
|
Kelly, thank you much for your response. Do you think this works really well if you add the layers to the map? Your sample, just has the template picker itself. I ended up going a different route. Instead of using the template picker, I created buttons and wired my draws/edits to them. Also working with the .css for the template picker is a headache. The widget itself tends to do some weird things at times. I now allow for a user to click on the button, perform a draw of points, then they can hit a submit button to post their graphic to the feature layer. So, you can make as many draws as you want until you are satisfied with the position of the final graphic, then you can apply edits to the feature layer. Here is what I did: And how it looks within the app: Sample shows a graphic that has been applied (to ESRI layer), the other is in draw mode (pushpin).
... View more
12-01-2016
07:03 AM
|
1
|
1
|
856
|
POST
|
Kelly, Here is how the layers are added to the application: The ordering of the add by feature layer ID goes: 0,1,2. As far as my template picker code goes, here is more of it: I tried using (inserted at line 137, then commented out lines 133 to 135): layers[evt.layer.layerId] = evt.layer; instead of (lines 133 to 135): layers = arrayUtils.map(evt.layers, function(result) { return result.layer; }); But that does not work. I refreshed again and again and the layers still re-order. That is how I do it. I also tried with the ESRI sample and it has the same behavior. Here is the sample I am referring to: https://developers.arcgis.com/javascript/3/samples/ed_feature_creation/ Keep refreshing this sample and you will see the same behavior. Any ideas? Ian
... View more
11-28-2016
06:24 AM
|
0
|
4
|
856
|
POST
|
Hello everyone. I have added a template picker to an application that contains 3 feature layers. When the application loads, the template picker appears as it should (in order): However, if I refresh the browser, the ordering can change: When refreshing again: And a final refresh: As you can see, the order of which the template picker is populated changes each time. There are no errors in console mode. The layers appear in the following order at the rest endpoint Feature services are hosted on arcgisonline. My template picker code is as follows: // Template Picker var templatePicker = new TemplatePicker({ featureLayers: layers, rows: "auto", columns: 3, grouping: false }, "templatePickerDiv"); templatePicker.startup(); // Template Picker Widget - Selection Only Add Point var selectedTemplate; templatePicker.on("selection-change", function() { if( templatePicker.getSelected() ) { selectedTemplate = templatePicker.getSelected(); console.log("Name", selectedTemplate); drawToolbar.activate(Draw.POINT); } }); Is there a way to get around this issue? How can I keep the layer ordering locked in going 1,2,3. I cannot have users bouncing all over the place to add a graphic to a map. Has anyone else experienced this issue?
... View more
11-23-2016
08:30 AM
|
0
|
6
|
1469
|
POST
|
Steve, thank you for your response. The biggest issue I was was getting the counter to work properly. It would have helped if I would of taken it out of the function, because I was getting a constant value of 1 each time. Here is what was done: 1. Set a global variable var count = 0; 2. Logic for the draw on end: // Draw Toolbar on End drawToolbar.on("draw-end", function(evt) { // Comment out line of code below to allow for adding mult //drawToolbar.deactivate(); editToolbar.deactivate(); var newAttributes = lang.mixin({}, selectedTemplate.template.prototype.attributes); // Set up Counter for Graphic Added count = count + 1; console.log("Graphic Count", count); if (count <=3) { // Add Graphics for Symbol Placement map.graphics.add(new Graphic(evt.geometry, symbol)); // Feature Graphic and Apply Edits var newGraphic = new Graphic(evt.geometry, null, newAttributes); // Apply Edits selectedTemplate.featureLayer.applyEdits([newGraphic], null, null); } else { drawToolbar.deactivate(); editToolbar.deactivate(); alert(" You have successfully completed 3 edits!"); } return count; }); This works really well! For sure, this was a new challenge.
... View more
11-22-2016
09:43 AM
|
0
|
0
|
824
|
POST
|
Hello everyone. I am working on a new application that has a template picker that works really well. I am looking to limit the user where they can only add three points to the map and that is it. Currently, I have it set up where you click on the template picker, you are in constant draw/editing mode. Looking to set up a loop on clicks and when you hit 3, you will get an alert that says, "you have added 3 points". Is there a way I can trap the mouse clicks or the number of edits applied? I am a bit stuck on this...any assistance would greatly be appreciated. Below is my code block: // ************************************************* // * Editing Code Block * // ************************************************* function initEditing(evt) { var layers = arrayUtils.map(evt.layers, function(result) { return result.layer; }); // Editor Toolbar var editToolbar = new Edit(map); // Draw Toolbar used to Draw Graphic during Editing var drawToolbar = new Draw(map); // Template Picker Widget var templatePicker = new TemplatePicker({ featureLayers: layers, rows: "auto", columns: 1, grouping: false }, "templatePickerDiv"); templatePicker.startup(); // Template Picker Widget - Selection Only Add Point var selectedTemplate; templatePicker.on("selection-change", function() { if( templatePicker.getSelected() ) { selectedTemplate = templatePicker.getSelected(); console.log("Name", selectedTemplate); drawToolbar.activate(Draw.POINT); } }); drawToolbar.on("draw-end", function(evt) { // Loop Variables //var count = 0; //var i = 0; //drawToolbar.deactivate(); //editToolbar.deactivate(); var newAttributes = lang.mixin({}, selectedTemplate.template.prototype.attributes); console.log("Attributes", newAttributes); var newGraphic = new Graphic(evt.geometry, null, newAttributes); selectedTemplate.featureLayer.applyEdits([newGraphic], null, null); /* -- Code Not working ---- Commented Out -------------------------------------------------------- for(i=0; i<4; i++) { var newGraphic = new Graphic(evt.geometry, null, newAttributes); count = count + 1; console.log("Ian Count", count); } if(count < 4) { selectedTemplate.featureLayer.applyEdits([newGraphic], null, null); } else { //drawToolbar.deactivate(); //editToolbar.deactivate(); alert(" You have successfully completed 3 edits!"); } */ -- Code Not working ---- Commented Out -------------------------------------------------------- }); }
... View more
11-21-2016
02:14 PM
|
0
|
2
|
1880
|
POST
|
Hello Robert, thanks for your response as always. I did figure out another solution. Instead of using .dgrid-field-FIELDNAME, I instead use .dgrid-column-0, .dgrid-column-1, .dgrid-column-2, and so on. I use the ID Number. Aliases with spaces will not work, so went to the ID instead. That seems to work pretty. Here is a sample of how the data grid appears using .css to specify the field widths: I get the fixed widths, but I am trying to take it a step further and make the fields resizable. So if you start at 100px, you can expand to the right. So far, I have been unsuccessful. I checked ESRI sample and noticed that their fields are fixed and not expandable. Here is a sample I am referring to: https://developers.arcgis.com/javascript/3/samples/find_map_datagrid/ Any ideas on how to make the entire cell resizable? .
... View more
11-16-2016
01:38 PM
|
0
|
1
|
800
|
POST
|
I have a custom data grid within my application. I have been able to get it to work, but the array of attributes only works according to the alias. Some of my attributes have spaces in the alias. Here is an example: The problem is, in my .css file, I cannot control the widths of the attributes that contain spaces. Attributes such as Name, Address, and Email are fine because there are no spaces. Here is how it appears from the data grid: Notice how the fields following Email are close together. Is there a way I can accept spaces for my field aliases in .css without having to make alias changes on the data side? The zip code and map page fields will not appear in my datagrid. Should I look for the column ID instead? Any suggestions will greatly be appreciated. Thanks.
... View more
11-15-2016
02:52 PM
|
0
|
3
|
1330
|
Title | Kudos | Posted |
---|---|---|
1 | 04-01-2022 05:53 AM | |
1 | 09-18-2018 06:17 AM | |
1 | 06-19-2018 10:31 AM | |
1 | 05-15-2018 10:42 AM | |
1 | 10-14-2015 03:59 PM |
Online Status |
Offline
|
Date Last Visited |
04-04-2022
06:43 AM
|