POST
|
I have a custom SOE which returns a large JSON. Part of the JSON string is the extent that I will ultimately need to zoom to. The main guts of the JSON (the "results" section) takes several seconds to process and is unrelated to the "extentToZoomTo" section. Because I have rather complex symbology and am not using a cached image service, map.setExtent also takes a few seconds to complete. What I would like to do is to call map.setExtent immediately after I get the JSON, and then while the server is busy doing that, the client code can work on the "results". How can I make that happen?? What I have found is that if I simply call map.setExtent before I start processing the "results" section, it doesn't actually send that request to the server until after the results have been completely processed. I can verify that behavior by inspecting the Network tab in the developer tools. I'm guessing that this has something to do with the fact that setExtent is deferred. How can I get it to fire right away? If it matters, I have ArcGIS Server 10.2. { "extentToZoomTo": { "xmin": 1234, "ymin": 4567, "xmax": 2345, "ymax": 5678 }, "results": { //A very large amount of data here that takes several seconds to process } }
... View more
01-14-2017
06:36 PM
|
0
|
0
|
1231
|
POST
|
I'm not really sure what might be happening, but one thing you might do is to try to force a redraw by doing something like setting the focus map's mapscale property equal to the current mapscale. I think that'll cause a redraw/refresh.
... View more
06-08-2016
03:53 PM
|
0
|
5
|
857
|
POST
|
The IQueryFilterDefinition interface is often easier to use if you are just trying to sort. IQueryFilterDefinition.PostfixClause Example
... View more
06-08-2016
03:43 PM
|
0
|
0
|
946
|
POST
|
I hope this is the right place to post this question. I'm trying to change the selection color for a layer to red using the code below. Although I am able to generate a selection, the color for the features ends up being the default color (cyan). foreach (var x in MapView.Active.Map.Layers) { if (x.Name == "Distribution Lines") { foreach (FeatureLayer fl in ((GroupLayer)x).Layers) { try { QueuedTask.Run(() => { CIMBasicFeatureLayer cbm = (CIMBasicFeatureLayer)fl.GetDefinition(); cbm.SelectionColor = CIMColor.CreateRGBColor(255, 0, 0); fl.Select(queryFilter, SelectionCombinationMethod.New); }); } catch (Exception ex) { } } } }
... View more
06-08-2016
03:16 PM
|
0
|
2
|
3572
|
POST
|
I hope this is the right place to post this question. I'm trying to change the selection color for a layer to red using the code below. Although I am able to generate a selection, the color for the features ends up being the default color (cyan). foreach (var x in MapView.Active.Map.Layers) { if (x.Name == "Distribution Lines") { foreach (FeatureLayer fl in ((GroupLayer)x).Layers) { try { QueuedTask.Run(() => { CIMBasicFeatureLayer cbm = (CIMBasicFeatureLayer)fl.GetDefinition(); cbm.SelectionColor = CIMColor.CreateRGBColor(255, 0, 0); fl.Select(queryFilter, SelectionCombinationMethod.New); }); } catch (Exception ex) { } } } }
... View more
06-08-2016
02:47 PM
|
0
|
0
|
1421
|
POST
|
Oh fantastic - That'll do it. I had seen LayerInfo, but have looked past it before because it didn't have methods on it like queryFeatures that I needed (which are on the FeatureLayer). Ideally there would be some way to "hydrate" a FeatureLayer from a LayerInfo
... View more
04-25-2016
07:40 AM
|
0
|
0
|
2580
|
POST
|
If I have been passed an esri.Map in a JavaScript function, how can I use the map object to get at a specific layer by name? The Map in question contains a map service, and the map service contains a number of sublayers (one of which I need). In my case, I want to get the MinScale and MaxScale for layer "0" (named "KMPosts" of this map service: River/GDT_SDE (MapServer) Is it possible to do that without making a round-trip to the server?
... View more
04-24-2016
06:37 PM
|
0
|
2
|
5911
|
POST
|
Ultimately, I'm developing an application that will go offline which is why I am so interested in querying taking place on the client. I'm developing on top of Latitude Geographic's HTML 5 Viewer ("Geocortex") which has all the necessary infrastructure to work in an offline mode. Unfortunately, their viewer takes care of adding layers to the map using minified JavaScript, so it isn't readily apparent where the FeatureLayer I want to query is added to the map. I suppose if I knew where that was, I might have some success in accessing it at that point. I would have thought I could have somehow gotten it from the map itself and then called queryFeatures on it. Or perhaps hydrate a LayerInfo object into a full-fledged FeatureLayer.
... View more
04-15-2016
12:21 PM
|
0
|
1
|
579
|
POST
|
Thank you for your response. I think I tried to implement what you were suggesting below. Could you have a look? One thing that bothers me is having to use the URL. You see, the queryFeatures method, according to the documentation, will try to use a client side request if it can...will it still do that if I give it a URL?? I mean, how could it since this is a new FeatureLayer constructed from a URL. It really seems that I need the maps FeatureLayer to make a query that would work on the client only. function FindFeaturesInCurrentExtent(outFields, layerToQuery) { //var outFields = "FacilityID"; //var layerToQuery = "Transformer"; var esriMap = this.app.map; //a reference the esri.Map object for (var i = 0; i < esriMap.layerIds.length; i++) { var ly = esriMap.getLayer(i.toString()); if (ly instanceof esri.layers.ArcGISDynamicMapServiceLayer) { var adms = ly; for (var j = 0; j < adms.layerInfos.length; j++) { var li = adms.layerInfos ; if (li.name == layerToQuery) { var url = adms.url + "/" + li.id; var fl = new esri.layers.FeatureLayer(url, { outFields: [outFields] }); var ext = this.app.map.extent; var query = new esri.tasks.Query(); query.geometry = ext; //Ideally this will be a client-side request fl.queryFeatures(query, function (response) { alert(response.features.length.toString()); //Correctly returns the number of features }); } } } } };
... View more
04-15-2016
11:27 AM
|
0
|
1
|
579
|
POST
|
I have a map service located here: River/GDT_SDE (MapServer) that has 10 sub layers. I want to use queryFeatures on the "Waypoints" sublayer. How can I loop through all of the layers in the map (sublayers too) and find that layer by its name and then call queryFeatures on it? In the examples I have seen, a new FeatureLayer is always created... I don't want to create a new FeatureLayer from the URL, but rather get it from the map. (queryFeatures is documented here: FeatureLayer (legacy) | API Reference | ArcGIS API for JavaScript ).
... View more
04-15-2016
10:05 AM
|
0
|
5
|
2826
|
POST
|
I read the documentation and have been using the REST API to create several tile packages (*.tpk files) from the World Topo basemap for a very long hiking trail (the red line in the diagram below). Each .tpk file looks good on its own, but they are for different sections of the trail. I think what I need to do next for my mobile application that I'll be working on is to get them all into a single .tpk file. How can I accomplish that? I tried the Import Tile Cache geoprocessing tool, but either that didn't work or I'm not understanding what it does. Also, I tried using the "AreaOfInterest" parameter documented in the REST API hoping that I could pass in the coordinates of a polygonal buffer (the olive green buffer around the red line in the image below) of the trail and I would get just those tiles (in light yellow) that intersect the buffer; unfortunately it exported all the tiles within the bounding box of the polygon (which is far far more tiles than I need. So if I can solve either one of those problems to get a single .tpk of the trail (and not bunches of tiles I don't need), I'll be happy! Thanks. =EDIT= In the original post, I suggested that the AreaOfInterest property was not working properly. It is working just fine. User Error! The following URL will export out a nice diagonal area in southern Canada. http://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Topo_Map/MapServer/exportTiles?tilePackage=true&exportExtent=&optimizeTilesForSize=true&compressionQuality=90&exportBy=levelId&levels=16&areaOfInterest={ "features": [{"geometry":{"rings":[[[-12699190,6290346],[-12696698,6289903],[-12694650,6290774],[-12692097,6288832],[-12687816,6287854],[-12686746,6286127],[-12690064,6283772],[-12690216,6282611],[-12689957,6283681],[-12689100,6284078],[-12688474,6284735],[-12686685,6285958],[-12682756,6284827],[-12681243,6284904],[-12679179,6284277],[-12678934,6283176],[-12678598,6281540],[-12678476,6280486],[-12678522,6277398],[-12678415,6276480],[-12678430,6275976],[-12678063,6273958],[-12677925,6272001],[-12677589,6270533],[-12677880,6267598],[-12679164,6267537],[-12680463,6272169],[-12682191,6274478],[-12684774,6276175],[-12690645,6276404],[-12692708,6278284],[-12695353,6274416],[-12698487,6274600],[-12702767,6277719],[-12700383,6282335],[-12703792,6285423],[-12708133,6290025],[-12708454,6293128],[-12709127,6297577],[-12710610,6302897],[-12705213,6304395],[-12703134,6301995],[-12702018,6296262],[-12699190,6290346],[-12699190,6290346]]],"spatialReference":{"wkid":3857}}}]}&f=html
... View more
10-23-2015
04:44 PM
|
0
|
1
|
5038
|
POST
|
Thank you for getting me started on this - it was VERY helpful. A couple of questions though: (1) I have defined a polygon that is irregular (long and thin going SW -NE) I use that for the Area of Interest parameter. Unfortunately, while I am getting a valid tpk out for that area, it is the entire bounding box for that area, not the tiles just along the diagonals that I would have expected. Am I doing something wrong? (2) How can I combine the tiles of one tpk with that of another? Thank you!
... View more
10-23-2015
01:00 PM
|
0
|
1
|
1842
|
POST
|
An interesting pattern that seems to be used, at least partially, by ESRI is the idea of a REST endpoint operation kicking off a job and immediately returning a URL to the client; the client can use the URL to get the results of the job. I think the ExportTiles operation might be a little like that (though I haven't used it). A link to that documentation is below. ArcGIS REST API Possibly the URL returned could provide either another link to the the completed job (in my case reports on customers) or a percentage indicating how far along the job was. This pattern would seem to require the client browser to be quite chatty though (in Javascript, you would set up some mechanism to check on the progress every 5 seconds or so I suppose). I'm not sure if that constitutes a good design choice or not - thoughts or comments appreciated.
... View more
04-29-2015
07:30 AM
|
1
|
1
|
1582
|
POST
|
Is it possible to create a method in an SOE that is aynchronous and which could perhaps provide back the progress of an operation? For example, I would like to create an SOE method that accepts a rectangular area in which there are "customers", and I would like to create a report on the server for each customer. It could take several seconds to generate a report for a single customer, and there would likely be many customers; a total time of 5-10 minutes would be expected. Ideally as the reports were created, the client could be notified on a call-back method in JavaScript (perhaps providing a percent completion and a link to the last completed report).
... View more
04-28-2015
07:32 AM
|
0
|
6
|
5199
|
POST
|
I think what you are after is an IToolControl. See the documentation here: IToolControl Interface
... View more
04-06-2015
10:33 AM
|
1
|
0
|
364
|
Title | Kudos | Posted |
---|---|---|
1 | 04-29-2015 07:30 AM | |
1 | 02-09-2015 10:25 AM | |
1 | 04-06-2015 10:33 AM | |
2 | 02-24-2015 10:00 AM | |
3 | 09-11-2014 10:37 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|