Tag Info

Hot answers tagged

2

For your first issue: it appears that the template file for your widget is missing, inaccessible or corrupt. Based on the code posted in the linked example, the template file is './Select/templates/Select.html'. Check that file to ensure it is valid. For your second issue: to do a simple average, you would take the sum calculated in the example code ...


2

@Michael Miles-Stimson was on track w/ his first comment. since your ArcGIS Tiled Map Service defines its own projection using WKT (as opposed to WKID), you need to use an identical projection definition in your code to indicate to the JSAPI that the point you are passing is in the same coordinate system as the map. check out a working jsbin here another ...


2

In the map constructor options, set autoResize to false, eg: var map = new Map("map", { basemap: "topo", center: [-122.45, 37.75], // longitude, latitude zoom: 13, autoResize: false }); https://developers.arcgis.com/javascript/jsapi/map-amd.html#autoresize


2

Convert the featureLayers renderer to JSON. Then use the JSON to create a new renderer. var featureLayerRenderer = featureLayer.renderer.toJson(); var renderer = esri.renderer.fromJson(featureLayerRenderer);


2

Change popup.on("selection-change", function(){ to popup.on("set-features", function(){


2

definitely a scope problem. check out this sample which includes an example of wiring up a Dijit event listener within a require callback in JS instead of declarative HTML. registry.byId("numLocations").on("change", function() { params.defaultTargetFacilityCount = this.value; clearGraphics(); });


2

Set the geometry for the graphic using the setGeometry method. Also set the symbol on the graphic OR you may change the renderer (using marker symbols) on the featureLayer when the featureLayer loads. var pointSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10, new ...


2

I think what you're trying to do would use a combo of the Draw tool and the FeatureLayer applyEdits method. This sample kind of gets you started, but the workflow is use Draw tool, on draw-end event, add drawn graphic using applyEdits method of FeatureLayer. I don't have a solid example on hand, but here is a simple-edit-widget and sample code from my book. ...


1

You will want to require the Units module "esri/units" and pass the units to the circle this way var circle = new Circle({ center: e.mapPoint, geodesic: domAttr.get(geodesic, "checked"), radius: 100, radiusUnit:units.MILES }); More info on units here


1

As you said, Esri is just one of many OAuth providers so you'll have to 'roll our own code' in any situation that the individual vendor's samples don't demonstrate exactly what you need to achieve. With regard to whether or not youre missing something basic, i can't really tell from your question. Any authentication you trigger with third party OAuth ...


1

4686 works for FeatureLayers. Don't add GraphicsLayer just by itself. You must add a base layer. Try this example to test a map with just a FeatureLayer, using the map extent in the question http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=fl_no_basemap Change the value of bounds like this var bounds = new esri.geometry.Extent(-82.00, ...


1

This is not directly available through the API. The PrintTask can be used to get the Web_Map_as_JSON. map.on("load", function(){ require(["esri/tasks/PrintTask", "dojo/_base/json"], function(PrintTask, JSON){ var printTask = new PrintTask(); var Web_Map_as_JSON = JSON.toJson(printTask._getPrintDefinition(map)); }); });


1

Your problem here isn't with the dojo/ArcGIS, it's with SVG in IE in quirks mode. IE does not have SVG support below version 9 and by putting IE9 in quirks mode you're telling it to act like an older browser. Whether it is possible to use dojo/ArcGIS in IE9 quirks mode in general mostly depends on what you're doing ESRI does not fully support IE below ...


1

you don't need a programmatic hook into selecting a template immediately. just wire up logic to invoke the appropriate draw tool and pass edits to your hardcoded featureLayer of interest on draw-end immediately upon map load. afterward, you can still listen for selection-change on TemplatePicker and direct the edits somewhere else.


1

onChange: function (value) { var min = value[0]; var max = value[1]; var expression = "POP_Total_Class >= " + min + " AND POP_Total_Class <= " + max; POP_Total.setDefinitionExpression(expression); }


1

i think the jsapi documentation could be a little clearer on this point, but you need to supply whatever string that the particular service you are working with expects. as mentioned in the service documentation, acceptable values for impedanceAttribute are 'TravelTime' (default) 'TruckTravelTime' 'WalkTime' 'Miles' 'Kilometers' if you provide anything ...


1

What you are missing is an InfoTemplate on the FeatureLayer. When configuring a pop-up for a layer in a WebMap, you get this "for free". See an example of how to use InfoTemplate with a FeatureLayer https://developers.arcgis.com/javascript/jssamples/fl_popup.html


1

The facilities on the map is a featureLayer that comes with graphics that have information you dont need, like the attributes and symbology. You will want to make new graphics based on the graphics in the featureLayer. Replace this line facilities.features = lay.graphics; with this // require the dojo/_base/array module, named arrayUtils here ...


1

yes, this is feasible. yes, here is an example: https://developers.arcgis.com/javascript/jssamples/portal_addshapefile.html rather than esriRequest, you will need to pass the zipped file as one of your inputParameters when calling Geoprocessor.execute()


1

I am guessing your basemap is in Web Mercator? Handle the graphics and convert their geometry to Web Mercator individually arrayUtil.forEach(graphicsLayer.graphics, function(g){ var geom = esri.geometry.geographicToWebMercator(g.geom); g.setGeometry(geom); });


1

Have you seen output spatial reference on the geoprocessing endpoint itself? https://developers.arcgis.com/javascript/jsapi/geoprocessor-amd.html#outspatialreference and Output spatial reference (coordinate system)


1

Ok this is how i solved it. I added a renderer to drawingOptions var sls = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, esri.Color([255, 255, 0]), 3); drawingOptions.renderer = SimpleRenderer(sls); After i did that i had to enable dynamic workspaces in the service capabilities via the server manager. Hope this helps someone.


1

You could use map.resize(); fire it whenever the browser is resized or when the display attribute of the container changes (dojo.on('id', 'resize', function(){})). Works on most occasions. Or you could use something like map.redraw() or map.refresh() (https://developers.arcgis.com/javascript/jsapi/featurelayer.html#redraw). Key is to tap into the window ...


1

You did not provide the template HTML for your button so this is just a guess as to the issue. Your button needs an 'onClick' event to execute your 'clearSelection' method. Something like this: data-dojo-attach-event="onClick:clearSelection" To display an average instead of a sum, you can use the original method you posted with a slight variation: ...


1

as mentioned in the header for this sample, when the server you are making calls to actually supports CORS, you can notify the JSAPI like this. esriConfig.defaults.io.corsEnabledServers.push("server.com") that being said, i don't think sampleserver1.arcgisonline.com supports CORS, so i'd recommend using our production World Geocoding Service instead. in ...


1

You cannot capture selecting a feature template and creating a feature on the map using, for instance, with Selenium IDE. This is because those things don't happen at the client side, and the testing software is not aware of JS API and considers editing templates to be just a group of CSS elements. Actually, you can test those kinds of interactions. ...


1

Use the searchExtent AND sourceCountry based on the country-code from here (https://developers.arcgis.com/rest/geocode/api-reference/geocode-coverage.htm)


1

results.features is an array of features. Loop though this array to push every feature in map.graphics. Like this for (var i = 0; i < resultCount; i++) { var resultGraphic = new Graphic(results.features[i], highlightSymbol); map.graphics.add(resultGraphic); } //replace this line with the above code var resultGraphic = new Graphic(results.features, ...



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