POST
|
The problem had been on the outFields on feature layer, the objectId was passed correctly, but don't fetch any result before because of that. var flayer = new FeatureLayer({
url: <url>,
outFields: ["*"]
}); Thank you so much! So lame ahah
... View more
06-02-2017
08:05 AM
|
0
|
0
|
618
|
POST
|
I tried to use this sample (Edit Features | ArcGIS API for JavaScript 4.3) but with some changes. Instead of use a portalItem I want to use a featureLayer. I already changed to my feature layer url and add the class to the require and to the function, they worked good. My problem is when I click on a feature, instead of appear in the input boxes the attributes that are in the feature layer, appear the word "undefined" like in the picture below: I can select and add new points successfully, that's why I think that isn't normal I can't fetch the attributes to my input boxes. This is the code when I select a feature: function selectFeature(objectId) {
//quadrado
// symbol for the selected feature on the view
var selectionSymbol = SimpleMarkerSymbol({
color: [0, 0, 0, 0],
style: "square",
size: '35px',
outline: {
color: [255, 96, 0, 0.66],
width: 2
}
});
var query = featureLayer.createQuery();
query.where = featureLayer.objectIdField + " = " + objectId;
featureLayer.queryFeatures(query).then(function(results) {
if (results.features.length > 0) {
editFeature = results.features[0];
editFeature.symbol = selectionSymbol;
view.graphics.add(editFeature);
}
});
} And this is the code when I fetch the attribute results to the input boxes: view.on("click", function(evt) {
unselectFeature();
view.hitTest(evt.screenPoint).then(function(response) {
if (response.results.length > 0 && response.results[0].graphic) {
var feature = response.results[0].graphic;
selectFeature(feature.attributes[featureLayer.objectIdField]);
inputDescription.value = feature.attributes["equipament"];
inputUserInfo.value = feature.attributes["num_i_s"];
form1.value = feature.attributes["lado"];
form2.value = feature.attributes["sustent"];
form3.value = feature.attributes["braco"];
form4.value = feature.attributes["botoneira"];
form5.value = feature.attributes["av_acustic"];
attributeEditing.style.display = "block";
updateInstructionDiv.style.display = "none";
}
});
}); I already search a lot about this topic but I don't find anything that helps me. Anyone? Thank you, André Ribeiro
... View more
06-02-2017
02:51 AM
|
1
|
3
|
2100
|
POST
|
When I migrated from 3.20 to 4.30 version I had some troubles with the popupTemplate. Sometimes the popup show coded values instead of field description and vice-versa. This is my code: var template = { title: "Condicionamento pedido por: <b>{requerente}</b>",
content:
"<ul><li>Toponímia: {topo}</li>" +
"<li>Nud: {nud}</li>" +
"<li>Tipo: {tipo}</li>" +
"<li>Data inicial: {data_de_inicio:DateFormat(selector: 'date', fullYear: true)}</li>" +
"<li>Data final: {data_de_fim:DateFormat(selector: 'date', fullYear: true)}</li>" +
"<li>Motivo: {motivo}</li>" +
"<li>Troço: {troco}</li>" +
"<li>Planta de localização: {planta_de_localizacao}</li>" +
"<li>Observações: {observacoes}</li>" +
"<li>Urgente: {urgente}</li>" +
"<li>Identificador: {id}</li>" +
"<li>Lugares ZEDL: {zedl}</li>" +
"<li>Numero de lugares ZEDL condicionados: {nlugzedlcond}</li>" +
"<li>Data da colocação da sinalização: {dcolosin}</li>" +
"<li>Grupo de sinalização responsável: {groupsin}</li>" +
"<li>Data de retirada da sinalização: {dretsin}</li>" +
"<li>Sinalização implementada: {sinimple}</li></ul>",
fieldInfos: [{
fieldName: "requerente",
format: {
isEditable: true
}
},
{
fieldName: "tipo",
format: {
isEditable: true
}
}]
}; This is the popup with coded values: Anyone knows how to display always the field description? Thank you!
... View more
04-10-2017
02:52 AM
|
0
|
0
|
820
|
POST
|
I have a feature table like this example (ArcGIS API for JavaScript Sandbox). What I did is a filter to the table with differents queries like date or strings, and they are working good! If I search for a date interval the feature table refresh and show only the records that is between that dates. What I want now is that the records on map refresh too, but I can't do that... Someone can help me please? Example: I filter the table Only one record with this query But the map contains all records yet and didn't refresh Code: HTML <input id="nud" type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, intermediateChanges:true" class="dijit-form-TextBox filterTb" /> <button type="button" id="confirm">Filtrar</button> Javascript var confirmar = dom.byId("confirm"); on(confirmar, "click", function(value){ var userVal = dijit.byId("nud").get('value'); var oidFld = myFeatureLayer.objectIdField; var query = new Query(); lastWhere = query.where = "nud LIKE '%" + userVal + "%'"; myFeatureLayer.queryIds(query, lang.hitch(this, function(objectIds) { myFeatureTable.selectedRowIds = objectIds; myFeatureTable._showSelectedRecords(); })); });
... View more
02-27-2017
04:34 AM
|
0
|
3
|
1886
|
POST
|
I already did it, thank you so much! Now I'm struggling with one thing more. I query the feature table records, but I want to query the records on map too, on feature layer, how can I achieve that?
... View more
02-27-2017
02:32 AM
|
0
|
1
|
415
|
POST
|
Thank you for your time Tom! I already did that query, but I'm having the same issue before. I have an error on console: "Unable to complete operation". Maybe query date fields are different of query another type fields like text? Here's my code: HTML <input id="data1" type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, intermediateChanges:true" class="dijit-form-TextBox filterTb" style="width: 100px;"/>
<input id="data2" type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, intermediateChanges:true" class="dijit-form-TextBox filterTb" style="width: 100px;"/>
<button type="button" id="confirm4">Filtrar</button> Javascript var confirmar4 = dom.byId("confirm4");
on(confirmar4, "click", function(value){
var userVal4 = dijit.byId("data1").get('value');
var userVal5 = dijit.byId("data2").get('value');
var oidFld = myFeatureLayer.objectIdField;
var query = new Query();
query.where = "data_de_inicio between '" + userVal4 + " 00:00' and '" + userVal5 + " 23:59'";
myFeatureLayer.queryIds(query, lang.hitch(this, function(objectIds) {
myFeatureTable.selectedRowIds = objectIds;
myFeatureTable._showSelectedRecords();
}));
}); Thank you, André
... View more
02-27-2017
01:53 AM
|
0
|
2
|
415
|
POST
|
I'm having some issues querying the feature table in ArcGis JavaScript API. I already had developed query by string and coded values with success but the date fields not, unfortenely. Can someone help me with this issue? This is my code to query by a string field "nud": HTML <input id="stringTextBox" type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, intermediateChanges:true" class="dijit-form-TextBox filterTb" <button type="button" id="confirm">Filtrar</button> JAVASCRIPT var confirmar = dom.byId("confirm"); on(confirmar, "click", function(value){ var userVal = dijit.byId("stringTextBox").get('value'); var oidFld = myFeatureLayer.objectIdField; var query = new Query(); lastWhere = query.where = "nud LIKE '%" + userVal + "%'"; myFeatureLayer.queryIds(query, lang.hitch(this, function(objectIds) { myFeatureTable.selectedRowIds = objectIds; myFeatureTable._showSelectedRecords(); })); });
... View more
02-24-2017
08:16 AM
|
0
|
4
|
1162
|
Title | Kudos | Posted |
---|---|---|
1 | 06-02-2017 02:51 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|