|
POST
|
The print task parses the map object manually to create a JSON object that matches the ExportWebMap specification to use Print GP Services. http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000004w8000000 So you can do the same, but you'd need to step through the map object, JSON.stringify() won't do it.
... View more
10-02-2013
09:35 PM
|
0
|
0
|
3484
|
|
POST
|
Here's a link on publishing a service with network analysis http://resources.arcgis.com/en/help/main/10.1/index.html#//015400000276000000 And one on working with the route task. https://developers.arcgis.com/en/javascript/jshelp/intro_route_routetask.html We just migrated to 10.1 this week (late to party, I know), but because of changes with Server and ArcObjects in the upgrade we can no longer use a couple of custom web services we used for our flow tracing capabilities with Network Analysis. In our case, I'll have to migrate it all to a Server Object Extension and publish it to our server, which is kind of a pain. In that case, esri.request would be how I'd interact with. http://resources.arcgis.com/en/help/main/10.1/index.html#/Server_object_extension_usage_in_client_applications/0154000004s6000000/ Not sure how much help that is, but those are the routes I'm taking.
... View more
10-01-2013
02:56 PM
|
0
|
0
|
1608
|
|
POST
|
If you are using jQuery with Dojo, be sure to add this line before your first require statement. define.amd.jQuery = true; http://stackoverflow.com/a/12153995/241635 https://www.ibm.com/developerworks/mydeveloperworks/blogs/94e7fded-7162-445e-8ceb-97a2140866a9/entry/loading_jquery_with_dojo_1_7_amd_loader2?lang=en The why https://github.com/amdjs/amdjs-api/wiki/jQuery-and-AMD
... View more
09-30-2013
06:14 AM
|
0
|
0
|
1683
|
|
POST
|
If you want a single file building using the ArcGIS JS API, as of right now Scott's blog that you linked to is pretty much the only way to go. At least I haven't seen anyone else put another solution forward and I know myself and others have hacked away at options for a while. He did all the nitty gritty of building the exlusion list to get a single file Dojo build working. It's not pretty, but it does the job.
... View more
09-17-2013
06:41 AM
|
0
|
0
|
809
|
|
POST
|
It's possible, but requires a little bit of elbow grease. You could basically check for a connection on each save or edit by using navigator.onLine. If false, you have no connection, and set up something to store the feature in LocalStorage. If true, push update as normal. You just need to add a notification of some sort letting user know they have data that needs to be synced when they get a connection back. Or you could do it under the hood without them knowing. You could use that method in conjunction with this sample on storing tiles in LocalStorage and be halfway there. https://developers.arcgis.com/en/javascript/jssamples/exp_webstorage.html Combine that with ApplicationCache if you can and be well on your way. I'm getting good results so far, but I have not hit the LocalStorage limit (maybe 5mb if lucky) (edit, spoke too soon. I was hitting limit, just forgot to check for it. I have a clear cache button now) and unless you are using IE9+ I don't think you can check what space is left, you'll just get an error when you run out, so I'm looking into modifying the Tile Storage slightly to add a date element or a 'viewed" count and eliminate the oldest/leaset used tiles to make room for more. One thing I have not tried yet is using IndexedDB to store features. Maybe once I get this off the ground first. I'm hoping to add disconnected editing tutorial into some stuff I am working on.
... View more
09-16-2013
02:52 PM
|
0
|
0
|
1114
|
|
POST
|
Yes you can. You'll want to review some of the docs on moving to AMD from the old Dojo <1.7 style. https://developers.arcgis.com/en/javascript/jshelp/inside_dojo_amd.html https://dojotoolkit.org/documentation/tutorials/1.8/modules/ And as nliu pointed out, there is an esri-leaflet plugin currently in development in it's early stages, but has some active commiters. https://github.com/esri/esri-leaflet It's got some reported issues and does not have the full documentation that the ArcGIS API does, but is an interesting project.
... View more
09-16-2013
07:33 AM
|
0
|
0
|
2419
|
|
POST
|
The API is built on Dojo, so you do need to work within the confines of Dojo, like the AMD loader. https://dojotoolkit.org/documentation/tutorials/1.8/modules/ That is't to say you can't incorporate it with libraries like jQuery, Backbone or Angular if you like. jQuery https://developers.arcgis.com/en/javascript/jssamples/mobile_citizenrequest.html Backbone http://blog.davebouwman.com/2013/02/18/marionette-with-maps-series-intro/ Angular http://odoe.net/blog/?p=447
... View more
09-16-2013
04:06 AM
|
0
|
0
|
2419
|
|
POST
|
Not to pimp, but I'll pimp a little, you can view a presentation I did at the last dev summit on AMD. http://video.esri.com/watch/2318/embrace-your-modules-on-amd-and-javascript There was another good talk about building modular dijits, but doesn't look like it's available. The transition to AMD from the (ArcGIS JS) pre-3.0 days can be a little bumpy, and it may not be perfect, but it works pretty well. I am however of the opinion that when you have a dependency array like function(dom, domAttr, array,Color, parser, esriConfig,Map,Graphic,GeometryService,BufferParameters,Draw,SimpleMarkerSymbol,SimpleLineSymbol,SimpleFillSymbol) It's a good sign you could use a refactor of some sort.
... View more
08-30-2013
08:51 AM
|
0
|
0
|
1938
|
|
POST
|
This is currently listed as "under consideration" on the ideas site. http://ideas.arcgis.com/ideaView?id=08730000000brPPAAY If you need to make a lot of updates when map services change, you can try creating a dictionary of layers to indexes. You'd basically do a request for the map service data http://gisserver:6080/arcgis/rest/services/MyService/MapServer?f=json Iterate over the results like so, var indexLayers = {},
layers = result.layers;
for (var i = 0, len = layers.length;, i < len, i++) {
var layer = layers;
indexLayers[layer.name] = layer.id;
}
// now you can use indexLayers in your app to do the correct referencing
// when needed
layer.setVisibleLayers([indexLayers.Parcels, indexLayers['Building Footprints']]);
... View more
08-26-2013
09:33 AM
|
0
|
0
|
1229
|
|
POST
|
Take a look at the documentation on esri/request. https://developers.arcgis.com/en/javascript/jshelp/inside_esri_request.html It can handle making the request calls for you and then it is up to you how you want to display that data in your application. It however looks like the links to the sample apps from that page are not working, but it should give you a good start.
... View more
08-26-2013
07:03 AM
|
0
|
0
|
796
|
|
POST
|
That particular less file is all mixins and variable declarations, there's no actual css to be compiled. The mixins would get used in a css style, like
div.map-container {
.gradient-and-filter(@primary-color, 10, 10)
}
You can see this by copy/pasting all the less into the less2css site, then add the snippet above to see the results. Here is a page describing how less mixins are used. http://www.sitepoint.com/a-comprehensive-introduction-to-less-mixins/
... View more
08-22-2013
02:27 PM
|
0
|
0
|
832
|
|
POST
|
Whe it comes to JavaScript/Web Development in general, there are just far too many variables in place to say "use this one". Aptana seems to be used by quite a few people. Visual Studio 2010/2012 are decent environments to work in. If you are going to be writing an application that requires you build a .NET Service with it, it's a natural choice. Aptana and VS with the intellisense plugins mentioned are one route if that is important to you. I came from mainly a Flex background as well, but even then, Flashbuilder tools paled in comparison to what vanilla Eclipse could do with Java. Not having immediate access to the docs in the IDE may be a pain at first, but you get used to becoming very familiar with the online docs. A lot of people use SublimeText and configure the build tools to handle linting/testing. There's no intellisense per se, but it will provide intellisense to code that has previously been written, same for Vim. Unlike Visual Studio for example, these tools work on Windows/Mac/Linux, so if you have to switch around, it's worth learning them. WebStorm is also really good, and has a great plugin setup. A lot of people will use tools like Grunt to perform these tasks from the command line. Check out this slide and video from the most recent Dev Summit where he used Grunt to automate all his tests and do some code gen. http://proceedings.esri.com/library/userconf/devsummit13/papers/devsummit-107.pdf http://video.esri.com/iframe/2326/000000/width/960/0/000000 Personally, I use Vim with Grunt to do everything, but in the end, it just boils down to what you're most effecient in.
... View more
08-21-2013
11:47 AM
|
0
|
0
|
1550
|
|
POST
|
You were on the right track with this line if (entry.attributes.relatedresource === null) You could do a check on the first and second array element, and if it's null or undefined. if (resource[0] && resource[1]) {
// continue as normal
} That should work as it checks for truthiness of those values.
... View more
08-13-2013
08:39 AM
|
0
|
0
|
2048
|
|
POST
|
DeferredList results are little funky when you first start dealing with them. The result of a DeferredList is 2-dimensional arry (array of arrays). A result will look like this.
[
[ true, { name: "I am result 1." } ],
[ true, { name: "I am result 2." } ],
[ true, { name: "I am result 3." } ]
]
Each array inside the main array is a result of a deferred. If the first element in the array is true, it resolved sucessfully, if it is false, something went wrong and the second element would be the error message. You can view the source code for DeferredList here. https://github.com/dojo/dojo/blob/master/DeferredList.js#L32-L58 The highlighted snippet shows how the results of a DeferredList are built. Knowing how the results are returned from a DeferredList makes parsing the data a little easier. In your snippet, I think if you change this bit here, it should work.
queryResults = dojo.filter(queryResults, function (result) {
// change this here, you were returning queryResults[0]
// result[0] would be either true or false and this filters out all false results
return result[0];
});
Then the next bit of code you use to concatenate the results should work. I have this snippet of similar code that I have used to clean up the results and it's always worked for me.
function cleanResponse(res) {
var i = 0,
len = res.length,
results = [];
for (; i < len; i++) {
// checks to see if the resolved value is true
if (res[0]) {
// concatenate the array with the resolved result
results = results.concat(res[1]);
}
}
// creates an array of only your results or FeatureSets
return results;
}
With that, DeferredList is now a deprecated module and it is recommended that you look at the dojo/promise/all module. The API is much cleaner to work with and doesn't involve worrying about 2-dimensional arrays. http://dojotoolkit.org/reference-guide/1.9/dojo/promise/all.html Hope that helps.
... View more
08-08-2013
02:04 PM
|
0
|
0
|
873
|
|
POST
|
Edit - this is a better answer, because my brain stopped working earlier. It is addFeatures, I was looking at it wrong http://resources.arcgis.com/en/help/rest/apiref/fsadd.html Your format looks good, but when using $.ajax I think you have to stringify the data before sending it. So
data: JSON.stringify(theData)
... View more
07-24-2013
09:38 AM
|
0
|
0
|
5788
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|