POST
|
This works but there must be a better way. *Esri - your Web Map as JSON in _setPrintParams(a) doesn't pick up rotation. I subclass the EsriPrintTask and insert the rotation in the string-a-fied map json. I probably should insert it with something other than a string replace, but this works for now. var CustomPrintTask = EsriPrintTask.createSubclass({ execute: function (a, b) { internalPrintPrams = this._setPrintParams(a); internalPrintPrams.Web_Map_as_JSON = internalPrintPrams.Web_Map_as_JSON .replace(/mapOptions":{/gi,'mapOptions":{"rotation": -' + a.view.rotation.toString() + ','); return this._geoprocessor["async" === this.mode ? "submitJob" : "execute"](internalPrintPrams, b) .then(this._handleExecuteResponse) } }); me.myPrintTask = new CustomPrintTask(); me.myPrintTask.url = printUrl; me.myPrintTask.mode = "async"; me.myPrintTask.execute(prntPrms).then().otherwise(); How are you guys getting that cool "code" formatting with the line numbers? And, do we really have to obfuscate the SDK? Dang, it makes debugging hard in the late evening.
... View more
04-11-2017
09:59 PM
|
0
|
0
|
347
|
POST
|
Found how to add rotation, but am still getting the corners cut off as in the 4.2 MapView rotation error. I subclass PrintTask and override execute. I insert the rotation into the Web_Map_as_JSON before the submit. var CustomPrintTask = EsriPrintTask.createSubclass({ execute: function (a, b) { internalPrintPrams = this._setPrintParams(a); internalPrintPrams.Web_Map_as_JSON = internalPrintPrams.Web_Map_as_JSON .replace(/mapOptions":{/gi,'mapOptions":{"rotation": -' + a.view.rotation.toString() + ','); return this._geoprocessor["async" === this.mode ? "submitJob" : "execute"](internalPrintPrams, b) .then(this._handleExecuteResponse) } }); me.myPrintTask = new CustomPrintTask(); me.myPrintTask.url = printUrl; me.myPrintTask.mode = "async"; me.myPrintTask.execute(prntPrms).then().otherwise();
... View more
04-11-2017
09:57 PM
|
0
|
0
|
681
|
POST
|
I need to set the rotation on a print task. Anyone know how? I'm about to hack the bloody thing and make the call myself, but there must be a better way. The WebMap JSON is simply missing the Rotate attribute. I just can't seem to intercept it before it chucks it up to my server. Any thoughts are greatly appreciated.
... View more
04-11-2017
01:41 PM
|
0
|
1
|
652
|
POST
|
Adding a comment to bump this to the top of the feed again. Anyone with any thoughts?
... View more
04-11-2017
01:38 PM
|
0
|
0
|
681
|
POST
|
I figured it out for 4.x JS Bin - Collaborative JavaScript Debugging var CustomSymbolRenderer = SimpleRenderer.createSubclass(SimpleRenderer, { getSymbol: function () { var sym = this.inherited(arguments); // Do what you want here to change the symbol sym.color = new Color([Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, .5]); this.set("symbol",sym.clone()); return sym; } }); Then use this Renderer in your FeatureLayer creation var myLayer = new FeatureLayer({url: "myurl", renderer: CustomSymbolRenderer});
... View more
03-31-2017
12:45 AM
|
0
|
0
|
663
|
POST
|
Figured it out. I needed to actually change the symbol. this.set("symbol",sym.clone()); in context: var CustomSymbolRenderer = SimpleRenderer.createSubclass(SimpleRenderer, { getSymbol: function (prm1,prm2) { var sym = this.inherited(arguments); console.log(Math.floor(Math.random() * 255) + 1); sym.color = new Color([ Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, .5]); this.set("symbol",sym.clone()); return sym; } });
... View more
03-31-2017
12:35 AM
|
0
|
0
|
960
|
POST
|
I'm trying to create a custom renderer to handle unique symbology for each feature. In 3.x I did this by intercepting the graphic-add event. I thought I had it but it always returns the 1st symbol. I assume I'm not overriding the proper method. I successfully subclassed the SimpleRenderer, but overriding the GetSymbol method only seems to alter the 1st one, although it get called for each feature. Anyone know what I'm doing wrong? Working/Not working code JS Bin - Collaborative JavaScript Debugging //Key parts: var CustomSymbolRenderer = SimpleRenderer.createSubclass(SimpleRenderer, { getSymbol: function (prm1,prm2) { var sym = this.inherited(arguments); console.log(Math.floor(Math.random() * 255) + 1); sym.color = new Color([ Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, Math.floor(Math.random() * 255) + 1, .5]); return sym; } }); var featureLayer = new FeatureLayer({ url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYCDemographics1/FeatureServer/0" , renderer: new CustomSymbolRenderer({ symbol: new SimpleFillSymbol({ color: "red", outline: {color: [128, 128, 128, 0.5],width: "0.5px"} }) }) }); map.add(featureLayer);
... View more
03-31-2017
12:27 AM
|
0
|
1
|
2043
|
POST
|
>> Are you referring to the layers on the main map being drawn incorrectly at some zoom levels? Yes, exactly. My client can not use ESRI base maps, all data is hosted locally. So I was adding their first layer to the overview map, and boom. Looks like a bug to me as well. Thanks for the reply.
... View more
03-28-2017
01:37 PM
|
0
|
0
|
382
|
POST
|
Adding another reply in a desperate attempt to get some visibility, 47 views, and no ideas so far. Anyone?
... View more
03-28-2017
06:31 AM
|
0
|
0
|
382
|
POST
|
Sorry, The white space is on the edge, not the middle. Same looking issue with 4.2 in the browser.
... View more
03-23-2017
04:17 PM
|
0
|
0
|
681
|
POST
|
Update: I was setting up a JSBin and .... well it worked. [I'm capturing the WebMap as it is transmitted and then taking that to the HTML page and adding rotation.] So it appears to be something with my data. Any thoughts are much appreciated.
... View more
03-23-2017
03:33 PM
|
0
|
0
|
681
|
POST
|
In 3x I used to add a custom renderer and add a mouse-over event handler to it, but I've not been able to figure out how in 4.x yet.
... View more
03-23-2017
03:13 PM
|
0
|
15
|
1185
|
POST
|
We are in the middle of a 3.x to 4.3 port. Got to the Overview Widget and had to roll my own. But it's got issues. Seems if I add a layer to my overview, it messes with my main map. JS Bin - Collaborative JavaScript Debugging The JS Bin as it is now, works. Look for the line: var overviewMap = new Map({ // UNCOMMENT ME // layers: [ovLayer], basemap: "topo" }); and add that layer back in. var overviewMap = new Map({ layers: [ovLayer], basemap: "topo" }); It makes the main map go wonky. Thoughts? I'm out of ideas.
... View more
03-23-2017
02:55 PM
|
0
|
3
|
870
|
POST
|
I had this issue with the JS 3.x sdk's. There was an issue with it not moving newly created features from a feature class up to the print service. I had to copy the features to a graphics layer first, then print. transferRedlineToGraphicsLayer: function() { require(["esri/layers/GraphicsLayer"], function(GraphicsLayer) { me.mapPrintGraphicsLayer = new GraphicsLayer(); wapp.app.map.mainmap.addLayer(me.mapPrintGraphicsLayer); $(wapp.app.mapLayerModule.redLineLayers).each(function(idx) { var curLayer = wapp.app.mapLayerModule.redLineLayers[idx]; $(curLayer.graphics).each(function(gidx) { var curGraphic = curLayer.graphics[gidx]; me.mapPrintGraphicsLayer.add(curGraphic); }); // for each graphic curLayer.visible = false; }); // for each layer }); // Require },
... View more
03-23-2017
10:57 AM
|
0
|
0
|
2920
|
POST
|
I'm using "esri/tasks/support/PrintTemplate", "esri/tasks/support/PrintParameters", and "esri/tasks/PrintTask" to hit an ArcGis Server 10.4.1 Print service and everything is great until I rotate the map. 1) How do I add rotation to the webMap that the Print Task builds? 2) When I add the rotation to the WebMap Json and make the call with the HTML interface on ArcGis Server, it cuts off the outer edges at the corners. If I point it due north - everything is fine. I'm trying to get a screen shot and a JS fiddle but my data is sensitive and I need to find a different data src first. The white line is Very reminiscent of the rotation bug introduced in 4.2 and fixed in 4.3 but on the server side. The white seems to be where the due north boundaries would be. Thanks in advance.
... View more
03-23-2017
10:48 AM
|
0
|
4
|
1420
|
Title | Kudos | Posted |
---|---|---|
1 | 05-12-2014 01:47 PM | |
1 | 06-22-2017 08:13 AM | |
1 | 02-12-2018 09:03 AM | |
1 | 01-28-2016 03:55 PM | |
1 | 01-26-2018 07:32 AM |
Online Status |
Offline
|
Date Last Visited |
Thursday
|