|
POST
|
Version 2.4 of the API supports KML data via the KMLLayer class. Samples: ArcGIS API for JavaScript: KML Layer ArcGIS API for JavaScript: KML Layer with buffer
... View more
08-29-2011
10:50 AM
|
0
|
0
|
3524
|
|
POST
|
You can get this info from the REST API. Each layer has an endpoint you can hit: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/2?f=pjson The layer's drawingInfo object contains a renderer that tells you how each value or range of values is symbolized.
... View more
08-29-2011
09:46 AM
|
0
|
0
|
698
|
|
POST
|
One more thing to add: I did a quick test with the REST endpoint you posted. Edit: The two URLs below correspond to clicking somewhere in South Carolina when the map is at zoom level 5. The maxOffset used in the first URL was calculated by loading the app, opening the chrome dev tools console and entering the following:
map.extent.getWidth() / map.width
Using maxAllowableOffset: http://wms.cartographic.com/GWS/rest/services/Open/LS_EsriSample/MapServer/identify?geometryType=esriGeometryPoint&geometry={%22x%22%3A-8839789.239531778%2C%22y%22%3A3982063.780911503%2C%22spatialReference%22%3A{%22wkid%22%3A3857}}&sr=3857&layers=all%3A0%2C2&time=&layerTimeOptions=&layerdefs=&tolerance=0&mapExtent={%22xmin%22%3A-11559724.454030767%2C%22ymin%22%3A2406849.5020110095%2C%22xmax%22%3A-5757848.259074291%2C%22ymax%22%3A6525888.082241492%2C%22spatialReference%22%3A{%22wkid%22%3A3857}}&imageDisplay=1186%2C842%2C96&returnGeometry=true&maxAllowableOffset=4891.96981024998&f=json Response size: ~196K Response time: 2.9s Not using maxAllowableOffset: http://wms.cartographic.com/GWS/rest/services/Open/LS_EsriSample/MapServer/identify?geometryType=esriGeometryPoint&geometry={%22x%22%3A-8839789.239531778%2C%22y%22%3A3982063.780911503%2C%22spatialReference%22%3A{%22wkid%22%3A3857}}&sr=3857&layers=all%3A0%2C2&time=&layerTimeOptions=&layerdefs=&tolerance=0&mapExtent={%22xmin%22%3A-11559724.454030767%2C%22ymin%22%3A2406849.5020110095%2C%22xmax%22%3A-5757848.259074291%2C%22ymax%22%3A6525888.082241492%2C%22spatialReference%22%3A{%22wkid%22%3A3857}}&imageDisplay=1186%2C842%2C96&returnGeometry=true&maxAllowableOffset=&f=json Response size: ~758K Response time: 9.0s
... View more
08-29-2011
09:22 AM
|
0
|
0
|
2060
|
|
POST
|
Derek, I have created a sample app and a Rest service and made it public for you to check out. As you can see i have included both the original files and a simplified layer which i was going to use to get the geometries from. This app will potentially be hit by many users when it is completed and thus i figured having a pre-simplified (as opposed to maxAllowableOffset) would be the best choice. All of the code (minus the modules) is in the single .htm page. It is pretty simple as i am just working on getting the data to come back correctly before i move into design/ detailing (i know she ain't the prettiest). Functionality - -click on somewhere in the US or Canada runs an Identify on the original data- brings back data and graphic (original features) -use the input at the top to search for a country or admin unit within US or Canada (brings back simplified layer) -click on country column in Top 25 Countries Chart to get data and graphic of that country (brings back simplified layer) Links- http://wms.cartographic.com/test/esrisample.htm http://wms.cartographic.com/GWS/rest/services/Open/LS_EsriSample/MapServer Hi Tony, Thanks for providing those links, very helpful. Apologies for the slow reply; I was out of commission for a couple of days last week. I took a look and I think you could see significant benefits from using maxAllowableOffset. I encourage you to re-visit the blog post I linked to earlier in this thread. The point of maxAllowableOffset is not to arbitrarily generalize features, but to generalize to an optimal level. Since our screens/monitors have a finite number of pixels, depending on the map scale, multiple feature vertices might fall in a single pixel. It is a waste of effort and resources to transmit, process and display these vertices. By setting maxAllowableOffset appropriately, you are telling the server to return geometries optimized for the map's scale and the display being used. Eliminating vertices that would be displayed in the same pixel does not lead to misinformation but it does have the potential to significantly improve the performance of your app. By eliminating vertices that cannot be displayed, features are returned to the client faster and displayed faster. There's a famous quote that sums this up quite nicely: "everything should be made as simple as possible, but no simpler". The implementation of this is straightforward: -when your app starts, calculate the width of a pixel in map units -set maxAllowableOffset for your identify parameters to the width of a pixel -re-calculate maxAllowableOffset when your map scale changes -update your identify parameters accordinglyj Side note: this applies not only to identify parameters but also to query tasks and feature layers as they both can use maxAllowableOffset. You can see maxAllowableOffset in action here: http://servicesbeta.esri.com/demos/high-perf-feature-layers/ Here's a code snippet showing an event listener for onZoomEnd that calculates the width of a pixel in map units and updates an identifyParameters object accordingly:
dojo.connect(map, 'onZoomEnd', function() {
// Calculate width of a pixel in map units
var maxOffset = map.extent.getWidth() / map.width
// Specify maxAllowableOffset as the width of a pixel
// so that no more than one vertex per pixel is returned
identifyParams.maxAllowableOffset(maxOffset);
});
Please experiment with something like this as it's a pretty quick change to make to any app and can make a world of difference.
... View more
08-29-2011
09:06 AM
|
0
|
0
|
2060
|
|
POST
|
Can you elaborate on how you're using maxAllowableOffset? If you're following the guidelines from our recent blog post, I'd be surprised if any one feature is more than 10-20k. If you're specifying a maxAllowableOffset that returns a geometry with no more than a single vertex per pixel, and you're still seeing ~4 seconds for an identify to return, I would look at the resources available on the server when you see slow response times. I would also look into the underlying data store and see if you see similar problems querying the data with other clients (try ArcMap, for instance). I don't think a relationship class and a subsequent query for related records would be the best solution to your problem. Is your REST endpoint public? Can you post a link? Or better yet, a link to your app? I'm also curious about your data; can you elaborate on what kind of things you're mapping? Or just about "feature A" that takes 8s to send across the wire?
... View more
08-24-2011
03:57 PM
|
0
|
0
|
2060
|
|
POST
|
You can modify your service to return more than the default 1000 records (the default was 500 at 9.3.1) but this is the default for a reason- increasing it can lead to slower response times. Any chance you can re-consider your design? Because I'm curious, what are you hoping to do with thousands of records on the client? Could you possibly load them on demand instead?
... View more
08-24-2011
03:42 PM
|
0
|
0
|
1606
|
|
POST
|
The order of the results returned by a DeferredList are in the order in which your added Deferreds to the DeferredList. So, if you create a DeferredList like so:
var dl = new dojo.DeferredList([qt1, qt2, qt3]);
dl.addCallback(processQueryResults);
The first item in the array passed to the processQueryResults function will have the results from qt1 the second item in that array will be results from qt2, etc. That being said, I still wouldn't encourage you to kick off dozens of queries...seems like a reliable way to slow down any app.
... View more
08-24-2011
02:05 PM
|
0
|
0
|
1606
|
|
POST
|
That should be working...I'm not sure exactly what's going wrong. Here are two URLs hitting services on sampleserver1.arcgisonline.com: -find counties named "Delaware" in Indiana using layer definitions: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/find?searchText=Delaware&contains=true&searchFields=&sr=&layers=3&layerdefs=3%3A+STATE_NAME+%3D+%27Indiana%27&returnGeometry=false&maxAllowableOffset=&f=HTML -find any county named "Delaware" in the course counties layer: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/find?searchText=Delaware&contains=true&searchFields=&sr=&layers=3&layerdefs=&returnGeometry=false&maxAllowableOffset=&f=HTML
... View more
08-24-2011
01:44 PM
|
0
|
0
|
646
|
|
POST
|
Adding a base map, creating the extent before referencing it in the map constructor and creating an extent with a spatial reference that matches the basemap's gets it working for me. Take a look at the attached, modified version of your code. No problems with dojo...
... View more
08-23-2011
03:54 PM
|
0
|
0
|
1423
|
|
POST
|
Hi Steve, This has come up in the past: http://forums.arcgis.com/threads/32424-Attribute-field-names?p=109561&viewfull=1#post109561 http://forums.arcgis.com/threads/7793-Identify-How-to-show-Alias-filed-instead-of-Field-Name?p=24158&viewfull=1#post24158 I would recommend using esri.request to hit each layer endpoint.
... View more
08-16-2011
06:03 AM
|
0
|
0
|
2727
|
|
POST
|
If you're just starting out, I recommend you go with the full ArcGIS API for JavaScript. Dojo is included with the API.
... View more
08-11-2011
12:09 PM
|
0
|
0
|
591
|
|
POST
|
I see now why the KML has to be publicly available..... Yucky smell. Care to elaborate?
... View more
08-10-2011
01:22 PM
|
0
|
0
|
498
|
|
POST
|
The code I posted works if you run it against a tiled map service. As you've found out, it doesn't work with dynamic services. Check out the documentation for the levels of detail(LOD) class. You need to provide a level, scale AND resolution when you create LODs.
... View more
08-05-2011
08:16 AM
|
0
|
0
|
2663
|
|
POST
|
This has been fixed in the publicly available service.
... View more
08-05-2011
07:04 AM
|
0
|
0
|
1662
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|