New answers tagged

1

You are trying to make a spatial query it would'nt work with query.where ! use query.geometry instead , and use a SPATIAL_REL ( in your case i think SPATIAL_REL_CONTAINS or SPATIAL_REL_INTERSECTS) , So your succes function would be : function OnSuccess(data, status) { var myObject = JSON.parse(data.d); //var querytext = JSON.stringify(myObject); ...


1

You are using a MapServer that has a Single Fused Map Cache: true which mean that your MapServer is a Cached service (designed to work with esri/layers/ArcGISTiledMapServiceLayer, in other terms, a service as basemap) . So You can't hide each layers of this service apart , you can only hide the entire service layers at ones. if you want your to fixe the ...


2

You can use the Geometry service project method to do this projection. Since it is an asynchronous call, it will not be as responsive as the example (which is being calculated in the browser). The core code to change is in showCoordinates: Working example: https://jsfiddle.net/gavinr/f8e62ajc Edit: John Gravois has a blog post explaining this exact problem ...


2

You have to place the code executed by your addToMap(evt) function in curly brackets.The problem is that you missed the closing bracket at the end of the function: function addToMap(evt) { //alert("Index"); toolbar.deactivate(); } //<- expected token So your browser expects to see the closing bracket, but it moves along to the next line and ...


0

Conversions to the local date and time in Java Script through the function toLocaleDateString() and toLocaleTimeString() has been adding some hidden characters that could not be displayed through an alert box or console. When the application was run on chrome or Firefox browsers performing queryTask.execute() went smooth. However, doing so from an IE or Edge ...


5

The function definition below (before addToMap) function() { toolTip = new Tooltip({ connectId: ["Info"], label: "value <b>Draw PolyLine</b>" }); throws the syntax error. You have to add a name to that function definition, like function createTooltip() { toolTip = new Tooltip({ connectId: ["Info"], label: "value ...


1

There were just a few minor errors. Try this: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Simple Map</title> <link rel="stylesheet" ...


1

query.outFields must be an array of strings, so you should rewrite that line to be: query.outFields = ["*"];


0

In the function function initToolbar(map){ //rest of code... } remove the parms map , because it create a confilct between the global variable map and the passed param to the function . It become : function initToolbar(){ //rest of code... }


1

Yes you can passe a Polygon Geometry , in your case I think , when you are clicking in the map you want first to get the District polygon , and after you'll perform the query on the CRD/CRD2/MapServer/0 by passing the distric poly if i've understand ! it's quite easy , I dont know if you're creating your own widget or a you write a legacy code, So , ...


1

you can pass any valid geometry object (including esri/geometry/Polygon) to query.geometry as soon as you have a reference to it.


0

One idea: 1.Collect the bounding coordinates using this.location.href and splitting (startExtent in code below). 2.Generate the map extent as min and max values taken from the list of values after splitting. Generate a polygon using points also generated from the list of values. Make a new map with basemap and apply the map extent generated in 2. On ...


1

From the JSON you posted, it looks you have the configuration for 2 layers in a single operational layer. Since there are duplicate properties such title for the single layer, it uses the second one, Parcels in this case. The operational layers is an array that should look like this: operationalLayers: [ { type: 'feature', /* details of ...


2

Your code seems to be working as it should. https://jsfiddle.net/kmqqxfuq/ Please make sure there are no other events being fired which set the feature color/opacity. (feature layer on opacity-change etc)


1

This is how you change it to UTM, First you have yo change it to wgs, and then call the function to do the rest function showCoordinates(evt) { var wgs = webMercatorUtils.webMercatorToGeographic(evt.mapPoint); var mp = evt.mapPoint; // Converting The WGS to UTM ...


0

var snapToTheseLayers = [ {layer: layer1}, {layer: layer2}, ...//add as many layers as you want ]; snappingManager.setLayerInfos(snapToTheseLayers );


0

Thanks for a problem and for the solution to greenlaw, it works fine. Does anybody know how to implement this code (toggle buttons) to app created with Web App Builder? There are a lot of linked js scripts and without knowledge of creating web apps I don't know where to implement this. It doesn't work in index.html. I'm up to create just a floor switcher ...


0

Just a brainstorm idea I came up with this morning: You can use these tools to determine the bounding box and extent for your study areas: Minimum Bounding Geometry: creates a new feature class with the the feature captured into individual rectangles which. Add Geometry Attributes: Adds and populates x-min,y-min,y-max,y-max fields to the new feature ...


1

I think the proxy usually just redirects basemap requests through the proxy. However the basemap tile request is still made through the client (i.e. the web server that hosts the proxy does not make the request to return to the client). I would say test it out on something simple to see. Alternatively, it may be worth looking at this library that Esri have ...


0

Yes it is possible to edit feature layers hosted in ArcGIS Online. There is plenty of documentation on this subject in the JSAPI docs. Here is one such example: https://developers.arcgis.com/javascript/jssamples/ed_default_editingwidget.html


0

The FeatureLayer's before-apply-edits event could be handled to populate the attribute of each graphic in the adds array.


0

Yes, you can do feature creation/editing from a feature service hosted on ArcGIS Online. "Hosted web layers are designed for map visualization, editing, and query." http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm#ESRI_SECTION1_5E584527C2BE44BB848B875F47B0434A You can go to the REST endpoint for your feature service and look under ...


1

You haven't explicitly defined myfeatureLayer as a variable, so it's not available when you try to run map.addLayer(myfeatureLayer). You could first declare myfeaturelayer as a variable, then add the variable to mysources, or you could get the last index of mysources and add that to the map.


1

A FeatureLayer shows a single layer in a service, which you have to include in its constructor. You have to specify the GridPoint layer (0) pointFeatureLayer = new FeatureLayer("http://164.100.133.131/arcgisserver/rest/services/CRD/CRD2/FeatureServer/0", { id: "Points" });


1

The way to step through and debug this is: on(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler); This line states that when the navToolbar's ExtentHistoryChange event fires, the code within extentHistoryChangeHandler should be run. Examining this code shows: function extentHistoryChangeHandler () { registry.byId("zoomprev").disabled = ...


1

Here is code that I found worked for this situation. Essentially, the code (not shown here) grabs the response of a POST method and parses it into javaScript variables. The bellow code injects the desired data into a feature layer. addResponseData = function addResponseData (layer,fieldname,value) { for (feature in layer.graphics) { var ...


2

you can't control the request method which will be used artificially, but you could tack on a meaningless additional request parameter to ensure that the request exceeds 2000 characters and achieve the same thing. var moreText = "%20AND%201%3D1%20"; var moreTextArray = []; for (var i=0;i<125;i++) { moreTextArray.push(moreText); } query.where = "FIELD ...


1

Possible Duplicate of: ArcGIS Server Setting proxy.ashx with ArcGIS API for JavaScript gives Error 403? You must add the final destination URL to the proxy.config file for the proxy handler. If you don't, it will respond with a 403 Forbidden code.


0

My first thought is that you are using 'Search' for your own variable in the first call - which will overwrite the esri Search class. The second call fails because of this. Search is no longer the object you think it is. Try using : var mySearch = new Search({ ... Beyond that, I don't what issues my arise by having two Search objects active. Good ...



Top 50 recent answers are included