IDEA
|
If you are using a GPService to access your images, you could encode them in base64, so it will be passed as strings through the REST API.
... View more
06-07-2017
06:31 AM
|
0
|
0
|
670
|
POST
|
Hi, I wonder if there is a way (maybe using a REST service) to get a list of all tokens that were created and that are still valid (not expired) with the user info attach to each token? I am using ArcGIS Server 10.3 and this list would be useful to know who is have been using the securised services lately. Thank you Maxime
... View more
04-24-2017
10:31 AM
|
0
|
1
|
827
|
POST
|
Thank you for your help Thomas. I have already tried this workaround. It could works only if you don't use definitionExpression on the subLayers, what I do. The features in subLayers that are invisible by the action of the definitionExpression are queried anyway by the IdentifyTask(). I don't think there is a workaround that will cover every possibilities...
... View more
03-30-2017
09:45 AM
|
0
|
0
|
664
|
POST
|
According to me, the layerIds property refer to the subLayers ids (see for instance MapImageLayer.subLayers in the documentation.) When you instantiate an IdentifyTask(), you give the url of the layer that would be queried by the tool. So, layerIds is not related to every layers in the map, only the subLayers of the layer you have initiate the IdentifyTask with. How is possible that no one have ever encountered this bug before? I can't believe it. I think it would be trivial to fix it, but how long shall we wait for the fix?
... View more
03-30-2017
09:18 AM
|
0
|
5
|
1255
|
POST
|
Imagine you have more than one layer that you want to use with the IdentifyTask, for instance subLayers in a MapImageLayer, you wont be able to use such workaround. It seems to be a bug in the API right?
... View more
03-30-2017
08:31 AM
|
0
|
8
|
1255
|
POST
|
Doing that, it wont work when the layer is visible...
... View more
03-30-2017
08:19 AM
|
0
|
10
|
1255
|
POST
|
Thats not what the doc says about the layerOption "top" paramerer: Only the top-most VISIBLE layer is identified. Anyway setting the layerOption to "visible" does not make any difference. You can try directly in the sample code sandbox
... View more
03-30-2017
08:08 AM
|
0
|
12
|
1255
|
POST
|
Hi! Is it normal that the IdentifyTask returns features even if the layer is not visible? I see in the documentation that the layerOption parameter in the IdentifyParameters should define if the IdentifyTask will return feature for visibile layer only. However, this parameter seem not working. The popup is displayed even if the layer is not visible as shown below. The image and code below are taken from the documentation sample codes <script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/TileLayer",
"esri/tasks/IdentifyTask",
"esri/tasks/support/IdentifyParameters",
"dojo/_base/array",
"dojo/on",
"dojo/dom",
"dojo/domReady!"
], function(
Map, MapView, TileLayer,
IdentifyTask, IdentifyParameters,
arrayUtils, on, dom
) {
var identifyTask, params;
// URL to the map service where the identify will be performed
var soilURL =
"https://services.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer";
// Add the map service as a TileLayer for fast rendering
// Tile layers are composed of non-interactive images. For that reason we'll
// use IdentifyTask to query the service to add interactivity to the app
var parcelsLyr = new TileLayer({
url: soilURL,
opacity: 0.85,
visible: false
});
var map = new Map({
basemap: "osm"
});
map.add(parcelsLyr);
var view = new MapView({
map: map,
container: "viewDiv",
center: [-120.174, 47.255],
zoom: 7
});
view.then(function() {
// executeIdentifyTask() is called each time the view is clicked
on(view, "click", executeIdentifyTask);
// Create identify task for the specified map service
identifyTask = new IdentifyTask(soilURL);
// Set the parameters for the Identify
params = new IdentifyParameters();
params.tolerance = 3;
params.layerIds = [0, 1, 2];
params.layerOption = "top";
params.width = view.width;
params.height = view.height;
});
// Executes each time the view is clicked
function executeIdentifyTask(event) {
// Set the geometry to the location of the view click
params.geometry = event.mapPoint;
params.mapExtent = view.extent;
dom.byId("viewDiv").style.cursor = "wait";
// This function returns a promise that resolves to an array of features
// A custom popupTemplate is set for each feature based on the layer it
// originates from
identifyTask.execute(params).then(function(response) {
var results = response.results;
return arrayUtils.map(results, function(result) {
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = layerName;
if (layerName === 'Soil Survey Geographic') {
feature.popupTemplate = { // autocasts as new PopupTemplate()
title: "{Map Unit Name}",
content: "<b>Dominant order:</b> {Dominant Order} ({Dom. Cond. Order %}%)" +
"<br><b>Dominant sub-order:</b> {Dominant Sub-Order} ({Dom. Cond. Suborder %}%)" +
"<br><b>Dominant Drainage Class:</b> {Dom. Cond. Drainage Class} ({Dom. Cond. Drainage Class %}%)" +
"<br><b>Farmland Class:</b> {Farmland Class}"
};
}
else if (layerName === 'State Soil Geographic') {
feature.popupTemplate = { // autocasts as new PopupTemplate()
title: "{Map Unit Name}",
content: "<b>Dominant order:</b> {Dominant Order} ({Dominant %}%)" +
"<br><b>Dominant sub-order:</b> {Dominant Sub-Order} ({Dominant Sub-Order %}%)"
};
}
else if (layerName === 'Global Soil Regions') {
feature.popupTemplate = { // autocasts as new PopupTemplate()
title: layerName,
content: "<b>Dominant order:</b> {Dominant Order}" +
"<br><b>Dominant sub-order:</b> {Dominant Sub-Order}"
};
}
return feature;
});
}).then(showPopup); // Send the array of features to showPopup()
// Shows the results of the Identify in a popup once the promise is resolved
function showPopup(response) {
if (response.length > 0) {
view.popup.open({
features: response,
location: event.mapPoint
});
}
dom.byId("viewDiv").style.cursor = "auto";
}
}
});
</script>
... View more
03-30-2017
05:43 AM
|
0
|
15
|
3735
|
POST
|
Thank you again for your help (second time today!). I did not know every esri classes had the createSubclass method. This method is not described in the WebTileLayer documentation: WebTileLayer | API Reference | ArcGIS API for JavaScript 4.3 I suppose it inherited the createSubclass method from the Accessor class, but even in the Accessor documentation this method is not described Accessor | API Reference | ArcGIS API for JavaScript 4.3 Thanks again, Maxime
... View more
03-24-2017
06:51 AM
|
0
|
1
|
1258
|
POST
|
Thank you for your answer. I have an irrelevant question for you. How do you format code block like that? I can't find this option in the menu...
... View more
03-24-2017
05:59 AM
|
0
|
0
|
1266
|
POST
|
Hi, I am trying to create a custom subclass inherited from the WebTileLayer class using esri/core/Accessor. I was following the doc from here: Accessor | API Reference | ArcGIS API for JavaScript 4.3 My custom class module is the following: define(
["esri/layers/WebTileLayer", "esri/geometry/SpatialReference", "esri/geometry/Extent", "esri/layers/support/TileInfo"],
function(WebTileLayer, SpatialReference, Extent, TileInfo) {
return WebTileLayer.createSubclass({
constructor: function(urlTemplate) {
this.urlTemplate = urlTemplate;
this.spatialReference = new SpatialReference({ wkid: 3857 });
this.initialExtent = (this.fullExtent = new Extent(-20037508.34787, -20037508.34278, 20037508.34278, 20037508.34787, this.spatialReference));
this.tileInfo = new TileInfo({
"size": 256,
"dpi": 96,
"format": "PNG",
"compressionQuality": 0,
"origin": { "x": -20037508.342787, "y": 20037508.342787 },
"spatialReference": {
"wkid": 3857
},
"lods": [
{ "level": 0, "resolution": 156543.033928, "scale": 591657527.591555 },
{ "level": 1, "resolution": 78271.5169639999, "scale": 295828763.795777 },
{ "level": 2, "resolution": 39135.7584820001, "scale": 147914381.897889 },
{ "level": 3, "resolution": 19567.8792409999, "scale": 73957190.948944 },
{ "level": 4, "resolution": 9783.93962049996, "scale": 36978595.474472 },
{ "level": 5, "resolution": 4891.96981024998, "scale": 18489297.737236 },
{ "level": 6, "resolution": 2445.98490512499, "scale": 9244648.868618 },
{ "level": 7, "resolution": 1222.99245256249, "scale": 4622324.434309 },
{ "level": 8, "resolution": 611.49622628138, "scale": 2311162.217155 },
{ "level": 9, "resolution": 305.748113140558, "scale": 1155581.108577 },
{ "level": 10, "resolution": 152.874056570411, "scale": 577790.554289 },
{ "level": 11, "resolution": 76.4370282850732, "scale": 288895.277144 },
{ "level": 12, "resolution": 38.2185141425366, "scale": 144447.638572 },
{ "level": 13, "resolution": 19.1092570712683, "scale": 72223.819286 },
{ "level": 14, "resolution": 9.55462853563415, "scale": 36111.909643 },
{ "level": 15, "resolution": 4.77731426794937, "scale": 18055.954822 },
{ "level": 16, "resolution": 2.38865713397468, "scale": 9027.977411 },
{ "level": 17, "resolution": 1.19432856685505, "scale": 4513.988705 },
{ "level": 18, "resolution": 0.597164283559817, "scale": 2256.994353 },
{ "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
]
});
this.load(this);
},
getTileUrl: function(level, row, col) {
var maxY = this.getTileMaxCountY(level);
var updatedRow = maxY - row - 1;
return this.urlTemplate.replace("{level}", level).replace("{col}", col).replace("{row}", updatedRow);
},
getTileMaxCountY: function(level) {
switch (level) {
case 1:
return 2;
break;
case 2:
return 4;
break;
case 3:
return 8;
break;
case 4:
return 16;
break;
case 5:
return 32;
break;
case 6:
return 64;
break;
case 7:
return 128;
break;
case 8:
return 256;
break;
case 9:
return 512;
break;
case 10:
return 1024;
break;
case 11:
return 2048;
break;
case 12:
return 4096;
break;
case 13:
return 8192;
break;
case 14:
return 16384;
break;
case 15:
return 32768;
break;
case 16:
return 65536;
break;
case 17:
return 131072;
break;
case 18:
return 262144;
break;
case 19:
return 524288;
break;
case 20:
return 1048576;
break;
case 21:
return 2097153;
break;
default:
return 0;
}
}
});
});
When I initialize a new instance of this class doing: new MySubClass("https://mydomain.com/msp/{level}/{col}/{row}.png"); I got the errror this.load() is not a function. this.load() is called at the end of the constructor method of my subclass, and this method should have been inherited from WebTileLayer class. Why this method is not accessible from the subclass? Thank you, Maxime
... View more
03-24-2017
05:54 AM
|
0
|
3
|
2575
|
POST
|
There is nothing else, it's a simple test file that should load a custom module.
... View more
03-24-2017
04:46 AM
|
0
|
0
|
1266
|
POST
|
Hi, I am new to Dojo and ArcGIS JSAPI. I am using version 4.3 and I would like to load a custom module stored in a .js file in a subdirectory. I was trying to do just as this example: http://servicesbeta.esri.com/demos/using-classes-with-javascript/seatgeek-search/ , but it does not work. Dojo is trying to load my custom module from http://js.arcgis.com/4.3/dojo/scripts/MspTiledMapServiceLayer.js instead of using location.pathname.replace(/\/[^/]+$/, "") + "/scripts" <script src="https://js.arcgis.com/4.3/"></script> <script> var dojoConfig = { paths: { scripts: location.pathname.replace(/\/[^/]+$/, "") + "/scripts" } }; require(["scripts/MspTiledMapServiceLayer"], function(MspTiledMapServiceLayer) { new MspTiledMapServiceLayer(); }); </script> This returns a 404 error at http://js.arcgis.com/4.3/dojo/scripts/MspTiledMapServiceLayer.js What am I doing wrong? Thanks a lot for your help. Maxime
... View more
03-23-2017
12:27 PM
|
0
|
5
|
2638
|
POST
|
Hi, I am looking for a way to create an Historical Marker programmatically with arcpy v.10.3. The archiving is enabled on a dataset in Oracle SDE. I think, it's related with arcpy Version Toolset, but I can't find the documentation about this. First is it possible to create Historical Markers with arcpy? If yea, any tip about this would be appreciated. Thank you, Maxime
... View more
03-09-2017
12:41 PM
|
1
|
1
|
1166
|
POST
|
Hi Andrew, Thanks for your sharings with this issue. Do you encounter the same buggy behaviour with ArcGIS 10.3 and above? Also, do you have an idea how to create a Historical Marker with arcpy? Thank you and have a good day!
... View more
03-09-2017
07:57 AM
|
0
|
0
|
788
|
Title | Kudos | Posted |
---|---|---|
1 | 08-30-2021 06:44 AM | |
1 | 08-30-2021 07:07 AM | |
1 | 08-30-2021 08:21 AM | |
1 | 11-28-2023 02:02 PM | |
1 | 12-04-2023 05:58 AM |
Online Status |
Offline
|
Date Last Visited |
06-09-2024
06:13 PM
|