|
POST
|
Hi, I used the dojo Drag and Drop package in the LayerListView.js file. This code is probably 2 year old Below are some code snippets. Hope it helps. This is done for js 3
_setUpDnD: function () {
this.dndList = new Source(this.layerListTable, {
skipForm: true,
withHandles: true,
singular:true,
creator: dojo.hitch(this, this.createItem)
});
dojo.connect(this.dndList, "onDropInternal", this, "onDrop");
this.dndContainer = new Container(this.layerListTable);
},
onDrop: function (nodes) {
var layertrArr = dojo.query('.jimu-widget-wslayerList .dojoDndHandle')
//VT: we need to loop through everything to ensure the structure integrity in the <table>.
array.forEach(layertrArr,lang.hitch(this,function(layertr){
let layertrNodeId=dojo.attr(layertr,'layertrnodeid');
let nextSiblingNodeId = layertr.nextSibling?dojo.attr(layertr.nextSibling,'layercontenttrnodeid'):'';
if(!nextSiblingNodeId || nextSiblingNodeId!==layertrNodeId){
let node = dojo.query('[layercontenttrnodeid="'+ layertrNodeId +'"]')
this.layerListTable.insertBefore(node[0], layertr.nextSibling);
}
}))
this.emit('dnd-drop', nodes);
var previousNode=null;
var allNodes = this.dndList.getAllNodes();
for(var i = 0; i < allNodes.length; i ++){
if(allNodes.id===nodes[0].id){
break
}else{
previousNode = allNodes;
}
}
var layerInfo = this.dndList.getItem(nodes[0].id).data;
var steps = this._getMovedStepsAfterDnD(layerInfo , previousNode?this.dndList.getItem(previousNode.id).data:null);
if(steps.movedown){
this.moveDownLayer(layerInfo,steps.steps)
}else{
this.moveUpLayer(layerInfo,steps.steps)
}
console.log(steps);
},
... View more
09-10-2019
07:57 PM
|
0
|
0
|
2260
|
|
POST
|
Please mark the answer as correct so that it will help others in the future as well Thanks
... View more
09-09-2019
09:50 PM
|
0
|
0
|
294
|
|
POST
|
Hi i do not know what is a CMV template however you can create a popup action in the template Popup actions | ArcGIS API for JavaScript 4.12 then using the action, change the opacity. Perhaps you can build this as a openAtStart widget which will loop through all your layers and add this action to the popup template. ArcGIS API for JavaScript Sandbox
... View more
09-09-2019
09:48 PM
|
0
|
0
|
641
|
|
POST
|
Hi, you can use the popup widget. Popup | ArcGIS API for JavaScript 4.12 With the popup widget, you can set the content dynamically with html. Then use a action on the popup to call the function. Hope that helps
... View more
09-09-2019
09:26 PM
|
0
|
1
|
854
|
|
POST
|
Thanks Jarkko Kuoppamäki and my apologies Justin Bridwell for not reading the message clearly. This reply is probably very late in the game now. When the request is first fired off, its makes a preflight check of type OPTION. You can match the response headers against your requests header to understand why you are getting CORS. It might be due to content type mismatch. Or referral type mismatch. if you take a screenshot I am happy to assist
... View more
09-08-2019
07:41 PM
|
0
|
0
|
6234
|
|
POST
|
Using the developer tool to debug, can you see the point results returned? Can you see the point element rendered in the html content? (e.g rendered but width/height 0 or display:hidden etc)
... View more
09-08-2019
07:24 PM
|
0
|
0
|
543
|
|
POST
|
Can you confirm if there are any message in the ArcGIS Server/Portal logs?
... View more
09-08-2019
07:20 PM
|
0
|
2
|
1000
|
|
POST
|
Hi, I look forward to anyone that can provide an answer to this question. The 2 way interaction between the users and ipython notebook is somewhat limited. The output of each snippet serves more as a "demo" to the current run step in your code. if you would like to interact with the map, the web app builder may be the more appropriate solution. There is a "measure widget" that comes right out of the box and it takes just a few clicks in a few minutes to get up and running assuming you are running portal or arcgis online.
... View more
09-08-2019
07:14 PM
|
0
|
0
|
489
|
|
POST
|
Hi, I do not have the code handy however you will need to use the rest add-feature endpoint I imagine it will be something like the following. Note code below are untested You can also open your developer tool in chrome and hit the addfeature endpoint, set f=json to see exactly how you should be parsing the request and replicate that in esriRequest. https://developers.arcgis.com/rest/services-reference/add-features.htm var data = [ { "geometry" : {"x" : -118.15, "y" : 33.80}, "attributes" : { "OWNER" : "Joe Smith", "VALUE" : 94820.37, "APPROVED" : true, "LASTUPDATE" : 1227663551096 } }, { "geometry" : { "x" : -118.37, "y" : 34.086 }, "attributes" : { "OWNER" : "John Doe", "VALUE" : 17325.90, "APPROVED" : false, "LASTUPDATE" : 1227628579430 } } ] var url = "https://abc/ArcGIS/rest/services/xxx//FeatureServer/0/addFeature " esriRequest(, { responseType: "json", method:"post", body:JSON.stringify(data) }).then(function(response){ });
... View more
07-30-2019
08:01 PM
|
1
|
0
|
792
|
|
POST
|
Hi, there is a really good article about how cors works. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS In short, your endpoint need to have CORS enable by adding Access-Control-Allow-Origin in your response header in IIS. Value of * will allow all. https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module Alternatively, you can go through Esri resource proxy https://github.com/Esri/resource-proxy Hope that helps
... View more
07-30-2019
07:38 PM
|
0
|
4
|
6234
|
|
POST
|
Are you referring to the theming? As far as I know, custom theme are not supported currently on WAB in portal. Only custom widgets are supported. You can add theme to the folder in the server however that is not encouraged and supported by Esri.
... View more
07-20-2019
09:37 PM
|
0
|
0
|
674
|
|
POST
|
You will have to manually loop through the features and apply the edits to your feature layer https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits
... View more
07-20-2019
09:33 PM
|
0
|
0
|
658
|
|
POST
|
Hi Karsten, I have not had the opportunity to look at the DOM in depth but you can basically use dojo query(similar to jquery) to retrieve any DOM by css or by ID. Look for a unique attribute in the DOM and modify the content. Hope that helps
... View more
07-02-2019
06:04 PM
|
0
|
0
|
343
|
|
POST
|
Hi, Are you referring to a feature action? https://developers.arcgis.com/web-appbuilder/sample-code/create-a-feature-action-in-your-widget.htm The action can link to a form for the user to customize the stop name. Alternative https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=popup-actions and you can put forms in the content var template = { // autocasts as new PopupTemplate() title: "Trail run", content: "{name} <input type='text' name='firstname' value='whatever'>", actions: [measureThisAction] };
... View more
06-24-2019
10:41 PM
|
0
|
0
|
840
|
|
POST
|
Hi, what do you mean by webmap have changed? as in change in layers or change of basemap? The ArGIS javascript API are largely event driven: https://developers.arcgis.com/javascript/3/jshelp/inside_events.html Hope that helps
... View more
06-24-2019
10:35 PM
|
0
|
0
|
904
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-23-2021 06:05 AM | |
| 1 | 04-24-2020 01:46 AM | |
| 1 | 03-29-2022 06:53 PM | |
| 1 | 07-22-2021 07:59 PM | |
| 1 | 03-30-2022 04:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-30-2022
06:13 PM
|