POST
|
I have a 3D sceneView application that uses a work-around print function that creates a 2D map in the background from the same 'map' as the sceneView, and prints from that. This post explains the process: here. After switching to 4.6, having any feature layers or mapService layers turned to 'visible' in the sceneview, and thus the map view, causes the execute print task to fail. It doesn't throw any error in the console, just the error callback function. If I revert back to 4.5, with no changes in the code, it works perfectly. Just wanted to throw this out there if anyone else has noticed issues around printing in 4.6. Cheers
... View more
01-03-2018
01:59 PM
|
0
|
1
|
417
|
POST
|
Thanks for replying Robert. The Jsbin I made uses autocasting because I grabbed it from some of ESRI's code samples, but I'm not actually using autocasting in my application. I create a true polyline and it still doesnt work. If I revert back to 4.5 it works fine, with no changes to the code, so it is definitely a 4.6 problem. the insertPoint() function just does not seem to be working from what I can tell. There are a couple of other problems I've noticed since switching to 4.6 too, so I'll be sticking with 4.5 until I can find a solution. Cheers
... View more
01-03-2018
10:35 AM
|
0
|
0
|
3128
|
POST
|
I have a bit of code in a 3D SceneView for a draw-line tool that has worked fine until the 4.6 release. It basically grabs the map point when the user clicks on the map, and creates a line starting at that point, and adds each subsequently clicked point to the 'paths' property of the line until the user double clicks to end the process. The line is added to the map as a graphic. After 4.6, however, I can't get the polyline.insertPoint() function to work, or any of the polyline functions for that matter. I threw together a jsbin that illustrates a similar problem: here. You have to open dev tools to see the results. I used the getPoint() function to keep it a bit simpler, but it throws an error that line.getPoint() is not a function (getPoint() documentation). tldr: polyline.insertPoint(path index, point index, point) is not adding anything to the 'paths' property of the line I pass in Any ideas whats going on here? Am I missing something? Any help is much appreciated. Cheers
... View more
01-02-2018
02:41 PM
|
0
|
4
|
3799
|
POST
|
Im trying to refresh an ArcServer token in the JS API, but can't seem to figure it out. This gist is: I want to refresh the server token every hour automatically without requiring more input from the user while within the same session (ie. the user hasn't closed the browser window). Right now I get the token with a basic POST request to the server and then register that token with the ID manager like this: IdentityManager.registerToken({
server: "//exampleUrl/server/rest/services/",
token: localStorage.getItem('token')
}); That's it and it works just fine, but when the token expires in an hour (which we want), I don't have a way to simply refresh the token. Since I'm not storing the password like I am the username, I can't simply fire the POST request again to generate a new token. I've looked at creating a credential object which has a refreshToken() method, but can't get it to work, and to be honest I don't fully understand the credential class as it relates to the ID manager, serverInfos, and authentication in general. I tried replacing the above code to register the token with ID manager with the following code with no success: var serverInfo = new ServerInfo();
serverInfo.server = "//exampleUrl/server1";
serverInfo.tokenServiceUrl = "exmapleUrl/rest/generateToken";
let idObject = {serverInfos: [serverInfo]};
let credential = {
server: "exampleUrl/server1/",
ssl: true,
token: localStorage.getItem("token"),
userId: localStorage.getItem("username")
}
idObject.credentials = [credential];
IdentityManager.initialize(idObject); (used this as a guide, but I'm not sure Jeff Pace was using the 4.x API) Does anyone have any examples of using the refreshToken() method, or any insight into the best way to accomplish an automatic token refresh within the API?
... View more
12-11-2017
11:48 AM
|
1
|
1
|
2015
|
POST
|
Just a quick update: The above method of setting view.extent = view.extent has been unreliable for me, so I'm using Robert's suggested method now as well. Cheers
... View more
11-13-2017
03:20 PM
|
1
|
0
|
1384
|
POST
|
Update: solved! (right after i post about it of course) This works: view.whenLayerView(imageryLayer).then(function(layerView) {
watchUtils.watch(layerView, "updating", function(newVal) {
// code to fire
});
});
... View more
11-09-2017
04:00 PM
|
0
|
0
|
434
|
POST
|
I am having trouble finding an event to watch for to tell if an imagery layer is drawn/rendered in the view. I am programmatically updating the definition expression/mosaic rule where clause of an imagery layer to allow the user to toggle individual rasters on/off within an image service that includes 100+ rasters. The toggle works alright, but the toggle on from an off state takes 10+ seconds sometimes, so I want to add a spinner to let the user know the raster is drawing. My problem is that I can't figure out what to hook up the 'hide-spinner' event to. I have tried watching the imageryLayer.loaded property, but this becomes true immediately after the toggle is clicked but before the imagery layer actually becomes visible in the view. Similarly, all of the imageryLayer's properties related to its loading (loaded, loadStatus, etc.) fire in the same way. I have tried watching the view and layerview's 'updating' property as well, but to no avail. Any ideas? Thanks
... View more
11-09-2017
03:17 PM
|
0
|
1
|
556
|
POST
|
I was having a similar problem and fixed it like this: view.extent = view.extent; Robert's solution definitely works too, but just wanted to share this if anyone else is having this issue. Cheers
... View more
11-06-2017
01:20 PM
|
1
|
1
|
1384
|
POST
|
Setting the export format to 'jpg' does not fix the problem, so I think it probably has to do with the fill symbol. Thanks for you help though.
... View more
09-25-2017
01:08 PM
|
0
|
0
|
2042
|
POST
|
Thanks for the reply Saroj, That thread only seems to address a fix for the page layout size problem, and not the problem noted as: "The problem [that] also occurs with the legend patches of feature service layers and client side graphic layers when a picture marker or fill symbol is used." Do you know if getting into the server and setting a larger page size for the print export is supposed to fix this problem as well?
... View more
09-25-2017
12:10 PM
|
1
|
2
|
2042
|
POST
|
Any luck with a solution or workaround for this problem? Just noticed the exact same problem with my print legend, although I'm not sure how the service is being published (whether or not its fill is 'No Color').
... View more
09-25-2017
11:48 AM
|
1
|
0
|
2042
|
POST
|
I noticed a problem with the calculated centroid of a polygon graphic when you draw a very small polygon. I am trying to add a text graphic to the center of a polygon graphic by grabbing the centroid of the polygon when drawing is complete and creating a simple text symbol with the centroid geometry. The polygonGraphic.geometry.centroid.x (and y) property works perfectly when the polygons cover multiple acres, but the smaller they get, the farther outside the polygon the text labels appear. I put together an example of the problem for reference here: JS Bin - Collaborative JavaScript Debugging *note: you must draw polygons in the clockwise direction* I've also attached a screen grab of the problem. If you zoom in a lot and draw a polygon that is 0 acres, you should notice that the text showing its area is drawn far outside the bounds of the polygon. As far as I can tell this is not a spatial reference issue. The only fix I've found it to use the polygonGraphic.geometry.extent.center.x property instead of the centroid, which works but is not ideal. I know this is kind of a niche problem, but any insight would be much appreciated. Thanks
... View more
09-22-2017
03:17 PM
|
1
|
0
|
467
|
POST
|
This is interesting. It's different from the behavior I was seeing but I agree that they could be related. In my experience, the labels were drawing right on the ground, and not allowing any sort of vertical offset. I tried adding the vertical offset and callout properties from RNicola-esristaff's snippet into yours, and the feature layer doesn't fully draw and the labels won't appear at all.
... View more
08-02-2017
08:58 AM
|
0
|
0
|
3666
|
POST
|
I was able to reproduce the behavior from your snippet by tilting the camera angle down so that the view is more oblique and the sky takes up about half of the view. Then I zoomed in on the 'Colorado' label and after a certain point it flickers a little and then disappears for all larger scales. I was able to reproduce it on the 'Wyoming' and 'Montana' labels too, but the 'Utah' label seems to be fine no matter what scale you zoom to, just like my original problem where the flickering/disappearing only happened on some polygons.
... View more
08-02-2017
08:42 AM
|
0
|
0
|
3666
|
POST
|
I resolved this problem by creating another feature layer from the centroid of the polygons I already had, and tying the labels to that points feature layer instead. The flickering/ disappearing problem is gone and I got the vertical offset property to work with callouts, but as far as I can tell, you do need callouts in order to use the vertical offset property. I'm not 100% sure about that, but my vertical offset only took effect once I had a working callout.
... View more
07-27-2017
02:00 PM
|
0
|
0
|
3666
|
Title | Kudos | Posted |
---|---|---|
1 | 12-11-2017 11:48 AM | |
1 | 11-13-2017 03:20 PM | |
1 | 11-06-2017 01:20 PM | |
1 | 09-25-2017 12:10 PM | |
1 | 09-25-2017 11:48 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|