Hot answers tagged

2

For the first question of renaming the layers, just add an "id" property when constructing the FeatureLayer: var resLyrLn = new FeatureLayer("https://data.farwestern.com/arcgis/rest/services/scratch/test_SD_RelatedResources/MapServer/0", { mode: FeatureLayer.MODE_ONDEMAND, visible: true, id: "My Layer"}); The second question about checkbox layer ...


2

you don't have graphics on map because : 1-the service returns feature without geometry attribute . and this is due to a typing error in your above code : Just rectify the line myQuery.returnGeomery = true; ( t letter missed ) to this myQuery.returnGeometry = true; 2- in the showResults function : inside the loop you didn't make instanciation of the ...


2

yes. definitely possible. check out this sample which demonstrates how to pull out url parameters and manipulate the map. https://developers.arcgis.com/javascript/3/jssamples/exp_history.html


1

When modern browsers behave dramatically differently it is usually worth validating your HTML using an online validator such as https://validator.w3.org/ since how they handle invalid html varies much more than how they handle valid html. In particular look for unclosed tags in the popups. If you can't get this to work I suggest posting the content of one of ...


1

in 4.x of our ArcGIS API for JavaScript, its as easy as checking FeatureLayer.renderer. in 3.x, besides looping through individual graphics, you can also find the renderer documented in the service metadata. esriRequest({ "url": serviceUrl, "content": { "f": "json" }, "callbackParamName": "callback" }). then(function (evt) { console....


1

If your FeatureLayer uses a SimpleRenderer, you may access its symbol with myFeatureLayer.renderer.symbol. If not, you have to check the symbol per Graphic. You can either ask its Renderer about the symbol with the getSymbol() method, or you can iterate over the array of graphics and get the symbol for each one: var symbols = [] myFeatureLayer.graphics....


1

I changed your example using a PictureMarkerSymbol and it works. The image and the html page are on the same webserver. Here's the code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"> <title>3D Graphics - 4.0</title> <...


1

@lele3p is correct. the best option here is to host the image on the same domain as the application. you can information about CORS and using a proxy as a failsafe in instances where it is either not possible to enable CORS on the web server hosting resources or in legacy browsers like IE9 and < here: https://developers.arcgis.com/javascript/3/jshelp/...


1

if you snoop the network traffic in this sample, you'll see that additional queries for the attributes of related records aren't made under an individual feature has been clicked. this is because only the attributes present in the feature service itself are available automatically for filtering. as an alternative, you could: query the table of related ...


1

Re-order the features when the Popup's on-set-features event fires. EDIT Here is a code snippet of how to do this: function bindInfoWindowSortingFunction(map) { require(['dojo/_base/connect'], function (connect) { connect.connect(map.infoWindow, "onSetFeatures", function () { var orderedFeatures = []; for(var i = ...


1

I was able to piece together some code that essentially just re-projects the coords via a geometry service. I'm assuming that this is somewhat a 'duh' answer to most, but just throwing it out there. That being said, I can get an extent but it doesn't seem to zoom in to the correct location. I'll create a separate post for this issue if I can't figure it ...


1

In your Feature( or map ) Service using arcmap ; connect to your arcgis server , locate the service and open service edit window, in the right menu locate the parameters and reset the value of Maximum number of record returned by the server it's set to 1000 by default , change it to 5000 . (greater the value is set, lower the performance of server will be )...


1

As mentioned , you have to set an ajax request to service-url?f=json and loop the Layers tab json response to access each layer name , id ... same thing to generate check boxes . required js => "esri/request", ajax req "dojo/dom-construct", creating dynamic checkbox "dojo/_base/array", looping json Layers array You can find a sample ...


1

try this for (var j = 0, k = map.layerIds.length; j < k; j++) { var currentLayer = map.getLayer(map.layerIds[j]); if (currentLayer.id == "yourLayerID") { map.removeLayer(currentLayer); }



Only top voted, non community-wiki answers of a minimum length are eligible