map.extent.getWidth() / map.width
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.htmhttp://wms.cartographic.com/GWS/rest/services/Open/LS_EsriSample/MapServer
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); });
The reason i need to query on the original dataset is the user needs to be hitting the exact feature, any generalization will lead to misinformation.
is there a more efficient way to do this, I.E not having to make 2 rest calls?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.