|
POST
|
As Rene pointed out, it should be hitched. The reason you are seeing that this.map is still available is probably you have map as a global variable defined in your application.
... View more
12-19-2013
11:09 AM
|
0
|
0
|
608
|
|
POST
|
Robert, Here is a simplest sample which works on my side. custom layer, which inherits from ArcGISImageServiceLayer but do nothing. define( [ "dojo/_base/declare", "esri/layers/ArcGISImageServiceLayer" ], function( declare, ArcGISImageServiceLayer ) { var MyImageServiceLayer = declare([ArcGISImageServiceLayer], { declaredClass: "esri.layers.ArcGISImageServiceLayer" }); return MyImageServiceLayer; }); Test page: var map, layer; require(["esri/map", "esri/layers/MyImageServiceLayer", "esri/dijit/Print", "dojo/domReady!"], function (Map, MyImageServiceLayer, Print) { esri.config.defaults.io.proxyUrl = "/proxy.ashx";//use your own proxy instead of this. map = new Map("map", { basemap: "gray", center: [-80.85, 35.22], zoom: 14 }); var print = new Print({ map: map, url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" }, "print"); print.startup(); layer = new MyImageServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/CharlotteLAS/ImageServer"); map.addLayer(layer); layer.on("load", function () { layer.renderingRule = { "rasterFunction": "RFTShadedReliefElevationColorRamp" }; layer.renderingRule.toJson = function () { return { "rasterFunction": "RFTShadedReliefElevationColorRamp" }; }; layer.setRenderingRule(layer.renderingRule); }); });
... View more
12-19-2013
08:35 AM
|
0
|
0
|
2086
|
|
POST
|
topo map service is only for creating tiled map layer. What you are looking for is elevation profile service, which is a GP service. This is an old sample service: http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/ProfileService I'm not sure about the latest one. Please ask the question on AcGIS REST API forum.
... View more
12-19-2013
08:13 AM
|
0
|
0
|
2267
|
|
POST
|
I looked at the source code. PrintTask doesn't work with any custom layer. Because it checks the property layer.declaredClass to decide what to serialize into the json output. In your case, only when layer.declaredClass === "esri.layers.ArcGISImagerServiceLayer", it will serialize renderingRule. Is your custom layer written in AMD style or legacy style? You can try to override .declaredClass property as "esri.layers.ArcGISImagerServiceLayer". It shouldn't cause any conflicts.
... View more
12-18-2013
03:40 PM
|
0
|
0
|
569
|
|
POST
|
Can you post the web map json sent to print service?
... View more
12-17-2013
01:44 PM
|
0
|
0
|
1517
|
|
POST
|
Cannot reproduce the issue. I tried exact same polygon you had: var polygon = new esri.geometry.Polygon({"type":"polygon","rings":[[[2343355.197916185,6843378.9380211625],[2343591.077808191,6843221.286650303],[2343284.7325307247,6843149.029771992],[2343355.197916185,6843378.9380211625]]],"_ring":0,"spatialReference":{"wkid":102100},"_centroid":null,"_extent":{"xmin":2343284.7325307247,"ymin":6843149.029771992,"xmax":2343591.077808191,"ymax":6843378.9380211625,"spatialReference":{"wkid":102100}},"_partwise":null}); polygon.isSelfIntersecting();//returns false; I noticed you missed the parentheses at the end of the function isSelfIntersecting(), which means it checks if the function exists or not. If so, it returns the code of the function.
... View more
12-17-2013
01:20 PM
|
0
|
0
|
1228
|
|
POST
|
Please take a look at the code snippet:
map.on("layers-add-result", initEditor);
function iniEditor(results){
//the same code as you already have to build layerInfos in settings.
var editor = new new esri.dijit.editing.Editor(params,'editorDiv');
editor.startup();
//when a layer is removed from the map, recreate the editor widget
map.on("layer-remove", dojo.hitch(null, recreateEditor, editor));
}
function recreateEditor(editor){
editor.destroy();
editor = new new esri.dijit.editing.Editor(params,'editorDiv');
editor.startup();
}
... View more
12-16-2013
12:48 PM
|
0
|
0
|
257
|
|
POST
|
To answer the question how to get the reference of editor object in another function. You can: 1. declare editor as a global variable, which is not recommended in most cases since it may cause conflicts. 2. use dojo.hitch to pass extra arguments to the callback function. Read the doc: https://dojotoolkit.org/reference-guide/1.7/dojo/hitch.html#providing-arguments
... View more
12-13-2013
02:19 PM
|
0
|
0
|
1146
|
|
POST
|
I tested a simple case and print task works fine with renderingRule. This is how the JSON looks like:
{
"mapOptions": {
"showAttribution": true,
"extent": {
"xmin": -9002667.410873475,
"ymin": 4193183.580948897,
"xmax": -8996552.448610498,
"ymax": 4195815.881110537,
"spatialReference": {
"wkid": 102100
}
},
"spatialReference": {
"wkid": 102100
},
"scale": 18055.954822005082
},
"operationalLayers": [
{
"id": "layer0",
"title": "layer0",
"opacity": 1,
"minScale": 591657527.591555,
"maxScale": 9027.977411,
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"
},
{
"id": "layer2",
"title": "layer2",
"opacity": 1,
"minScale": 0,
"maxScale": 0,
"url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/CharlotteLAS/ImageServer",
"bandIds": null,
"compressionQuality": null,
"interpolation": null,
"renderingRule": {
"rasterFunction": "RFTShadedReliefElevationColorRamp"
}
},
{
"id": "layer1",
"title": "layer1",
"opacity": 1,
"minScale": 591657527.591555,
"maxScale": 9027.977411,
"url": "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer"
},
{
"id": "map_graphics",
"minScale": 0,
"maxScale": 0,
"featureCollection": {
"layers": []
}
}
],
"exportOptions": {
"outputSize": [
800,
1100
],
"dpi": 96
}
}
... View more
12-13-2013
02:11 PM
|
0
|
0
|
1517
|
|
POST
|
PrintTask includes renderingRule if that property exists in your layer. Please check yourCustomImageServiceLayer.renderingRule is there, and yourCustomImageServiceLayer.renderingRule.toJson() is a valid function.
... View more
12-11-2013
03:10 PM
|
0
|
0
|
1517
|
|
POST
|
Recreating it brings it back. editorWidget = new esri.dijit.editing.Editor(params); editorWidget.startup();
... View more
12-03-2013
07:28 PM
|
0
|
0
|
1840
|
|
POST
|
After you call editor.destroy();, you can recreate it by editor = new Editor(params, 'editorDiv'); just make sure params.settings.layerInfos exclude the layer that you removed from the map.
... View more
12-03-2013
03:57 PM
|
0
|
0
|
1146
|
|
POST
|
Great job, Ben. Just a note, you can always call graphic.getNode() to get the raw DOM element, which could be SVG or canvas depending on browsers. Calling getDojoShape() is a good idea since dojo is doing a great job to eliminate the discrepancies among browsers. I totally agree with you, explore GFX and take advantage of it whenever you can. Manipulating DOM element directly is very hard and error-prone.
... View more
11-25-2013
08:02 PM
|
0
|
0
|
910
|
|
POST
|
First of all, since JS API 3.4 (cannot remember the exact version number), you don't have to wait for map onload to create an editor widget. You can call new Editor(); right after var map = new Map(); Secondly, editor widget doesn't provide a method setLayerInfos() to allow you to dynamically change the editing layers. What you need to do is to destroy the editor widget and recreate it every time user select a new item in the dropdown. Hope this helps.
... View more
11-25-2013
02:06 PM
|
0
|
0
|
1146
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 06-21-2013 01:17 PM | |
| 3 | 07-15-2013 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|