POST
|
Ok, this is all great information and I really appreciate the detailed response. I'm totally with you on I'd expect that the only AMD modules you're loading are esri modules for the mapping functionality, b/c for all other functionality (DOM, arrays, etc) you're probably relying on Angular This makes perfect sense. I'm also already isolating into small modules and mocking server responses with sinon in the case of service modules w/ REST calls which makes sense to me. I still don't really understand how/why you would mock an esri Polygon object when your function accepts a Polygon as an input, but I'm still learning when it comes to unit-testing best practices. What would be awesome is if the angular-esri-map repo included an example that showed unit testing best practices. This seems to always be missing from the GIS community, and adding in the map and Dojo make things quite a bit harder to sort out.
... View more
04-21-2016
03:35 PM
|
0
|
0
|
694
|
POST
|
Tom - thanks for the response. I understand that $q keeps us in the digest cycle (at least I understand the concept and have seen that with other cases - haven't specifically wrapped my head around it in terms of the esriLoader). I'm still a bit confused on testing without those dependecies. For example, are you saying that you really should have mocked esri.geometry.Polygon somehow in your test here? esri-karma-tutorial/geometryUtilsSpec.js at master · tomwayson/esri-karma-tutorial · GitHub
... View more
04-21-2016
08:24 AM
|
0
|
3
|
694
|
POST
|
I'm trying to understand the esriLoader utility in angular-esri-map. I'm not completely clear on the purpose of using it instead of dojo's require directly. Furthermore, I've been completely unable to figure out how to use it in karma/mocha tests. Specifically, the promises never return and mocha times out. Previously, i was using the karma-dojo plugin and calling dojo's require directly which seems to work. My big assumption here is that esriLoader should allow me to ditch the karma-dojo plugin. I've tried many iterations of this without any luck (including some attempts to add in $rootScope.$apply() calls). Here's just one of them: describe('pointsModel spec', function() {
var pointsModel;
var esriLoader;
beforeEach(module('jsapi4'));
beforeEach(module('esri.core'));
beforeEach(inject(function(_pointsModel_, _esriLoader_) {
pointsModel = _pointsModel_;
esriLoader = _esriLoader_;
}));
var Collection;
beforeEach(function(done) {
esriLoader.bootstrap().then(function() {
esriLoader.require([
"esri/core/Collection"
], function(_Collection) {
Collection = _Collection;
done();
});
});
});
describe('construction', function() {
it('should inject pointsModel', function() {
expect(pointsModel).to.not.be.undefined;
});
});
describe("summary", function() {
var points;
beforeEach(function() {
points = new Collection();
pointsModel.setPoints(points);
});
it('should count indexes', function() {
pointsModel.addPoints([
{ attributes: {index: 1}},
{ attributes: {index: 2}}
]);
expect(pointsModel.getIndexSum()).to.equal(3);
});
});
});
... View more
04-21-2016
06:32 AM
|
0
|
5
|
5340
|
POST
|
I'm trying to solve an issue with uploading attachments (FeatureLayer.addAttachment) and an unreliable cellular connection on a tablet (Air 3.3 on Android, Flex API 2.5 online/offline app). At first, long uploads were receiving a fault (Stream Error) after 30 seconds on the device and yet would finish successfully on the server without further notifcation. This was solved with setting : URLRequestDefaults.idleTimeout = LONGER_THAN_30SEC. //FeatureLayer.requestTimeout was being ignored. However, now I still have the edge case of the device losing connection before receiving a response from the server that the attachment was either successful or not (and with a long timeout, it just waits and waits because it never receives the response). The main issue with this is that if I re-send the attachment after assumed failure, it creates a duplicate record. In this scenario, I don't want the user to have to check to make sure the attachment is already there before re-sending either. This also really applies to FeatureLayer.applyEdits as well - just more likely to send correctly since less data. Possible solutions: Keep 30 second timeout and cancel the upload if timeout reached (There doesn't appear to be anyway to cancel the upload that I can find - there's no way to cancel underlying URLRequest). Make the app timeout roughly match the server timeout on the upload and assume if the app timeouts, then the server timed out and canceled the upload. I can't find a way to set that timeout - it doesn't appear that the "The maximum time a client can use a service:" setting in manager is adhered to for uploads. Is there another place to set this timeout that could be limited to just the FeatureService in question? Create a proxy service wrapping the rest api and check for duplicates before inserting new record. Create a proxy service handling the upload using Air's File.Upload (which can be canceled) and then calling rest API through the proxy. Query attachments for existing filename already there before submitting attachment (i think this may be best bet, but would rather prevent needing this extra call to server). Does anyone have any suggestions or ideas on the best way to handle this? Is there something I'm missing? Thanks, Josh
... View more
06-21-2012
07:23 AM
|
0
|
0
|
2587
|
POST
|
I know this is an old post but if it helps anyone searching, the Air mobile app uses its local app:/ based url as the "Referer" when sending HTTP requests. Example: app:/MyMobileApp.swf (Check fiddler headers for Referer to be sure). Plug that into "Web Application URL or HTTP Referrer" on your token generation page with appropriate credentials and embed away.
... View more
05-01-2012
09:31 AM
|
0
|
0
|
114
|
POST
|
These issues have been solved so I wanted to post up the solutions for anyone else that may need help. I had a couple different issues going on and this is what solved them: Saving projects from Mobile Project Center: From ESRI: IIS Settings: -Mobile folder has only Anonymous Authentication enabled. -Admin folder has only Basic Authentication enabled. -Content folder has only Anonymous Authentication enabled. -Grant the IUSR account full control to the Mobile folder. -Delete any existing projects from the Projects folder. -Before attempting to use Mobile Project Center after making these changes, close and reopen the application. After applying these settings, I was still getting directory access errors through the browser application. After granting write/modify permissions to the machine's "Users" role to inetpub/wwwroot/ArcGIS/mobile folder, these issues were resolved and everything worked fine. Also, I was not aware of this thread until after I solved my issues, but would have been a good place to look: http://forums.arcgis.com/threads/12596-Can-t-save-mobile-project-to-IIS-web-server Downloading projects/Connecting to server from ArcGIS Mobile on Juno: At first the Juno would not connect to the server when "Secured Server" checkbox was checked. If I left it unchecked, I could download a project with a secure service (after entering token credentials) and get data, but when the project opened, I would get a "Error opening mobile cache" message. It turns out our SSL certificate (Thawte) was not validating properly on the server (though it appeared to be fine in the web browser). A check with this tool: https://ssl-tools.verisign.com/#certChecker and installation of intermediate certificate: https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=AR1384&actp=RELATED_RESOURCE solved the issues for the Juno. After installed the intermediate certificate, the Juno is able to connect with "Secured Server" checked and download/open the project. Posting updates to server: Posting updates to the server was failing because I had the geodatabase version used in the mobile service set to protected instead of public, so the user in the service did not have edit permissions on the service. Hope that helps someone, not an easy task to get set up!
... View more
04-09-2012
08:44 AM
|
0
|
0
|
223
|
POST
|
I am having this isuse as well. Oddly enough my settings already match all of the sugeestions in this post and actually I can post projects using my Trimble Yuma which runs a windows 7 OS. However I am getting the not being able to save behavior on my xplore tablets that are running win XP. Could this be an os issue. My web server is Win Server2008 R2. I am curious if any other are having issues using xp machines only. I am tempeted to reimage my xplore tabs with win 7 and see if that fixes the issue. This probably won't solve your problem but I didn't see this anywhere in this thread. I just went through a lot of the same issues with saving projects as stated earlier in this thread (with a new setup on Windows Server 2008 R2) and in addition to some of the suggestions stated and help from ESRI (Thanks Jitesh N.!), I also had to grant permissions on the inetpub/wwwroot/ArcGIS/Mobile folder to the machine's "Users" role. This solved a similar issue to: "Access to the path 'C:\inetpub\wwwroot\ArcGIS\Mobile\ContentRoot\WindowsMobile\Traffic\8d0eb6cc51804deba573d2f1b7412a65' is denied." as posted above. I suspect this worked because the Users role contains the built in Authenticated Users role, but I haven't really looked into the "why" of it.
... View more
04-09-2012
08:23 AM
|
0
|
0
|
321
|
POST
|
I've been having some issues getting ArcGIS Mobile 10 (Windows Mobile) set up with secured (token-based) services. I've gotten it to the point where I was able to download a project to device (Juno) and was prompted for credentials for the secure service, accepted and then downloaded the project successfully. The first issue occurs when I try to post updates which fails every time. Don't see anything in the log other than "MobileSync: Post Features Failure." Also, in Mobile Project Center, I am no longer able to save the project to the server (remote). It brings up the login required dialog, which checks the login and just returns to the dialog again. When checked in Fiddler, the following request is sent to the server: http://XXXX.XXXXXXX.com/arcgis/mobile/admin/generateToken?f=json&username=XXXXX&password=XXXXXX&referer=http://www.esri.com/arcgis and "401 - Unauthorized: Access is denied due to invalid credentials." is returned. There's obviously a permissions issue going on here but after many hours, I can't seem to make any progress, and can't find any documentation for using ArcGIS Mobile 10 with secured services (can only find some 9.3 docs which I 'm not sure are current). The ArcGIS server is on a remote EC2 instance if that makes a difference. I've tried running ArcGIS Mobile Project Center directly on the instance but it just freezes up (latest build 2550). So if anyone has any fresh ideas, I'd love to hear them. Thanks,
... View more
03-28-2012
09:33 AM
|
0
|
1
|
3121
|
POST
|
Hello everyone, I am trying to automate replication for ArcSDE and am trying to follow instructions from ESRI webhelp at URL 'http://help.arcgis.com/en/sdk/10.0/vba_desktop/conceptualhelp/index.html#/How_to_create_a_replica/000100000063000000/'. I am consistently getting an error message saying '"The workspace is not connected"'. I tried searching the forum for this error but could not get find anything useful in this regard. I am using C# and ArcGIS Desktop 10. Any helpful insight would be appreciated in this regard. Thanks in advance. // *******Code Snippet************ IGeoDataServer geoDataServer=null; IGeoDataServerInit geoDataServerInit; geoDataServer = new GeoDataServerClass(); geoDataServerInit = (IGeoDataServerInit)geoDataServer; geoDataServerInit.InitFromConnectionString(gdbConnectionString); IReplicationAgent pRepAgent; IGPReplicaOptions2 pReplicaOptions; IGPReplicaDescription pGPReplicaDesc; IGPReplicaDatasets pGPReplicaDatasets; IGPReplicaDatasets pGPReplicaDatasets_Expand; IGPReplicaDataset pGPReplicaDataset; pGPReplicaDesc = new GPReplicaDescriptionClass(); pGPReplicaDatasets = new GPReplicaDatasetsClass(); pGPReplicaDataset = new GPReplicaDatasetClass(); pGPReplicaDataset.DatasetType = esriDatasetType.esriDTFeatureDataset; pGPReplicaDataset.Name = "SampleFeatureDatasetName"; pGPReplicaDatasets.Add(pGPReplicaDataset); pGPReplicaDatasets_Expand = sourceGeoDataServer.ExpandReplicaDatasets(pGPReplicaDatasets); pGPReplicaDesc.ReplicaDatasets = pGPReplicaDatasets_Expand; pGPReplicaDesc.ModelType = esriReplicaModelType.esriModelTypeFullGeodatabase; pGPReplicaDesc.SingleGeneration = (lAccType == esriReplicaAccessType.esriReplicaAccessNone); pGPReplicaDesc.SpatialRelation = esriSpatialRelEnum.esriSpatialRelIndexIntersects; pReplicaOptions = new GPReplicaOptionsClass(); pReplicaOptions.AccessType = lAccType; pReplicaOptions.ChildReconcilePolicy = esriReplicaReconcilePolicyType.esriReplicaResolveConflictsInFavorOfImportedChanges; pReplicaOptions.ParentReconcilePolicy = esriReplicaReconcilePolicyType.esriReplicaResolveConflictsNone; pReplicaOptions.IsChildFirstSender = true; pRepAgent = new ReplicationAgent(); pRepAgent.CreateReplica(versionName, sourceGeoDataServer, targetGeoDataServer, replicaName, pGPReplicaDesc, pReplicaOptions); Any chance you have a raster field in your data? I've set up a 2-way replica through a geodata service (to ArcSDE personal) and synchronized in ArcMap (not programmatically). Everything works fine with adding features and changing attributes until I try to add a photo to a raster field (replica was created fine with some raster fields already populated). Then I get the "Workspace is not connected" error when I try to synchronize with the geodata service. Not sure if this is a bug, something I have set up wrong, or just an unsupported feature in my case. Josh
... View more
12-12-2011
09:45 AM
|
0
|
0
|
1606
|
POST
|
This issue with possible fix seems to be discussed here: http://forums.arcgis.com/threads/26179-where-can-i-get-quot-Editor.as-quot?highlight=aniket That worked! Thanks!
... View more
11-04-2011
06:38 AM
|
0
|
0
|
240
|
POST
|
Steve's post was very helpful and worked great with one extension. However, I'm having trouble with multiple extensions reading and writing from the amp file. With 2 extensions, the first time I load the project (Windows Mobile), ext 1 and ext 2 both call the readXml method and everything's good. However, when closing, only ext 1's WriteXml method gets called. Upon opening the project again, Only ext 1's ReadXml method gets called. However, upon exiting, both extension's WriteXml method gets called, and then when opened again, both ReadXml's get called and so on. However, at this point since the ext 2's WriteXml did not get called on the first close, that extension's settings are lost. This pattern continues if you keep opening and closing the project. Anyone have any idea on what's up with this behavior? Thanks! Josh stephendickinson;121542 wrote: Does this help? It's for a custom extension, but should transfer to a custom task ok. I've included code for the Project Center extension, project extension and shared settings classs. Note: You must serialize out exactly the same settings that are deserialized in, otherwise the AMP file will become unreadable. ...
... View more
11-04-2011
06:36 AM
|
0
|
0
|
281
|
POST
|
I'm having a similar issue working with the flex API editor component. I get the problem when I try to remove the editor component. It appears that the editor adds a mouse up event listener to the map but doesn't clean up after itself when removed, thus causing a null exception when the event listener tries to reference the editor. Anyone know if there's a way to remove the listener manually? Josh
... View more
09-28-2011
08:05 AM
|
0
|
0
|
240
|
POST
|
Has anyone else experienced an issue with zooming on a Bing baselayer with constrained extent behavior applied to the map? When the map is zoomed in via the mouse wheel quickly, the cpu is maxed out and memory allocated to the browser continually rises with no end (and the browser does not respond of course). Removing the behavior solved the issue but would like to use it. Thanks, Josh Clemson University
... View more
07-19-2010
09:17 AM
|
0
|
1
|
458
|
POST
|
The simplest solution is to add a window that's visibility is collapsed initially. Just add a button that changes its visibility property to visible when you need it to "pop up". MyWindow.Visibility = Visibility.Visible; Look at ESRI's DraggableWindow control in the showcase map template - control it with its "isOpen" property (which just controls its visibility) Josh Clemson University
... View more
07-19-2010
09:09 AM
|
0
|
0
|
357
|
Online Status |
Offline
|
Date Last Visited |
03-25-2024
08:33 AM
|