|
POST
|
I haven't seen any examples of wrapping any of the stuff from our samples in a jQuery plug-in. Why not wrap use a Dojo class instead? Refer to our Writing a Class help topic if you haven't worked with those particular Dojo components before.
... View more
10-24-2012
07:16 AM
|
0
|
0
|
1040
|
|
POST
|
Batch geocoding via the JS API requires a 10.1 service, as noted in the API reference for addressesToLocations.
... View more
10-23-2012
02:24 PM
|
0
|
0
|
1792
|
|
POST
|
I don't mean to get the thread of topic, but my concern with the above approach is what happens when we bring in other layers? for example AGO or OSM or a webtiledservice? if you use the {$row}/{$col}/{$lvl} url pattern, and are expecting lvl 10 to be the "universal" definition of 10 based on Google/Bing/ESRI, it causes lots of problems. Agreed, the current way to do this has issues... It would be really really nice if we could just leave the lods default, not have to define anything, and just say map.maxScale = 16 and map.minScale = 6 It's like you've been sitting in on our team meetings... I'm not committing to a timeline, but we're planning to add zoom, minZoom, maxZoom, minScale and maxScale properties to map.options to simplify this whole workflow. zoom would be used to specify the zoom level the map starts at, minZoom and maxZoom specify minimum and maxim zoom levels, if that's not obvious ;).
... View more
10-19-2012
09:44 AM
|
0
|
0
|
1669
|
|
POST
|
great, thank you! ...any idea why I get 'undefined' as a result for the same field attribute in my infoWindow? The infoWindow text layout structure is the same as the layout given above..I built the tabbed infoWindow around this example: http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/identify_drilldown.html Not sure, can you start a new thread? Also, that's a very outdated link...we really need to have those pages redirect to the current docs.
... View more
10-19-2012
09:41 AM
|
0
|
0
|
2062
|
|
POST
|
be careful though, while it works for max, it does not work for minimum if you use setLevel. for example, if you do LOD 4-16, and then do setLevel(4) it goes to the 4th level, which in this case is level 7. Very counter intuitive. This is true, the best approach would be to use zero through whatever to number your levels as you specify them in map.options.lods. I should have done this in the example but did a lazy copy/paste. Here's a better example:
lods: [
{"level" : 0, "resolution" : 2445.98490512499, "scale" : 9244648.868618},
{"level" : 1, "resolution" : 1222.99245256249, "scale" : 4622324.434309},
{"level" : 2, "resolution" : 611.49622628138, "scale" : 2311162.217155},
{"level" : 3, "resolution" : 305.748113140558, "scale" : 1155581.108577},
{"level" : 4, "resolution" : 152.874056570411, "scale" : 577790.554289},
{"level" : 5, "resolution" : 76.4370282850732, "scale" : 288895.277144},
{"level" : 6, "resolution" : 38.2185141425366, "scale" : 144447.638572},
{"level" : 7, "resolution" : 19.1092570712683, "scale" : 72223.819286},
{"level" : 8, "resolution" : 9.55462853563415, "scale" : 36111.909643},
{"level" : 9, "resolution" : 4.77731426794937, "scale" : 18055.954822},
{"level" : 10, "resolution" : 2.38865713397468, "scale" : 9027.977411}
]
... View more
10-19-2012
08:56 AM
|
0
|
0
|
1669
|
|
POST
|
There's no jQuery bundled with 3.2 (or any other release). Put your script tag that includes jQuery above your script tag that includes the ArcGIS API for JavaScript.
... View more
10-19-2012
08:52 AM
|
0
|
0
|
705
|
|
POST
|
Send a request to get the meta data for the service and create an object that you can use to map coded values to actual values. Here's an example I've posted in the past: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <title>Get ArcGIS Server Map Service Layer Field Names</title> <script type="text/javascript"> var dojoConfig = { isDebug: true }; </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1"></script> <style type="text/css"> #content { width: 800px; height: 200px; padding: 5px; overflow: auto; border: solid 2px #AAAAAA; background-color: #FFFFFF; font-family: monospace; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0 0 0.5em black; -webkit-box-shadow: 0 0 0.5em black; -o-box-shadow: 0 0 0.5em black; box-shadow: 0 0 0.5em black; } .failure { color: red; } #status { font-size: 12px; } </style> <script type="text/javascript"> dojo.ready(function () { dojo.byId("url").value = "http://gisdemo1.cdm.com/ArcGIS/rest/services/MALDEN_MA_MOBILE_RELATE_FS/FeatureServer/1"; dojo.byId("content").value = ""; dojo.connect(dojo.byId("go"), "onclick", getContent); }); function getContent() { var url; dojo.byId("content").value = ""; dojo.removeClass(dojo.byId("content"), "failure"); dojo.byId("status").innerHTML = "Downloading..."; url = dojo.byId("url").value; if (url.length == 0) { alert("Please enter a URL."); return; } var requestHandle = esri.request({ "url": url, "content": { "f": "json" }, "callbackParamName": "callback", }); requestHandle.then(requestSucceeded, requestFailed); } function requestSucceeded(response, io) { var fieldInfo, pad; pad = dojo.string.pad; console.log("Succeeded: ", response); var fieldsWithDomains = {}; // loop throught the fields dojo.forEach(response.fields, function(field) { if ( field.domain ) { // use the field name as a key fieldsWithDomains[field.name] = field.domain; } }); var info = ""; // print out domain info for ( field in fieldsWithDomains ) { if ( fieldsWithDomains[field].codedValues ) { info += field + " has a CV domain, codes/values: \n"; dojo.forEach(fieldsWithDomains[field].codedValues, function(cv) { info += "\t" + pad(cv.code + ": ", 4, " ", true) + " " + cv.name + "\n"; }); } } console.log("info: ", info); dojo.byId("content").value = info; } function requestFailed(error, io) { console.log("Failed: ", error); dojo.addClass(dojo.byId("content"), "failure"); dojo.toJsonIndentStr = " "; dojo.byId("content").value = dojo.toJson(error, true); } </script> </head> <body style="font-family: Arial Unicode MS,Arial,sans-serif;"> <p>Use esri.request to download info coded value domains.</p> <p>Enter the URL for a layer with fields that have coded values domains:<br> <input type="text" id="url" size="75" /> <input id="go" type="button" value="GO" /> <br />Check the console for the full response. <span id="status"></span> </p> <p> <p>Fields with coded value domains:</p> <textarea id="content"></textarea> </p> </body> </html>
... View more
10-19-2012
07:00 AM
|
0
|
0
|
2062
|
|
POST
|
Are both layers in the same map service? If so, use an Identify Task.
... View more
10-19-2012
06:55 AM
|
0
|
0
|
827
|
|
POST
|
Can you reproduce in Firefox and post the error you see in Firebug? Usually Firebug shows more descriptive errors with less work.
... View more
10-19-2012
06:53 AM
|
0
|
0
|
888
|
|
POST
|
This isn't something that is available via the JS API (at best, it would be on a per session basis, which probably wouldn't be that useful, and then you'd need to persist this info somewhere). This is something that you could track via your web server logs. The specifics of how to do it will depend on the your web server you're using.
... View more
10-18-2012
07:25 PM
|
0
|
0
|
538
|
|
POST
|
Looking at your States map service, the spatial reference is web mercator, but the coordinate bounds look like geographic (latitude and longitude, probably WGS84) coordinates. Did you use Define Projection to set your data's projection to web mercator? Define projection doesn't actually reproject data, it only changes a dataset's metadata. If you did do this, I would run your layers back through Define Projection and specify WGS84. You can leave your data frame set to web mercator or set it to WGS84. In either case, re-publish your service. ArcGIS Server will take care of re-projecting your data on the fly when you use it as an ArcGISDynamicMapServiceLayer or when you use it in a webmap on ArcGIS.com.
... View more
10-18-2012
06:54 PM
|
0
|
0
|
1296
|
|
POST
|
You need to assign a value to the lods option in the esri.Map constructor to limit the zoom levels. That's the way to go. I've posted examples of how to do this in the past, most recently here: http://forums.arcgis.com/threads/68743-Removing-LODS-after-the-map-has-loaded?p=239740&viewfull=1#post239740
... View more
10-18-2012
06:47 PM
|
0
|
0
|
1669
|
|
POST
|
It comes down to the size of the geometry of your feature. Due to browser restrictions, when a URL is > 2k characters, the API uses a proxy. When you execute a queryTask, the geometry is sent as part of the URL (take a look in your browser's dev tools). Depending on how many vertices make up the feature's geometry, a URL can exceed the 2k character limit. I'm guessing that's what's happening here??? one feature has a few vertices so it doesn't need the proxy. When a larger feature is used, the URL is longer so a proxy is required.
... View more
10-18-2012
01:19 PM
|
0
|
0
|
1128
|
|
POST
|
Are you wanting to host the API yourself? You can download it here: http://www.esri.com/apps/products/download/index.cfm?fuseaction=download.all#ArcGIS_API_for_JavaScript There are folders named "jsapi" and "jsapicompact".
... View more
10-17-2012
12:57 PM
|
0
|
0
|
644
|
| 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
|