|
POST
|
That's actually how JavaScript prototypes work, not necessarily special to Dojo's declare method. Anything added to the prototype is not really hidden. The underscore is more of a convention, not a rule. The same can be said for other languages like Python, there is no real private. What you may be looking for is the revealing module pattern, which Dojo modules can implement very effectively. So for example, something that may seem quite Java'ish. define(['dojo/_base/declare'], function(declare) { var _myValue; return declare([], { constructor: function() { _myValue = 1; }, setMyValue: function(value) { if (_myValue !== value) { _myValue = value; } }, getMyValue: function() { return _myValue; } }); }); So now, you have a variable _myValue that is protected inside the declared module and inaccessible outside this module, since it is scoped in the define method. You could add any checks/transformations as required in the getter/setters and feel confident that the _myValue cannot be changed unless it's through the setter.
... View more
03-03-2014
06:28 AM
|
0
|
0
|
1103
|
|
POST
|
Would a FeatureLayer in MODE_ONDEMAND or MODE_SELECTION meet your needs using the selectFeatures method? https://developers.arcgis.com/javascript/jssamples/fl_selectfeatures.html
... View more
03-01-2014
08:12 AM
|
0
|
0
|
880
|
|
POST
|
You would create separate modules to keep your code modular. Here's a diagram I have been using to kind of explain how require/define work together a little easier for people. [ATTACH=CONFIG]31596[/ATTACH] So you could have a module that somehow produces your coordinates, and can return them via a pattern like the revealing module pattern in the module. You can then call the module from your the methods inside the require() of your application. Every Dojo app needs at least one require() method, but can have multiple modules using define(). Some good refs. http://dojotoolkit.org/documentation/ http://dojotoolkit.org/documentation/tutorials/1.9/modules/
... View more
02-19-2014
12:15 PM
|
0
|
0
|
2242
|
|
POST
|
There's a sample on using jQuery with the Esri JS API. https://developers.arcgis.com/javascript/jssamples/framework_jquery.html It's an older example and not AMD compatible. The basics of using any 3rd party framework with the Esri JS API is you still need to use the Dojo loader, so you still have to wrap modules in // define a module
define()
// initialize application
require() But inside those modules, you can use jQuery as normal. Here is a sample using Angular in much the same way https://github.com/odoe/angular-esri Here are some samples using other frameworks like Backbone and Knockout with the Esri JS API https://github.com/driskull/framework-samples-js
... View more
02-14-2014
12:33 PM
|
0
|
0
|
1016
|
|
POST
|
You could use hide() when the map loads and show() on a button click. I should also mention there has been some (non-esri) work recently to modify the ClusterLayer to work more like a FeatureLayer. https://github.com/odoe/esri-clusterfeaturelayer
... View more
02-13-2014
10:26 AM
|
1
|
0
|
2810
|
|
POST
|
Nevermind, I just published a new locator with less coverage. It works as a band-aid until they push a rewrite through.
... View more
02-06-2014
02:19 PM
|
0
|
0
|
603
|
|
POST
|
I have to fix an old ArcGIS LS 1.2 API app. I can't upgrade the API, it just needs to be working again soon. It's slated for a rewrite, but now right now. I need to pass the outSpatialReference parameter to the LocatorTask. The 1.2 API does not have the OutSpatialReference option in AddressToLocationsParameters. I just need to figure out a way to intercept the request before it goes out and append that one little string to it. I can use the GeometryService to project my data, but then I lose all my attributes and I have no idea how to sync the results from a ProjectAsync to the Graphics I sent it. If I could do this, fine, I'll do that, but any tips how? Any help would be appreciated here. I know this is an old version, but thanks.
... View more
02-06-2014
01:35 PM
|
0
|
1
|
965
|
|
POST
|
I updated the README with some instructions and requirements for use. https://github.com/odoe/esri-js-starterkit/blob/master/README.md It requires having git, node, Grunt and bower installed. http://git-scm.com/ http://nodejs.org/ http://gruntjs.com/ http://bower.io/
... View more
01-17-2014
05:40 AM
|
0
|
0
|
4775
|
|
POST
|
This isn't specific to the JS API, the placeholder attribute is only suppored in IE10+. http://caniuse.com/input-placeholder Here are a couple of links to (no dependency) placeholder polyfills you can try out. Note, I haven't tested these.
... View more
01-14-2014
10:35 AM
|
0
|
0
|
801
|
|
POST
|
Try adding a 2nd function after the callback to listen for a possible error and see if there is more information. updateFeature.getLayer().applyEdits(null, [updateFeature], null, function(){
map.infoWindow.hide();
}, function(err) {
console.warn('Error occured: ', err);
});
... View more
01-14-2014
05:50 AM
|
0
|
0
|
1575
|
|
POST
|
I have had really good luck so far. My first recommendation for people is to test out LocalStorage first. If that meets your needs, count yourself lucky. I don't want to pimp, but I cover this type of disconnected editing in my book in a much simpler method. In my production application, the field users are only ever concerned with very specific neighborhood level data, so using the TileStorage extension of tiled layers is working ok, but I do clear it every time the app starts, just in case, because you can hit the LocalStorage limit pretty quickly. Now, if you want to get into IndexedDB for data collection and not pollute your LocalStorage with it, I tested out writing an IndexedDB Store that worked pretty well. https://gist.github.com/odoe/6911676#file-indexeddbstore-js At least it worked everywhere except for iOS devices. iOS does not support IndexedDB no matter the browser, not even Chrome. Unless that's changed in the past couple of months, iOS browsers only support LocalStorage and WebSQL. This puts the developer in a silly situation of having to check which type of storage solution is available to use and pick it as necessary. Basically create a service interface that will call the appropriate storage methods for you. Plus, I didn't feel like writing a WebSQL Store. Again, there is a neat solution for that in the form of PouchDB. http://pouchdb.com/ It's a great little tool that handles all the heavy lifting of working with backend databases. They don't make it very clear in the documentation that I could see, but it will normally use IndexedDB for storage, but on iOS will use WebSQL without you having to tell it to. I using was an adapter at first and twitter raving about PouchDB when the author told me it was now integrated into PouchDB core, so that was a pleasant surprise. So now, I use this PouchDB Store in my production app. https://gist.github.com/odoe/6911676#file-pouchdbstore-js It works great saving and pulling my data out, it's all just a matter of converting the graphics to json strings and parsing them back to json and pushing the adds/updates/deletes. I'm still waiting on feedback from field testing on how the users prefer to so sync the data. Either by manually pushing a sync button or behind the scenes as soon as a connection becomes available. The other challenge is determining when you are offline. Here is a great SO answer discussing What does it mean to be "online"? I have not tackled the Application Cache yet, but my basic plan is to run through the app with a few tasks, make a list of all the JS files used via CDN as well my own for the app and add them to the cache list, which would be pretty long. I'm not even sure I'll go this route as these types of web apps need some sort of connection mainly for base data. I suppose if your data set is not that large, you could store it locally and load it as a FeatureCollection to a FeatureLayer, maybe save some Tiles in local storage and combinged with the Application Cache have a fully offline capable map. It would probably need to be really simple though. The native SDKs have the advantage of access to new tools for offline, which are looking very attractive for field apps. https://developers.arcgis.com/en/android/whats-new.html#beta https://developers.arcgis.com/en/ios/info/whats-new.htm#ESRI_SECTION2_71BFA93C1AE64D58BBFAB139D173209A My long, and apparently drawn out point, is that you can do a lot with disconnected editing with ArcGIS JS apps. Not everything and not without some trial & error, but you can do something.
... View more
01-14-2014
05:20 AM
|
0
|
0
|
1135
|
|
POST
|
There are still parts of the REST API not implemented in the JS API yet, probably because of how they return results. You could try the setRequestPreCallback method advised for this similar situation in this thread. http://forums.arcgis.com/threads/95739-Why-isn-t-quot-returnDistinctValues-quot-an-option-for-the-quot-Query-quot-object-in-the-JS-API
... View more
01-13-2014
05:43 AM
|
0
|
0
|
846
|
|
POST
|
I have standard print widget I use for all my apps. https://github.com/odoe/esri-print-widget It's meant to display a button you click and a print dialog shows up with dropdown menu for available templates. It's used in this sample starter-kit here. https://github.com/odoe/esri-js-starterkit
... View more
01-09-2014
01:50 PM
|
0
|
0
|
4775
|
|
POST
|
How about coverting the features to JSON and convert the JSON to csv directly on the client? http://stackoverflow.com/questions/4130849/convert-json-format-to-csv-format-for-ms-excel
... View more
01-09-2014
04:28 AM
|
0
|
0
|
1068
|
|
POST
|
The esri-leaflet library doesn't have any css files, but leaflet does. This link should work https://github.com/Leaflet/Leaflet/archive/master.zip The vendor folder is empty for esri-leaflet unless you need to compile from source. There are instructions on the github page. But the dist folder has everything you need for esri-leaflet except leaflet itself, that's why you need to download that separately.
... View more
01-08-2014
06:06 AM
|
0
|
0
|
2142
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 8 hours ago | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
11 hours ago
|