New answers tagged

1

require([ "esri/map", "esri/toolbars/draw", "esri/layers/GraphicsLayer", "esri/symbols/SimpleFillSymbol", "esri/graphic", "dojo/domReady!" ], function( Map, Draw, GraphicsLayer, SimpleFillSymbol, Graphic ) { map = new Map("mapDiv", { basemap: "streets", ...


0

Such a trivial task that I overlooked in the documentation. The answer is simply: g.draw()


2

i wrote a blog on this exact topic awhile back. Using Proj4JS in the ArcGIS API for JavaScript to reproject coordinates on the fly https://geonet.esri.com/groups/geodev/blog/2014/11/03/use-proj4js-alongside-the-arcgis-api-for-javascript-to-reproject-coordinates-on-the-fly


0

This is the expected result - the getCapabilities request goes via the proxy as it could be prevented by the browser as a Cross Origin Request. As the tiles themselves are loaded as images these are permitted cross-origin and so don't need to be loaded via the proxy - this can't be forced by configuring the Javascript API. If you needed to force the tile ...


0

this is happening because you are granting viewDiv 100% height and width in the <style> block near the top of your app and forcing a div which previously took up the entire visible screen below another div whose style is declared inline to have a height of 500px. in general, css is a pain. tutorials online can help. you can find a working example ...


1

Reading the docs : https://developers.arcgis.com/javascript/3/jsapi/featurelayer.html#event-load In JavaScript if code is asynchronous, should be provided an event / callback function that fires once the code is done. It seems there's a load event. So, try something like this : featureLayer.on('load', function(response){ ...


1

I ended up doing it manually since I haven't found how to do it... var polygons = []; var i; for (i = 0; i < featureLayerSelection.graphics.length; i++) { polygons[i] = new Polygon(new SpatialReference(featureLayerSelection.graphics[i].geometry.spatialReference.wkid)); polygons[i].rings ...


1

You may not be able to do that using the where clause. In the link you provided, the docs say "Some of these options may be overwritten by the search widget including the following:" outSpatialReference returnGeometry num outFields where maxAllowableOffset objectIds


1

As far as i know, the ArcGIS API for JavaScript doesn't have a handy shorthand to bump LODs on the fly but you can supply an altered set yourself. tileInfo: new TileInfo({ spatialReference: new SpatialReference({ "wkid": 3857 }), rows: 512, cols: 512, origin: { "x": -20037508.34, "y": 20037508.34 }, lods: [ ...


0

I was able to to get this to work with the following code. var movePoint = function (lat, lon) { view.graphics.remove(pointGraphic); point.latitude = lat; point.longitude = lon; pointGraphic = new Graphic({ geometry: point, symbol: markerSymbol }); view.graphics.add(pointGraphic); }; It seems like the trick here to get it to work is ...


0

I found the answer. The offending line is below: window[layer.name] = defineFeatureLayer("ObjectID", 2, false, ["${NAME}", "${*}"]); the definition of this function is below: defineFeatureLayer = function(idString, dimension, ondemand, infoTemplateArray, feats) { var infoTemplate = new InfoTemplate(infoTemplateArray[0],infoTemplateArray[1]); ...


0

I figured out a solution to this problem. I could not find a way to get a GraphicsLayer to be properly labeled but when I switched to a FeatureLayer instantiated with my own feature collection I was able to configure a renderer that rendered the print service PDF correctly. Here's some simplified code: var featureCollection = { "layerDefinition": { ...


1

Based on this thread it appears that this is a limitation of the print task API. The ESRI staff member there stated: Unfortunately, i don't know how of a good way to work around this problem (other than ensuring that you have fields present in the data for values you need to render by.)


2

This blog has an excellent example of how to make the window draggable and hide the arrow using dojo: https://gavinr.com/2015/04/13/arcgis-javascript-draggable-infowindow Here's the key javascript snippet: require([ 'esri/arcgis/utils', 'dojo/dnd/Moveable', 'dojo/query', 'dojo/on', 'dojo/dom-class' ], function ( arcgisUtils, ...


1

You got this error because you are trying to get an Extent of point geometry , so the Point geometry does not have an extent like (polyline,polygone ...) the school feature layer is a esriGeometryPoint Layer , so you cant work with extents here : I used the centerAndZoom map function to zoom to the returned point geometry , and i've add graphic for ...



Top 50 recent answers are included