POST
|
Hi Harold, I was advised by a tech support analyst to use the project method from the geometry service class (https://developers.arcgis.com/javascript/jsapi/geometryservice-amd.html#project). This sucessfully allowed me to reproject my graphics in the desired spatial reference value. I was not aware that the objectIds query parameter was to blame for my issue though. It makes sense though; I've noticed this issue several times since and have just resorted to the projection tool when needed. Thanks for sharing
... View more
05-07-2014
06:24 AM
|
0
|
0
|
282
|
POST
|
yeah, I got it working. The easiest approach is to use a select widget as so:
var mySelect = new Select({
name:"mySelect",
options: [
{label: "Select option 1", value: "Select option 1"},
{label: "Select option 2", value: "Select option 2"},
{label: "Select option 3", value: "Select option 3"}
]
});
Then use the 'customField' property as is done in the esri sample, setting it equal to the variable name. A select is ideal if you don't have a massive list of options. The thing with comboboxes are that they are "store-enabled", so you can't follow the same options array format. If combobox is specifically what you are looking for (you have a json store, you want to loop through a list of field values, are basing the list of values on a query, or just really want the autocomplete feature that comes with combobox) I will need some time to get back to you as it is a little more involved and I'm trying to get an app done before the weekend 😉 *note on the autocomplete thing -- look into the dojo filtering select. You might be able to set it up in the same way as you would with the select... I just haven't worked with it myself yet
... View more
02-21-2014
10:25 AM
|
0
|
0
|
746
|
POST
|
@ jon.uihlein, it has been a while but your suggestion was what ended up working for me. I used the then() callback to close my infoWindow immediately after the applyEdits function executes. Thanks for your help
... View more
02-18-2014
05:25 AM
|
0
|
0
|
523
|
POST
|
It's very quick with several dozen graphics, but I've never used this selection method for more than that, so I can't say if it will be ok with several thousand. Maybe you could look into implementing graduated symbols for your graphics? https://developers.arcgis.com/javascript/jssamples/renderer_graduated_polygon.html
... View more
02-04-2014
04:12 AM
|
0
|
0
|
354
|
POST
|
Have you taken a look at this sample? It shows you how to initialize a drawing toolbar that's capable of selecting graphics within a user-defined extent (see the code's "findPointsinExtent" function) https://developers.arcgis.com/javascript/jssamples/graphics_extent_query.html
... View more
02-03-2014
05:01 PM
|
0
|
0
|
354
|
POST
|
I've gotten back to this after a little time away from it and have accomplished creating a multiselect widget as a field for the editor using the following:
var test = win.doc.createElement('select');
var testm = dom.byId(test);
var op1 = win.doc.createElement('option');
op1.innerHTML = "optionone";
op1.value = "optionone";
testm.appendChild(op1);
var op2 = win.doc.createElement('option');
op2.innerHTML = "optiontwo";
op2.value = "optiontwo";
testm.appendChild(op2);
var myMultiSelect = new MultiSelect({ name: 'testmulti', id: 'testmulti', style: "width:150px;"}, testm);
Because Dojo's multiselect widget is based off the native select element, you first have to create a select, then append option elements to it, and finally assign the select you created to the multiselect. After setting it up, 'myMultiSelect' is then assigned to the customField property when creating the editor fields. Now that it's created though I'm having trouble syncing my selections to my database. The trouble is that multiselects pass values as an array of strings, instead of a plain string. I'm pretty sure my database doesn't like this because the error code I get for my update response is 1016, which the esri docs equate to "setting of value failed". Is there something I can do client side to ensure the selections made in the multiselect widget are passed as a comma delimited string? On the ArcMap end of things, the field my values should be going into is a String field, and I don't see any other format types that would be suitable for arrays, so I figure a code-based solution is the best way to go
... View more
01-29-2014
07:06 AM
|
0
|
1
|
361
|
POST
|
I'm not sure why you're not seeing the log statement unless your code is failing before it gets to that point I think I see an issue with your for loop though. Use this instead:
for(var i=0, i1=resultFeatures.features.length; i<i1; i++);
The FeatureSet that's returned from a querytask is an object (https://developers.arcgis.com/javascript/jsapi/featureset.html), and the length property is for an array, so you want to be applying length to the array of returned features array
... View more
01-28-2014
11:09 AM
|
0
|
0
|
525
|
POST
|
Well because you say "on top" of the map, maybe the dojo Floating Panel could be what you need. https://developers.arcgis.com/javascript/jssamples/gp_clipasync.html Since the ArcGIS JavaScript API uses the Dojo toolkit, you can go to the Dojo website and browse their documentation for the different kinds of layout widgets you can use: http://dojotoolkit.org/reference-guide/1.9/dojox/layout/FloatingPane.html Tab container is another useful widget: http://dojotoolkit.org/reference-guide/1.9/dijit/layout/TabContainer.html
... View more
01-28-2014
10:31 AM
|
0
|
0
|
195
|
POST
|
When you use console.log(), that means that you are sending a log message to the console window. So if you are testing your app in the Firefox browser, for example, you should see your log statements in Firebug's console tab, given that you've chosen the Firebug debugger. So for "console.log("My query results:", resultFeatures);" you should see in your debugger console panel the text 'My query reults:' followed by the FeatureSet object that was returned from your query task. You could further drill down and use: console.log("My query results:", featureSet.features); //returns an array of your query result's features console.log("My query results:", featureSet.features.length); //returns the length of the feature array If your debugger does not indicate that any features are getting returned, you should probably check to make sure there is nothing wrong with your feature layer or the way you're writing your query. Try the same query you are using in your code in your REST endpoint for the layer (http://w7hp348/arcgis/rest/services/Testservice/FeatureServiceTest/MapServer/0). If you're not sure how to do this, navigate to that URL and at the bottom of the page there should be a link titled Query that leads you to a page where you can construct your query and see if it still fails
... View more
01-28-2014
09:46 AM
|
0
|
0
|
525
|
POST
|
Make sure that when you refer to dojo modules in your code that you use the same name as the one you chose in your require callback. In your code, you use "new simpleMarkerSymbol();" but it should reflect the parameter name you originally provided, which was "SimpleMarkerSymbol". Case sensitivity matters in this regard. Also, to ensure that your query is returning features, use a log statement in the showResults function. Just supply this console.log("My query results:", resultFeatures); at the beginning of the function and then check out your debugger console to see what returned from your query
... View more
01-27-2014
11:14 AM
|
0
|
0
|
525
|
POST
|
Are you sure that you want to go to the trouble of adding a google basemap? The ArcGIS JavaScript api has a nice basemap gallery widget that lets you switch between a street map, topo map, satellite, hybrid, etc., and it's a lot easier to implement. Here's a link to the sample if you're interested: https://developers.arcgis.com/en/javascript/jssamples/widget_basemap.html Otherwise, I would start by doing a ctrl+u to review the client side code for the demo that was linked out from the Google Maps mania article. There you'll see how they write the argument to the setMapTypeId method:
googleLayer.setMapTypeId(agsjs.layers.GoogleMapsLayer.MAP_TYPE_ROADMAP);
In the demo, each "layer" button's click event is handled by a function called changeMap that parses the text of the button's label, and based on that case switches out the basemap with the appropriate layer
... View more
01-20-2014
05:06 PM
|
0
|
0
|
2277
|
POST
|
I don't think there's a property in the popup template for adding URLS. There's another class though called infoTemplate that gives you the ability to modify the inner html of the popup (https://developers.arcgis.com/en/javascript/jsapi/infotemplate.html). Here's an example:
var infoTemplate = new InfoTemplate();
infoTemplate.setTitle("My Info Window");
infoTemplate.setContent( "<b>Field One:</b>${FIELD_ONE}<br/>"
+ "<b>Field Two: </b>${FIELD TWO}<br/><br/>"
+ "<b>Field Three: </b>${FIELD_THREE}<br/>"
+ "<b>Field Four:</b><a id= 'myClick' style='cursor:pointer;' href='https://developers.arcgis.com/en/javascript/'>ArcGIS JavaScript Docs</a>"
);
If you have a function that is generating the URLS you could set the anchor element's onclick event to that function
... View more
01-20-2014
04:35 PM
|
0
|
0
|
397
|
POST
|
I tried to handle the error and no warnings were issued in Firebug, but thank you for the good suggestion
... View more
01-14-2014
06:10 AM
|
0
|
0
|
523
|
POST
|
I added a 'save' button to my attribute inspector, and upon clicking it I'd like for the feature layer to update and then close the info window (a similar effect to when you hit the attribute inspector's 'delete' button). I followed the documentation (https://developers.arcgis.com/en/javascript/jsapi/featurelayer.html#applyedits)and came up with the following statement: updateFeature.getLayer().applyEdits(null, [updateFeature], null, function(){ map.infoWindow.hide(); }); The update is fine but the callback does not occur. The syntax looks correct to me, I don't see the need to supply any arguments to the callback, so I don't know what the problem could be
... View more
01-14-2014
05:39 AM
|
0
|
4
|
3108
|
POST
|
For those who may be dojo savvy: I am trying to build a multiselect widget to place in an attribute inspector and it is not populating with my options. It just stays blank. Does anyone familiar with the widget see anything wrong with the way I set it up? [HTML] var testm = dojo.byId('testmulti'); var op1 = dojo.doc.createElement('option'); op1.innerHTML = "option1"; op1.value = "option1"; testm.appendChild(op1); var op2 = dojo.doc.createElement('option'); op1.innerHTML = "option2"; op1.value = "option2"; testm.appendChild(op2); var myMultiSelect = new dijit.form.MultiSelect({ name: 'testmulti', id: 'testmulti', style: "width:150px;"}, testm); var layers = dojo.map(results, function(result) { return { featureLayer:result.layer, showAttachments:true, showDeleteButton:true, fieldInfos:[ {fieldName: "TEST", visible: true,'label':"test 1", 'customField': myMultiSelect}, {fieldName: "TEST2", visible: true, 'label':"test 2"} ] }; }); [/HTML]
... View more
12-10-2013
07:34 AM
|
0
|
3
|
4681
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|