|
POST
|
I'm looking into this as well... will reply if I learn anything. FYI, the expression could also be condensed to the following (but it doesn't really matter. Depends on your preference): var unitVal = $feature.unit;
var stVal = $feature.snumber;
IIF(unitVal == ' ', stVal, Concatenate([stVal,unitVal], ':'));
... View more
03-15-2017
03:17 PM
|
0
|
1
|
1675
|
|
POST
|
Not as of the current release. Arcade only has access to global variables within the context of a single feature. So at the moment you don't have access to other features, including those within the same layer. This will probably come at a later release.
... View more
03-15-2017
03:04 PM
|
0
|
0
|
1127
|
|
POST
|
Sorry. Syntax error. Here's the corrected version of an alternate approach somewhat similar to IN: var items = [ “Green River Plant”, “Red Creek Mine”, “Blue Mountain Refinery”, “Yellow Enterprises” ];
IIF ( IndexOf(items, $feature.Facility_short) > -1, $feature.Facility_short, null);
... View more
03-15-2017
03:00 PM
|
2
|
3
|
2646
|
|
POST
|
> Basically, how can I get the FeatureLayer from the LayerList based on action item I chose? I can get the ListItems, but what attribute tells me it is the one to operate on? In 4.3 the ListItem will have a `layer` property that indicates the layer associated with the fired action. Not available in 4.2 though.
... View more
02-10-2017
09:56 AM
|
2
|
3
|
3103
|
|
POST
|
I presented on this topic at Dev Summit last year (and will again this year). Here's a recording of that presentation in which Dave Bayer and I show a lot of different samples demonstrating ways you can use GeometryEngine: Home | Esri Video Just a little background...GeometryEngine was originally designed for editing apps that required immediate feedback to the user, such as performing measurements, topology validation, etc. While many of the methods cater more to editing apps, there are probably other creative scenarios where you may find it useful. I'm always interested in seeing how others are using it in their own apps.
... View more
02-08-2017
08:58 AM
|
1
|
1
|
4586
|
|
POST
|
This option isn't available in version 4.2 of the API. That note was made in reference to the MapViewer which uses version 3.19 of the API. The zoom in option will be coming soon in 4.x. Not in 4.3, but more likely in 4.4.
... View more
02-03-2017
02:39 PM
|
0
|
1
|
1198
|
|
POST
|
You can create a custom function using that workflow to get a collection of the layer item ids... function getLayerIdsFromWebmap(webmapid){
var webmap = new WebMap({
portalItem: { // autocasts as new PortalItem()
id: webmapid
}
});
return webmap.load().then(function(){
var layers = webmap.layers;
return layers.map(function(layer){
return layer.portalItem.id;
});
});
}
getLayerIdsFromWebmap("f2e9b762544945f390ca4ac3671cfa72")
.then(function(layerIds){
console.log(layerIds);
var firstLayerId = layerIds.getItemAt(0);
return Layer.fromPortalItem({
portalItem: {
id: firstLayerId
}
});
}).then(function(layer){
view.map.add(layer);
});
... View more
02-03-2017
02:12 PM
|
0
|
1
|
3418
|
|
POST
|
In that case, you can use the workflow of the second snippet. Call load() on the webmap, this gets the layers in the webmap. Then you can call load() on individual layers to load them when you want in the app and add them to the map. Here's a test case: JS Bin - Collaborative JavaScript Debugging var webmap = new WebMap({
portalItem: { // autocasts as new PortalItem()
id: "f2e9b762544945f390ca4ac3671cfa72"
}
});
var view = new MapView({
map: new WebMap({
basemap: "satellite"
}),
container: "viewDiv"
});
webmap.load().then(function(){
var layers = webmap.layers;
var firstLayer = layers.getItemAt(0);
console.log("first layer loaded? ", firstLayer.loaded);
return firstLayer.load();
}).then(function(layer){
view.map.add(layer);
}); You could also query a portal or a portalGroup, but it sounds like you really want the layers from a specific webmap. If that's the case, then you should use this workflow.
... View more
02-03-2017
12:18 PM
|
0
|
3
|
3418
|
|
POST
|
I'm not entirely familiar with the other workflow you're using, but Layer.fromPortalItem() isn't designed to take a webmap id. It can only accept item ids of individual layers. To access individual layers of a webmap, you can add the webmap to your view and run the following: view.then(function(){
webmap.layers.forEach(function(layer, i){
console.log("webmap layer ", i, ": ", layer);
});
}); see the live sample here: JS Bin - Collaborative JavaScript Debugging Or call load() on the webmap outside the view: webmap.load().then(function(){
webmap.layers.forEach(function(layer, i){
console.log("webmap layer ", i, ": ", layer);
});
});
... View more
02-03-2017
10:44 AM
|
0
|
5
|
3418
|
|
POST
|
2D labeling isn't supported in 4.2. FeatureLayer | API Reference | ArcGIS API for JavaScript 4.2 A lot of the focus on the 4.x series of the API has been driven by the 3D components. 4.x will support 2D labeling in the near future.
... View more
02-03-2017
10:37 AM
|
1
|
1
|
2059
|
|
POST
|
> The only thing I would really want to change programmatically is the min and max symbol size (the cylinders). Is there a way to adjust those properties? The currently implementation uses the view to determine the min and max size so it varies depending on the scale of the view when the method is called. We're working on improving this so it is more consistent for 3D object symbols despite the scale. However, if you want to change the min and max sizes, you can do that manually without the smart mapping modules, using the size visual variable. The smart mapping modules don't have to be used to work with the slider widgets though they are convenient for getting the stats and histogram. Here's an example of how to override the sizes after getting back the default renderer: JS Bin - Collaborative JavaScript Debugging Remember, these creator functions are all about giving you a good default, or starting point. You can visualize your data anyway you want to! But these modules help give you context if you're unfamiliar with your data or you want to allow others to explore it freely. I'll take a look at the basemap issues. Note that note all vector tile basemaps will work. Only ones that have an equivalent raster basemap will generate a renderer. The reason for this is because the styles for smart mapping were designed before vector tiles came into the API. This is an issue we're aware of and looking to fix. In the meantime you can use the basemap string id of the basemap that most closely resembles whatever you are using that may be unsupported.
... View more
01-27-2017
09:17 AM
|
0
|
1
|
2325
|
|
POST
|
Hi David, The smartMapping API is all about generating a new renderer based on the statistics of your data. So the existing renderer on your service doesn't play a factor in this scenario. I'll try to go over the workflow as best I can. Please continue to ask questions if this is still confusing or if it's not exactly what you're looking for. > Turns out the FetureLayer in the sample has this all set up with "Drawing Info" in the FeatureLayer's service: https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Enriched%20World%20Cities/FeatureServer/0 This drawingInfo is ignored in the sample. We want to generate a renderer on our own when the data loads. The renderer we generate will contain the visual variables you're looking for. So we call call colorAndSizeRendererCreator.createContinuousRenderer() to do this. The response object from this method also contains the visual variables conveniently so you don't have to search for specific ones in the renderer. To call the method, first set your params... var params = {
layer: povLyr, // your layer
basemap: map.basemap, // basemap to choose "best" color scheme
field: "POP", // field used to generate the visual variables
view: view, // the initial sizes are based on your current view (this will actually likely change in a future release)
symbolType: "3d-volumetric", // This indicates 3D object symbols will be used.
minValue: 0 // this is optional
}; > So how do I set up these important statistics and visualVariables for my schools FeatureLayer by JS code. When the method resolves you can then grab the generated visual variables and statistics objects and set them in the slider widget. They are properties of the response object. See - univariateColorSize | API Reference | ArcGIS API for JavaScript 4.2 colorAndSizeRendererCreator.createContinuousRenderer(params)
.then(function(response) {
// set generated renderer on the layer and add it to the map
povLyr.renderer = response.renderer;
map.add(povLyr);
// set the queried statistics and generated visual variable
// to the slider parameters
var sizeVV = response.size.visualVariable;
var colorVV = response.color.visualVariable;
var sliderParams = {
container: "sliderDiv",
statistics: response.statistics, // this is generated for you as well
visualVariables: [sizeVV, colorVV]
};
var slider = new UnivariateColorSizeSlider(sliderParams);
}); The histogram is optional, but if you want to use that as well, then follow the example code you're looking at. In short, you don't need visual variables on the default renderer on the layer for this to work. If you already have them, then you can use them without generating the renderer every time the app loads. in that case you could do something like the following: layer.then(function(){
var renderer = layer.renderer.clone();
sliderParams = {
container: "sliderDiv",
visualVariables: renderer.visualVariables
statistics: //stats object generated from summaryStatistics()
};
}); For the stats use: summaryStatistics | API Reference | ArcGIS API for JavaScript 4.2 But if you use createContinuousRenderer() then this is already done for you under the hood. > There must be a straightforward code example to set up a common slider scenario with size, color, field max/min values, etc. This is about as straightforward as it gets. If the snippets on the description page are confusing, then take look at the code in the sandbox. That should provide more context as to where the visual variables and statistics are coming from. We can also look at reworking that description so it doesn't cause as much confusion. I'll be working on a blog post going into a little more depth on this topic. Will link to it when it goes live. Hope that helps!
... View more
01-26-2017
11:35 AM
|
2
|
3
|
2325
|
|
POST
|
We've seen problems with the textHalo in Chrome in certain scenarios and have a couple of open issues for it. This one looks slightly different though. Can you send a live test case so we can check it out further? Thanks.
... View more
01-19-2017
01:42 PM
|
1
|
3
|
4328
|
|
POST
|
When loading a symbol from JSON the range is 0-255. See ArcGIS REST API.
... View more
01-12-2017
11:57 AM
|
1
|
0
|
2867
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-06-2025 03:09 PM | |
| 1 | 04-29-2025 08:36 AM | |
| 1 | 08-20-2024 08:06 AM | |
| 1 | 08-13-2024 11:53 AM | |
| 1 | 07-22-2024 11:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|