Hot answers tagged

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 ...


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 ...


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)


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 ...


2

i think the fact that we currently define an anonymous function to dicate what happens when users click on the control is why L.domEvent.removeListener can't be used to 'disable' it later programmatically from within a client app (more info here). it sounded like a pretty good idea to me, so i went ahead and submitted a pull request to add wrappers to esri ...


2

Sorry, I didn't know you were using Java API when I wrote my answer. You are very brief in the explanation of your problem, but I assume you would like to get point features. In order to get the vertices from a polyline you can use the feature vertices to points tool from the data management toolbox. For the newly created point feature class, add an X and ...


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 ...


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 = ["*"];


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.


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 ...


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 ...


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

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.


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 ...


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 ...



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