|
POST
|
Something very strange happen in my FME shutdown python script that uses arcpy.Exists() function. This function test if a feature class exists or not and returns True or False. The following script returns False in FME even if the feature class do exists. I have tryed the same script in a python shell using the same python interpretor, and it returns True. Any ideas why it fails in FME shutdown python? import arcpy print arcpy.Exists("\\\\cnatrtd8\\geo\\GEODEV011.sde\\GEO09_WEB_MERCATOR\\GEO09E03_CS_STA")
... View more
07-04-2017
05:50 AM
|
0
|
8
|
5530
|
|
POST
|
Oh! That's right. I think I'll go back to v.3.20 then Thank you very much !
... View more
06-13-2017
06:18 AM
|
1
|
0
|
1577
|
|
POST
|
Hi Robert, You example is using a MapImageLayer, but I am asking about a FeatureLayer. And I see in the example that they creating the LabelClass used as label renderers instead of getting it from the service.
... View more
06-13-2017
05:55 AM
|
0
|
2
|
1577
|
|
POST
|
I wonder if it is possible to use the labels renderers defined in a .mxd published as a Map Service (Feature Access enabled) for a FeatureLayer with the javascript API v4.3 just like it works with the geometry renderer? I define a featureLayer like this: var organismesLayer = new FeatureLayer({
url: "https://infogeo.education.gouv.qc.ca/arcgis/rest/services/SandBox_Maxime/GDUNO/MapServer/1",
labelsVisible: true
}); In the map, I see the layer style is the same than in the .mxd, but the labels are not visible. Do I have to define the LabelClass manually in the javascript code? Is there a way to get the label renderers from the Map Service?
... View more
06-13-2017
05:42 AM
|
0
|
4
|
2169
|
|
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
|
1740
|
|
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
|
1138
|
|
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
|
1206
|
|
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
|
2329
|
|
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
|
2329
|
|
POST
|
Doing that, it wont work when the layer is visible...
... View more
03-30-2017
08:19 AM
|
0
|
10
|
2329
|
|
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
|
2329
|
|
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
|
5351
|
|
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
|
2072
|
|
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
|
2233
|
|
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
|
3389
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 06-03-2024 10:33 AM | |
| 2 | 05-14-2025 10:45 AM | |
| 1 | 04-12-2022 07:00 AM | |
| 1 | 02-26-2025 05:37 AM | |
| 1 | 01-30-2023 11:12 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-14-2025
08:29 AM
|