POST
|
Sort of hacky, but I made this work with: <form id="newForm"> <div class="form-group" id="crDoc1"> <input class="form-control" id="crDocInput1" type="file"/> </div> <div class="form-group" id="crDoc2"> <input class="form-control" id="crDocInput2" type="file"/> </div> <div class="form-group" id="crDoc3"> <input class="form-control" id="crDocInput3" type="file"/> </div> </form> Several inputs for file inside of one form node, with no name="attachment" on any. Then on a button click: docInputs = ["crDocInput1", "crDocInput2", "crDocInput3"]; for (k=0;k<docInputs.length;k++){ if (document.getElementById(docInputs ).files.length != 0){ document.getElementById(docInputs ).name = "attachment"; var formNode = document.getElementById("newCheckForm"); relatedTable.addAttachment(objectId, formNode, function success(success){ console.log(success); }, function error(err){ console.log(err); }); document.getElementById(docInputs ).name = ''; } This takes a list of the file inputs, loops through them and if they are not empty, assigns the "attachment" name to the input, submits to the appropriate objectID, and then removes the "attachment" name.
... View more
10-11-2017
12:21 PM
|
0
|
0
|
1399
|
POST
|
Yes - trimming that down to require([ "esri/map", "esri/toolbars/draw", "esri/dijit/Print", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/LayerDrawingOptions", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/graphic", "esri/renderers/ClassBreaksRenderer", "esri/config", "dojo/_base/array", "esri/Color", "dojo/parser", "dojo/query", "dojo/dom", "dojo/dom-construct", "dijit/form/CheckBox", "dijit/form/Button", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function( Map, Draw, Print, ArcGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, LayerDrawingOptions, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Graphic, ClassBreaksRenderer, esriConfig, arrayUtils, Color, parser, query, dom, domConstruct, CheckBox, Button ) { parser.parse(); esriConfig.defaults.io.proxyUrl = "/proxy/"; // print dijit var printer = new Print({ map: map, url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" }, dom.byId("printButton")); printer.startup(); }); and integrating gives the error: Tried to register widget with id==dijit_layout_BorderContainer_0 but that id is already registered. Commenting out the parser or ignoring this error gives the error: PrintTask.js:33 Uncaught TypeError: Cannot read property 'length' of undefined
... View more
10-06-2017
12:00 PM
|
0
|
3
|
386
|
POST
|
I'm trying that now, but get a vague error every time I run the print task. Just says "unable to complete operation". printFunction is tied onclick to a button in the app. require([ "esri/map", "esri/tasks/PrintTask", "esri/tasks/PrintParameters" ], function(Map, PrintTask, PrintParameters) { printFunction = function(){ var printTask = new PrintTask("my server's print task OR arcgis print task - neither works"); var params = new PrintParameters(); params.map = map; printTask.execute(params, printResult); function printResult(success){ console.log(success); } } });
... View more
10-06-2017
11:14 AM
|
0
|
5
|
980
|
POST
|
So I've determined after a lot of troubleshooting that the hover popup isn't working for me because of some print functionality I have implemented. I am declaring the gfxRenderer in dojoConfig to be "canvas" in order to print the graphics to a canvas and then to PDF/PNG when the user chooses to. Unfortunately what this means is that the graphics are no longer rendered as SVG and lose their ability to respond to mouse events. When I remove the "canvas", the hover popup works, but the print does not. The print functionality I've modified from GitHub - WSDOT-GIS/arcgis-map-thumbnail-builder: Exports an image of an ArcGIS API for JavaScript map. , with the issue arising in the "map-to-canvas". Would you have any ideas on how to make these compatible?
... View more
10-05-2017
08:26 PM
|
0
|
7
|
980
|
POST
|
Does anyone have any input on how to work around this issue? Having same problem in 3.18. Thanks!
... View more
10-05-2017
07:12 PM
|
0
|
0
|
297
|
POST
|
I am attempting to use the Editor widget from the JS API - my editor initializes and I can see all of the layers/symbols available that I want to be able to edit. Clicking on one and drawing on the map creates a feature, but the attribute inspector never opens. Clicking on an already created feature also does not open the attribute inspector. Code is below. Not all layers in my application should be editable, so I am looping through a list to add them to the editor widget. This works fine. The init edit function is fired when a button is clicked, which opens a panel containing the edit Div. var editor; var templatePicker; require([ "esri/map", "esri/tasks/GeometryService", "esri/layers/FeatureLayer", "esri/Color", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/dijit/editing/Editor", "esri/dijit/editing/TemplatePicker", "esri/config", "dojo/i18n!esri/nls/jsapi", "dojo/_base/array", "dojo/parser", "dojo/keys", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!" ], function( Map, GeometryService, FeatureLayer, Color, SimpleMarkerSymbol, SimpleLineSymbol, Editor, TemplatePicker, esriConfig, jsapiBundle, arrayUtils, parser, keys ) { // snapping is enabled for this sample - change the tooltip to reflect this jsapiBundle.toolbars.draw.start = jsapiBundle.toolbars.draw.start + "<br>Press <b>ALT</b> to enable snapping"; // refer to "Using the Proxy Page" for more information: https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html //esriConfig.defaults.io.proxyUrl = "/proxy/"; //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications. esriConfig.defaults.geometryService = new GeometryService(geometryService); initEditor = function(evt) { document.getElementById("pnlEdit").style.height = spatialEditSize; var templateLayers = []; var lay = []; for (i=0;i<layers.length;i++){ if (layers.spatialEdit == true){ templateLayers.push(layerList); lay.push({featureLayer: layerList}) } } templatePicker = new TemplatePicker({ featureLayers: templateLayers, grouping: true, rows: "auto", columns: 3, }, "templateDiv"); templatePicker.startup(); var settings = { map: map, templatePicker: templatePicker, layerInfos: lay, toolbarVisible: true, createOptions: { polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ], polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON, Editor.CREATE_TOOL_CIRCLE, Editor.CREATE_TOOL_TRIANGLE, Editor.CREATE_TOOL_RECTANGLE ] }, toolbarOptions: { reshapeVisible: true } }; var parameters = { settings: settings}; console.log(parameters); editor = new Editor(parameters, '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 }); editor.startup(); console.log(settings); } });
... View more
09-13-2017
07:37 AM
|
0
|
2
|
920
|
POST
|
The line adding the layer to the map looks to also be inside of the queryTask.on("complete"). queryTask.on("complete", function(event) {
console.log("query task complete");
map.graphics.clear();
var highlightSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 7,
// pink
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([254, 0, 239])));
var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 7,
// white
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 25])));
var features = event.featureSet.features;
countiesGraphicsLayer = new GraphicsLayer();
//QueryTask returns a featureSet.
//Loop through features in the featureSet and add them to the map.
var featureCount = features.length;
for(var i = 0; i < featureCount; i++) {
//Get the current feature from the featureSet.
var graphic = features[i]; //Feature is a graphic
graphic.setSymbol(symbol);
graphic.setInfoTemplate(infoTemplate);
countiesGraphicsLayer.add(graphic);
}
map.addLayer(countiesGraphicsLayer);
countiesGraphicsLayer.enableMouseEvents();
console.log(countiesGraphicsLayer);
//listen for when the mouse-over event fires on the countiesGraphicsLayer
//when fired, create a new graphic with the geometry from event.graphic
//and add it to the maps graphics layer
countiesGraphicsLayer.on("mouse-over", function(event) {
map.graphics.clear(); //use the maps graphics layer as the highlight layer
var graphic = event.graphic;
map.infoWindow.setContent(graphic.getContent());
map.infoWindow.setTitle(graphic.getTitle());
var highlightGraphic = new Graphic(graphic.geometry, highlightSymbol);
map.graphics.add(highlightGraphic);
map.infoWindow.show(event.screenPoint,
map.getInfoWindowAnchor(event.screenPoint));
});
//listen for when map.graphics mouse-out event is fired
//and then clear the highlight graphic
//and hide the info window
map.graphics.on("mouse-out", function() {
console.log("test");
map.graphics.clear();
map.infoWindow.hide();
});
}); And when I uncomment the line setting the spatial reference of the query to 102100 (the same as the map), then the graphic features inside of the graphics layer have this spatial reference, but the graphics layer itself still shows a spatial reference of 4326.
... View more
08-25-2017
08:01 AM
|
0
|
9
|
980
|
POST
|
I am noticing now that the spatial reference of the countiesGraphics layer is 4326 and the spatial reference of the map is 102100 - the highlight symbols appear in the right location but this could still be a problem? I cannot figure out how to change the spatial reference of the countiesGraphicsLayer though.
... View more
08-24-2017
09:31 PM
|
0
|
11
|
980
|
POST
|
There are no errors in the browser console, no. I'm not sure I understand when you say that the countiesGraphicsLayer is added as a null to the map before the query executes - how do I prevent this?
... View more
08-24-2017
08:29 PM
|
0
|
0
|
980
|
POST
|
I am using code almost exactly from the Feature Layer Hover sample and it works in the sandbox, but not when I integrate with the rest of my code. The query runs fine and adds graphics to the map, but the mouse over event does nothing. Would anyone have any ideas on things to troubleshoot? - I am calling the setUpQuery function from a separate file, after the map is constructed. It is in a series of other map.on("load") functions and moving around this call is having no effect. - I verified that mouseevents are being enabled by logging the countiesGraphics layer to the console. The property shows true. - I wasn't sure if there was a graphics layer masking the graphics layer I'm trying to access. Getting graphics layers IDs show that only the countiesGraphicsLayer and my one feature layer are present. Changing the order of these layers does nothing. - Instead of adding a new graphics layer, I tried adding the query results directly to the map.graphics layer and mousing over that layer instead. No mouseover event fires. var countiesGraphicsLayer; require([ "dojo/dom", "dojo/on", "esri/map", "esri/graphic", "esri/InfoTemplate", "esri/SpatialReference", "esri/geometry/Extent", "esri/layers/GraphicsLayer", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleMarkerSymbol", "esri/tasks/query", "esri/tasks/QueryTask", "esri/Color", "dojo/domReady!" ], function ( dom, on, Map, Graphic, InfoTemplate, SpatialReference, Extent, GraphicsLayer, SimpleFillSymbol, SimpleLineSymbol, SimpleMarkerSymbol,Query, QueryTask, Color ) { setUpQuery = function(){ var queryTask = new QueryTask(url); //build query filter var query = new Query(); query.returnGeometry = true; query.outFields = ["*"]; //query.outSpatialReference = { "wkid": 102100 }; query.where = "Status ='Active'"; var infoTemplate = new InfoTemplate(); var content = "test"; infoTemplate.setTitle("${Status}"); infoTemplate.setContent(content); map.infoWindow.resize(245, 125); //Can listen for complete event to process results //or can use the callback option in the queryTask.execute method. queryTask.on("complete", function (event) { console.log("query task complete"); map.graphics.clear(); var highlightSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 7, // pink new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([254, 0, 239]))); var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 7, // white new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 25]))); var features = event.featureSet.features; countiesGraphicsLayer = new GraphicsLayer(); //QueryTask returns a featureSet. //Loop through features in the featureSet and add them to the map. var featureCount = features.length; for (var i = 0; i < featureCount; i++) { //Get the current feature from the featureSet. var graphic = features; //Feature is a graphic graphic.setSymbol(symbol); graphic.setInfoTemplate(infoTemplate); countiesGraphicsLayer.add(graphic); } map.addLayer(countiesGraphicsLayer); countiesGraphicsLayer.enableMouseEvents(); console.log(countiesGraphicsLayer); //listen for when the mouse-over event fires on the countiesGraphicsLayer //when fired, create a new graphic with the geometry from event.graphic //and add it to the maps graphics layer countiesGraphicsLayer.on("mouse-over",function (event) { map.graphics.clear(); //use the maps graphics layer as the highlight layer var graphic = event.graphic; map.infoWindow.setContent(graphic.getContent()); map.infoWindow.setTitle(graphic.getTitle()); var highlightGraphic = new Graphic(graphic.geometry, highlightSymbol); map.graphics.add(highlightGraphic); map.infoWindow.show(event.screenPoint, map.getInfoWindowAnchor(event.screenPoint)); }); //listen for when map.graphics mouse-out event is fired //and then clear the highlight graphic //and hide the info window map.graphics.on("mouse-out", function () { console.log("test"); map.graphics.clear(); map.infoWindow.hide(); }); }); queryTask.execute(query); } });
... View more
08-24-2017
06:39 PM
|
0
|
14
|
2177
|
POST
|
Robert, Yes, the feature table dijit is correct. The css relevant to the table would be: .dgrid-content.ui-widget-content{ margin-top:70px; } .table-striped>tbody>tr:nth-child(odd)>td{ background-color: #bfbdb5; text-align:center; } .table-striped>tbody>tr:nth-child(even)>td{ background-color:white; text-align:center; } .dgrid-row-odd { background: light-gray !important; display:inline-block; } .dgrid-row-even { background: white !important; display:inline-block; } .panel-default > .panel-heading { background-color:#acc32b; color:white; } .panel-collapse-bottom{ position: absolute; bottom: 100%; height:500%; width:100%; border-radius:5px; background-color:white; } .row{ margin:0px; } .nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover{ background-color:#acc32b; color:white; font-weight:bold; border-radius: 5px; } a{ color:white; } .nav-tabs { border-bottom: none; } #tableHeader{ background-color:#00abea; } .accordian_row{ height:4%; width:100%; position: absolute; bottom:0; } #resultsTitle{ text-align:center; font-weight:bold; z-index:500; } .col-lg-12{ z-index:50; padding:0px; } .panel-content.table{ height:100%; background-color:gray; } #sitesTable .dgrid-header { background-color:#bfbdb5; position:fixed; z-index:200; } .dgrid-contents{ background-color:white; } #openTable{ width:100%; background-color:#acc32b; color:white; font-weight:bold; font-size:16px; height:70px; z-index:200; bottom:0; position:fixed; } #tableContainer{ display:none; background-color:white; z-index:250; height:30%; width:100%; bottom:6.75%; position:fixed; resize:vertical; } .dijitContentPane.esri-feature-table-content-pane.esri-feature-table-menu.dijitBorderContainerNoGutter-child.dijitBorderContainerNoGutter-dijitContentPane.dijitBorderContainerNoGutterPane.dijitAlignTop{ display:none; } #linkID{ display:none; } #downloadTable{ right:2%; bottom:1%; position:fixed; z-index:250; display:none; } #uploadTable{ right:5%; bottom:1%; position:fixed; z-index:250; display:none; } #clearSelection{ right:8%; bottom:1%; position:fixed; z-index:250; display:none; } The HTML: <div id="tableContainer"> <div id="tablePanel" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'"> <div id="sitesTable"></div> </div> </div> The table container/panel is toggled by a button click - it is hidden initially and then displays at half screen when the button is clicked, using display:none and display:block. The sitesTable is the div the table is actually registered to. When I apply the claro class to any of the HTML elements above, the table contents all disappear except for the header. The menu items then show up in the right place. When the claro class is removed, the table displays how I want it to, but the behavior with the menu I described above occurs. I'm open to any optimizations of this; the CSS has been thrown together over several months of tweaks and it's probably a bit of a mess now.
... View more
06-21-2017
05:43 PM
|
0
|
1
|
1074
|
POST
|
I am implementing a feature table and have done a lot of customization to the CSS to make it appear where I want it to. Most importantly, I am not using body claro at all. Everything appears fine except for the menu when I click on the column header. The sort ascending/sort descending options appear in the bottom left corner under the table instead of under/on top of the column header. Does anyone know what I can override to get it to appear where it should?
... View more
06-14-2017
08:33 PM
|
0
|
3
|
2111
|
POST
|
That was my problem - it was running and I wasn't doing anything with the results. Thank you!
... View more
06-13-2017
05:25 AM
|
0
|
0
|
516
|
Title | Kudos | Posted |
---|---|---|
2 | 05-01-2017 01:16 PM | |
2 | 03-26-2016 12:27 PM | |
1 | 07-25-2016 07:25 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|