|
POST
|
Greetings, I am working with the chart samples, Popup | ArcGIS API for JavaScript , and cannot for the life of me resize the chart. I can get the window to resize with the good ol' popup.resize(900,900);, but the chart content inside remains the same. Any help would be very much appreciated.
... View more
10-13-2014
08:00 AM
|
0
|
2
|
1666
|
|
POST
|
I don't think you can edit a Joined table. You can join and view a Map Service, but a feature layer won't display a joined table. You will likely have to relate the tables instead so that you can edit them.
... View more
09-18-2014
12:59 PM
|
1
|
0
|
766
|
|
POST
|
Owen, I ran into a couple other issues with the apply edits passing. Not sure how but only select layers are passing(usually the first one listed), or if multiple points are selected at a time. I think it is the loading of layers into initSelectToolbar array. The rest of the code is just like the sample, but I think these are the trouble areas. It throws a TypeError: updateFeature is undefined upon trying to apply edits with the save button. Could you take another look to see how I am failing at life? Thanks in advance. function initSelectToolbar(evt) { var asdf = evt.layers[0].layer; var selectQuery = new Query(); map.on("click", function(evt) { var selectionQuery = new esri.tasks.Query(); var tol = map.extent.getWidth()/map.width * 5; var x = evt.mapPoint.x; var y = evt.mapPoint.y; var queryExtent = new esri.geometry.Extent(x-tol,y-tol,x+tol,y+tol,evt.mapPoint.spatialReference); selectionQuery.geometry = queryExtent; asdf.selectFeatures(selectionQuery, FeatureLayer.SELECTION_NEW, function(features) { //store the current feature updateFeature = features[0]; console.log("adf"); map.infoWindow.setTitle(features[0].getLayer().name); console.log("adf"); map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint)); console.log("adf"); var layerInfos = [{ 'featureLayer': petroFieldsFL, 'showAttachments': false, 'isEditable': true }, { 'featureLayer': petroFieldsFL1, 'showAttachments': false, 'isEditable': true}]; var attInspector = new AttributeInspector({ layerInfos:layerInfos }, domConstruct.create("div")); //add a save button next to the delete button var saveButton = new Button({ label: "Save", "class": "saveButton"}); domConstruct.place(saveButton.domNode, attInspector.deleteBtn.domNode, "after"); saveButton.on("click", function(){ updateFeature.getLayer().applyEdits(null, [updateFeature], null); }); attInspector.on("attribute-change", function(evt) { //store the updates to apply when the save button is clicked updateFeature.attributes[evt.fieldName] = evt.fieldValue; }); attInspector.on("next", function(evt) { updateFeature = evt.feature; console.log("Next " + updateFeature.attributes.objectid); }); attInspector.on("delete", function(evt){ evt.feature.getLayer().applyEdits(null,null,[feature]); map.infoWindow.hide(); }); map.infoWindow.setContent(attInspector.domNode); map.infoWindow.resize(350, 240); }
... View more
09-15-2014
02:51 PM
|
0
|
0
|
1227
|
|
POST
|
Hab, Dumb question, did you include "esri/geometry/Extent" ?
... View more
09-04-2014
09:52 AM
|
0
|
0
|
5460
|
|
POST
|
Perhaps these examples by @John Grayson might help. https://community.esri.com/message/396665?sr=search&searchId=efc06485-6510-4e98-8882-6df0f2d12a22&searchIndex=0#396665
... View more
08-28-2014
08:09 AM
|
0
|
0
|
767
|
|
POST
|
Brady, I can't recall if this is the exact one that was working for me but it is the jest of it. When the infoTemplate s called it references getTextContent that populates the window from the related table query. <script src="http://js.arcgis.com/3.8/"></script> <script> require([ "esri/map", "esri/dijit/Popup", "esri/dijit/PopupTemplate", "esri/layers/FeatureLayer", "esri/symbols/SimpleMarkerSymbol", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/query", "esri/tasks/QueryTask", "esri/tasks/FindParameters","esri/tasks/FindTask", "dojo/dom-class", "dojo/dom-construct", "dijit/layout/ContentPane", "dojo/on", "dojox/charting/Chart", "dojox/charting/themes/Dollar", "dojo/domReady!" ], function( Map, Popup, PopupTemplate, FeatureLayer, SimpleMarkerSymbol, Dynamic, Query,QueryTask, FindParameters,FindTask, domClass, domConstruct, ContentPane, on, Chart, theme ){ //The popup is the default info window so you only need to create the popup and //assign it to the map if you want to change default properties. Here we are //noting that the specified title content should display in the header bar var popup = Popup({ titleInBody: false },domConstruct.create("div")); var map = new Map("map", { basemap: "satellite", center: [-88.595, 38.937], zoom: 11, infoWindow: popup }); //define the popup content using a popup template //a custom chart theme (dollar) is specified. Note that you'll have to load //then theme first var template = new esri.InfoTemplate(); template.setTitle("Billing"); //template.setContent("hello"); template.setContent(getTextContent); var imageParams = new esri.layers.ImageParameters(); imageParams.layerIds = [0,1,2,3,4,5,6,7,8,9]; imageParams.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW; var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("Map service layer", {imageParameters:imageParams}); map.addLayer(dynamicMapServiceLayer); var selectionSymbol = new esri.symbol.SimpleMarkerSymbol().setColor("red"); wellFeatureLayer = new esri.layers.FeatureLayer("feature layer", { mode: esri.layers.FeatureLayer.MODE_SELECTION, //infoTemplate: new esri.InfoTemplate("Well Well: ${OBJECTID_1}","${OBJECTID_1}") infoTemplate: template }); map.addLayers([dynamicMapServiceLayer]); dojo.connect(wellFeatureLayer, "onSelectionComplete", findRelatedRecords); map.addLayer(wellFeatureLayer); dojo.connect(map, "onClick", findWells); dojo.addClass(map.infoWindow.domNode, "myTheme"); function getTextContent(graphic){ return "<b>" + "OBJECTID: " + items[0].ESRI_OID + "</b><br/>" + "First Name: " + items[0].CUSTNAME + "</b><br/>" + "Address: " + items[0].ADDR1; } function findRelatedRecords(features) { var relatedTopsQuery = new esri.tasks.RelationshipQuery(); relatedTopsQuery.outFields = ["*"]; //relatedTopsQuery.relationshipId = 3; relatedTopsQuery.relationshipId = 0; //relatedTopsQuery.objectIds = [features[0].attributes.OBJECTID]; relatedTopsQuery.objectIds = [features[0].attributes.OBJECTID]; wellFeatureLayer.queryRelatedFeatures(relatedTopsQuery, function(relatedRecords) { console.log("related recs: ", relatedRecords); if ( ! relatedRecords.hasOwnProperty(features[0].attributes.OBJECTID) ) { console.log("No related records for ObjectID_1: ", features[0].attributes.OBJECTID_1); return; } var fset = relatedRecords[features[0].attributes.OBJECTID]; //var fset = relatedRecords[features[0].attributes.OBJECTID]; items = dojo.map(fset.features, function(feature) { return feature.attributes; }); var data = { identifier: "OBJECTID", //This field needs to have unique values label: "OBJECTID", //Name field for display. Not pertinent to a grid but may be used elsewhere. items: items }; }); } function findWells(evt) { var selectionQuery = new esri.tasks.Query(); var tol = map.extent.getWidth()/map.width * 5; var x = evt.mapPoint.x; var y = evt.mapPoint.y; var queryExtent = new esri.geometry.Extent(x-tol,y-tol,x+tol,y+tol,evt.mapPoint.spatialReference); selectionQuery.geometry = queryExtent; wellFeatureLayer.selectFeatures(selectionQuery,esri.layers.FeatureLayer.SELECTION_NEW); }; Good luck!
... View more
08-28-2014
04:55 AM
|
0
|
0
|
3633
|
|
POST
|
I'm looking at a related table in AGOL right now. So I guess it might work... You can't edit the table or the feature in a map service(obviously), but you can only edit the feature, without being able to see the table in a feature service... So it's not perfect.
... View more
08-22-2014
11:12 AM
|
0
|
0
|
5329
|
|
POST
|
Just as I feared. Had a talk with my boss and we are going to have to settle with read only. Not that big of a problem, it's just not best case scenario. Thanks for the heads up.
... View more
08-21-2014
08:43 AM
|
0
|
0
|
1036
|
|
POST
|
Greetings, I am hoping to be able to edit an external table through a relate in a javascript application. The relate works fine through a map service, but I can't publish a feature service. When attempting to publish a feature service I get the following errors: 00135 Standalone table's data source is not supported(Feature Service) 00062 Data frame contains data that does not use the sane connection to an enterprise geodatabase(Feature Service) Is there a work around that will allow me to edit these tables in their current format?(The tables are part of a billing software and I can't let it change formats) thanks
... View more
08-21-2014
06:25 AM
|
0
|
2
|
1697
|
|
POST
|
Good stuff, John. You got me out of a hell of a pickle. Appreciate all the help.
... View more
08-16-2014
10:08 AM
|
0
|
0
|
1118
|
|
POST
|
Ok, yeah that was pretty bad. Not sure what went on there, but I assure you I haven't been drinking. I've loaded the layers in like in your samples, but the non related layer is still not popping up. I fixed the Fiddle Edit fiddle - JSFiddle , and it is returning the related table info but not the non related feature.(I realize that is just a Map Service, but it should still return a value. right?) I think this is due to the all the selections running through the onSourceLayerClick(evt), not finding a value and turning up "No Related Items". I appreciate all your help, John, do you think you could take one more look at it???
... View more
08-15-2014
12:32 PM
|
0
|
2
|
1118
|
|
POST
|
John, I've got a pretty good understanding of your sample, but I'm running into some issues with applying it to my app. The issue is getting it to work with an existing attribute inspector with no related tables. I've tried adding the layerInfos in to the relatedTable.on("load", lang.hitch(this, function () ... No avail. I've tried using separate attribute inspectors.. no luck. each would work pending there was a map.infoWindow.setContent(attInspector1.domNode);, but not together. Any advice? I have a fiddle here Edit fiddle - JSFiddle set up to use two attribute inspectors, and it also has the combined layerInfo as well. Would you mind taking a look to see where I'm dropping the ball.
... View more
08-15-2014
08:19 AM
|
0
|
4
|
3442
|
|
POST
|
Kyle, here is what I got going as of nowbut it still won't populate the field.
function initSelectToolbar(evt) {
var asdf = evt.layers[0].layer;
var selectQuery = new Query();
map.on("click", function(evt) {
var selectionQuery = new esri.tasks.Query();
var tol = map.extent.getWidth()/map.width * 15;
var x = evt.mapPoint.x;
var y = evt.mapPoint.y;
var queryExtent = new esri.geometry.Extent(x-tol,y-tol,x+tol,y+tol,evt.mapPoint.spatialReference);
selectionQuery.geometry = queryExtent;
asdf.selectFeatures(selectionQuery, FeatureLayer.SELECTION_NEW, function(features) {
//store the current feature
updateFeature = features[0]; console.log("adf");
map.infoWindow.setTitle(features[0].getLayer().name); console.log("adf");
map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint)); console.log("adf");
activityRecord = new esri.layers.FeatureLayer("/Relate1/FeatureServer/1", {
infoTemplate: recordTemplate,
outFields: ["*"],
id: "activityRecord"
});
console.log("asdf1");
query2 = new esri.tasks.Query("Relate1/FeatureServer/1");
// related table field point feature selected field
query2.where = "serv_id = '" + selectedFeatures[0].attributes.Service_ID + "'";
query2.outFields = ["*"];
activityRecord.selectFeatures(query2, esri.layers.FeatureLayer.SELECTION_NEW);
console.log("asdf2");
layerInfoss = [{ 'featureLayer': activityRecord,
'showAttachments': true,
'isEditable': true
}];
console.log("asdf3");
attInspector = new esri.dijit.AttributeInspector(
{ layerInfos: layerInfoss
}, domConstruct.create("div1"));
console.log("asdf4");
recordTemplate = new esri.dijit.PopupTemplate({
title: "{PROPERTY_ID}",
fieldInfos: [
{ fieldName: "serv_id", visible: true, label: "Record:" }
],showAttachments: true
});
I have tried all sorts of combinations, so I'm not sure where exactly i'm screwing this up.
... View more
08-14-2014
09:49 AM
|
0
|
1
|
3442
|
|
POST
|
John, that fiddle worked out pretty good. I've never used lang.hitch, so I guess I have some documentation to go through. Thanks again.
... View more
08-14-2014
05:48 AM
|
0
|
6
|
3442
|
|
POST
|
Appreciate the help guys! Kyle, I actually found your work around after I posted this yesterday. I understand the logic but I'm drawing a blank on how the query should go. I'd really like to see this work for a better understanding of query abilities. query2 = new esri.tasks.Query(); query2.where = "serviceID = '" + selectedFeatures?? + "'"; query2.outFields = ["*"]; activityRecord.selectFeatures(query2, esri.layers.FeatureLayer.SELECTION_NEW);
... View more
08-14-2014
05:40 AM
|
0
|
3
|
3442
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-25-2015 09:25 AM | |
| 1 | 08-26-2015 05:13 AM | |
| 1 | 08-27-2015 08:59 AM | |
| 1 | 04-13-2015 12:06 PM | |
| 1 | 02-03-2015 07:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-05-2023
04:48 PM
|