POST
|
Thanks for the reply. Can you elaborate on what is meant by "This let's the API know to load the workers from the CDN, because they cannot currently be built with webpack and I don't see that being done in that app..."
... View more
11-12-2019
01:01 PM
|
0
|
2
|
2071
|
POST
|
I've come across an error which I am not quite sure how to diagnose. I have an Angular 7 application which uses the ArcGIS JS API and the arcgis-webpack-plugin, configured similarly to this sample app: GitHub - Esri/angular-cli-esri-map at arcgis-webpack-angular I need to use some components of the dojo framework directly, importing them like this: import * as dojo from 'dojo/dojo';
import * as domProp from 'dojo/dom-prop'; However, I'm receiving this error at run time (the app does build without error): DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'localhost:4200/dojo/arcgis-js-api/views/2d/layers/features/Pipeline.js' failed to load. The error is straightforward - the script at '/dojo/arcgis-js-api/views/2d/layers/features/Pipeline.js' fails to load because it does not exist. But I was wondering if anyone can shed some light on this and help me understand what would cause an app to look in the 'dojo' API files for an ArcGIS JS API file. File '/arcgis-js-api/views/2d/layers/features/Pipeline.js' does exist, I'm just not sure what uses Pipeline.js as that is not something I directly reference or import, and why the app looks inside the dojo API for that file.
... View more
11-06-2019
12:40 PM
|
0
|
6
|
2940
|
POST
|
Thanks, this seems like the best way to go about it. I will experiment with the ArcGIS Webpack plugin and see if this will allow me to use another library to mock out the API classes.
... View more
10-16-2019
02:23 PM
|
0
|
0
|
3664
|
POST
|
Some more info: I'm building an Angular 7 application using the esri-loader and I'm really struggling with trying figure out the best way to mock ArcGIS JS API dependencies in my tests. I have come across very little sample code for applications built with frameworks other than dojo that use the ArcGIS JS API and also contain meaningful unit tests. Is anyone out there doing this successfully and able to provide some guidance? For example, say I have a MapComponent class that looks like this: export class MapComponent {
mapView: MapView;
public async initializeMap(lat: number, lon: number, zoom: number) {
const [Map, MapView] = await loadModules(['esri/Map', 'esri/views/MapView']);
this.mapView = new MapView({
zoom: zoom,
center: [lat, lon]
map: new Map({
basemap: 'streets'
})
});
}
public async addPointToMap(lat: number, lon: number) {
const [Graphic] = await loadModules(['esri/Graphic']);
const point = {
type: "point",
longitude: lon,
latitude: lat
};
const markerSymbol = {
type: "simple-marker",
color: [226, 119, 40],
outline: {
color: [255, 255, 255],
width: 2
}
};
const pointGraphic = new Graphic({
geometry: point,
symbol: markerSymbol
});
this.mapView.graphics.add(pointGraphic);
}
} I want to test the initializeMap() and addPointToMap() functions, but what is the best way to do this without actually making an http request to get the required API modules and creating concrete instances of each class I need? A test class might look like this: describe('MapComponent', () => {
let fixture: ComponentFixture<MapComponent>;
let component;
beforeEach(async () => {
TestBed.configureTestingModule({
declarations: [MapComponent],
}).compileComponents();
fixture = TestBed.createComponent(MapComponent);
component = fixture.debugElement.componentInstance;
});
it('should initialize map', async () => {
// calling this function will fetch the ArcGIS JS API dependencies
// and create concrete instances of Map and MapView objects - need
// to mock these
await component.initializeMap();
expect(component.mapService.mapView).toBeTruthy();
});
it('should add a point to the map', async () => {
await component.addPointToMap(32.7, -117.1);
// assert point is created in component.mapService.mapView object
});
}); As mentioned above, I'm really struggling with how to mock out ArcGIS JS API classes. When testing my own code, I would implement a class from some interface and use DI to assist with testing, but I'm not seeing how I can test the ArcGIS API classes. Help me interwebs, you're my only hope...
... View more
10-08-2019
04:48 PM
|
1
|
5
|
4441
|
POST
|
I came across the "Pre-Summit Hands-On Training" am I'm wondering if I'm able to register for just one of these sessions if I'm not attending the actual dev summit. https://www.esri.com/en-us/about/events/devsummit/agenda/pre-summit-hands-on-training I'm not able to attend the regular summit, but I would be able to attend one of the pre-summit sessions on Sunday and/or Monday if that is possible.
... View more
01-31-2019
03:08 PM
|
1
|
3
|
1450
|
POST
|
Thanks so much! I currently have a support ticket open regarding this but I will give your soltuion a try and see if that resolves the issue.
... View more
01-10-2018
12:54 PM
|
0
|
0
|
1640
|
POST
|
Bumping this up again... Or maybe I'm the only one here uses anything outside of AGOL/Dojo?
... View more
01-08-2018
01:40 PM
|
0
|
0
|
338
|
POST
|
I'm wondering if you can you confirm or deny my theory: when selecting a mapped or local drive in the Catalog, ArcGIS Pro is enumerating the entire contents, killing performance, and displaying this thing for 5 minutes before I can proceed to navigate the folder structure. One explanation I received from an Esri representative on this issue was that disallowing connections to a drive root was for performance reasons. The .NET Framework and Windows APIs (upon which ArcGIS Pro is built) provide FAST access to files and folders, what's going on here?
... View more
01-05-2018
11:24 AM
|
2
|
1
|
1759
|
POST
|
In addition to Dojo, I'm wondering what libraries and frameworks everyone out there in AGOL land are using. My team builds custom applications using ASP.NET MVC and the ArcGIS Online JavaScript API. We also use a couple other popular libraries like jQuery and Bootstrap. I've also been experimenting with incorporating Knockout.js. I've seen a few posts on GeoNet and elsewhere about people also leveraging additional libraries and frameworks in their AGOL/Dojo applications such as React and Angular. So my question to GeoNet is: in addition to AGOL JS API/Dojo, what libraries and frameworks do you like to use in your applications?
... View more
01-03-2018
09:15 AM
|
0
|
1
|
691
|
POST
|
I'm attempting to insert some records into my feature service using the applyEdits() method, however I'm receiving an error message because I'm not sure how to include data for a field in the feature service table that is of type 'esriFieldTypeDate'. Here is some quick sample code - I have an object that contains my feature to be inserted: var newFeature = {
"geometry": {
"x": -97.2736,
"y": 32.8164
},
"attributes": {
"SiteID": 999,
"Name": "Test Site 1",
"LeaseSigned": "12/1/2016, 9:00 AM"
},
"spatialReference": {
"wkid": "102100"
}
};
var features = [];
features.push(newFeature); I also have an object that contains the input params for applyEdits(): var params= {
f: 'json',
adds: JSON.stringify(features),
updates: "",
deletes: "",
gdbVersion: "",
rollbackOnFailure: true,
useGlobalIds: false,
attachments: ""
}; However, I am receiving this error because I'm not sure how to format the input data for esriFieldTypeDate: {
"error":{
"code": 400,
"message":"Unable to complete operation.",
"details":["Setting of value for LeaseSigned failed."]
}
} Does anybody know how to format the date time field correctly or can point me in the direction of some examples? I've tried all different types of date formats but can't seem to figure this out. Thanks!
... View more
11-28-2017
05:46 PM
|
0
|
2
|
1437
|
POST
|
Here is the request header: GET /proxy/proxy.ashx?https://demographics7.arcgis.com/arcgis/rest/services/USA_Demographics_and_Boundaries_2017/MapServer/2?f=json&callback=dojo.io.script.jsonp_dojoIoScript5._jsonpCallback HTTP/1.1
Host: myproxyserver.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Accept: */*
Referer: https://localhost/my_application
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.8
Cookie: [removed]
And here is the response header: HTTP/1.1 200 OK
Cache-Control: max-age=0,must-revalidate
Content-Type: text/plain;charset=utf-8
ETag: 6dfb1ba3
Vary: Origin
Server: Microsoft-IIS/8.5
Set-Cookie: AGS_ROLES="nGGHe9fnJdtqgrxv/F457aPODB3PII6+MSSUUbBUPUTFqmHBA0KbNNNKphQAiCnKG1HjLTBjpl0/sBdgKzNqdPYLY75CroUOHRS1I8+SG87wUFamgBZb7OKBemucaf3O/3MbDnjgy1VS02jMPpD3O9QK2LrPN/lN8P5gvUvHjB8FY19FcRB9SKLYwGievzdwfKT9kJyRGaUPfWHpL1SMJ+n9Pn+xGBREr+oTFHXazQBaD59XcKRqRpTvrB5bnIWcmGy6+jpfv11KySMB1lEO6I6ZOPEy8yCxyQJvB6Ebot8="; Version=1; Max-Age=60; Expires=Mon, 16-Oct-2017 16:21:41 GMT; Path=/arcgis/rest; HttpOnly
Server:
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Access-Control-Allow-Origin: *
Date: Mon, 16 Oct 2017 16:20:39 GMT
Content-Length: 239728 And here is a link to the body of the request - it's huge! https://pastebin.com/Zq0LAm8i I'm only specifying these layers, so I'm not sure why it's making such a huge request: outFields: ["NAME", "EMP_CY", "INDMANU_CY", "MEDHINC_CY", "OCCTRAN_CY", "POPDENS_CY", "POPGRWCYFY", "TOTHH_CY", "UNEMP_CY", "CIVLBFR_CY", "UNEMPRT_CY"]
... View more
10-16-2017
09:34 AM
|
0
|
1
|
2328
|
POST
|
Upon further inspection, I can see that layers I have set to visible = false are still being loaded as a resource, and some like the Esri demographic layer are taking 2+ seconds to load. Without knowing a whole lot about the JS API, I would say that based on what I see, setting the visible property to false doesn't actually do anything to lazy load or otherwise reduce the time needed to load a feature layer resource.
... View more
10-16-2017
09:06 AM
|
0
|
3
|
2331
|
POST
|
Thanks for the reply, I had a suspicion that setting the "visible" property to false was already doing what I was attempting to accomplish. I had been tasked with making sure all the application resources are loaded efficiently, and was asked to explore if there's any improvement/benefit of attempting to lazy (or partially) load a feature layer, delaying any heavy lifting until after the user clicks the layer on/off checkbox. But it appears that is already the case, so no need for me to reinvent the wheel here!
... View more
10-16-2017
07:52 AM
|
1
|
5
|
2331
|
Title | Kudos | Posted |
---|---|---|
1 | 02-21-2023 12:26 PM | |
1 | 11-04-2020 02:31 PM | |
5 | 10-11-2022 03:59 PM | |
1 | 10-08-2019 04:48 PM | |
1 | 12-03-2020 02:50 PM |
Online Status |
Offline
|
Date Last Visited |
01-15-2024
03:01 PM
|