|
POST
|
The SceneView rendering is already done via webgl. If you have a lot of data that you want to visualize in 3D your best solution is to use Scene Layers.
... View more
01-25-2018
11:17 AM
|
1
|
0
|
1051
|
|
POST
|
Have you tried just setting the definitionExpression on the FeatureLayer instead? It should allow you to retrieve the necessary subset of data without having to resort to loading the data yourself. It always helps to have a jsbin, codepen, or similar so we can all better see the issues.
... View more
01-25-2018
11:06 AM
|
0
|
0
|
4229
|
|
POST
|
- The new webgl rendering referenced above is only for 2D MapViews; see webgl-rendering - If you have a lot of 3D data, then please use Pro to publish your data as Scene Layers; that is what they're designed for.
... View more
01-23-2018
03:26 PM
|
1
|
2
|
1051
|
|
POST
|
Raul, I believe the new Draw functionality will not help with this second use case. We've done some related work in this area but I'm not sure if it will help for this task. Let me try a few things and I'll get back to you...
... View more
12-12-2017
09:08 AM
|
1
|
1
|
3235
|
|
POST
|
Raul, "...draw 3D Symbols" can apply to many different types of symbols, layers, and data. Do you have specific code showing an example of what you're trying to do that doesn't work so we can think about how we might accomplish the specific task? In the included screenshot it looks like you're pointing to a polyline being draped over the terrain which can be accomplished by using the elevationInfo.mode = "on-the-ground" property/setting of the layer (see FeatureLayer). You might also check out the new Draw functionality that might help with some of these tasks. Here's a modified sample using the SketchViewModel: https://codepen.io/john-grayson/pen/GyKwXW
... View more
12-11-2017
10:30 AM
|
2
|
5
|
3235
|
|
POST
|
Below is some code I pulled out of an old demo that does what you need. The task involves two steps. The first one is to augment the label nodes with a custom inner node (chartLabel) with custom attribute (date). The second step is to find them and add a 'click' event handler to those nodes AFTER they've been rendered. //
// GET CHART LABELS //
//
getChartLabels: function (store) {
// CHART LABELS //
return store.query().map(lang.hitch(this, function (item, itemIdx) {
var selectionClass = (itemIdx === 0) ? ".chartlabelselected" : "";
var labelNode = put(lang.replace("chartLabel span{0}[date='{1}']<", [selectionClass, item.monthDate.valueOf()]), item.text);
return {
text: has("ie") ? item.text : labelNode.outerHTML,
value: (itemIdx + 1)
};
}));
}
//
// CUSTOM AXIS LABEL BEHAVIOR //
//
aspect.after(this.monthlyChart, "render", lang.hitch(this, function (evt) {
// ALLOW USERS TO CLICK ON DATE CHART LABEL TO SET MAP TIME EXTENT //
query("chartLabel", this.monthlyChart.domNode).forEach(lang.hitch(this, function (node) {
node.innerHTML = node.innerHTML.replace(/ /g, " ");
on(node, "click", lang.hitch(this, function (evt) {
var dateValue = domAttr.get(node.firstChild, "date");
this.selectMonth(this.monthlyTotalsStore.get(dateValue));
}));
}));
}), true); I hope this helps.
... View more
09-27-2017
08:53 AM
|
1
|
0
|
1669
|
|
POST
|
Try using the Expand widget: Expand | API Reference | ArcGIS API for JavaScript 4.4 & Expand widget | ArcGIS API for JavaScript 4.4
... View more
08-21-2017
05:31 PM
|
1
|
3
|
3055
|
|
POST
|
The error seems to happen after you've gotten past the download part so it's hard to tell what is going on. Try debugging the app an add a breakpoint at the line that makes the 'getExtentForScale()' call; that might help you figure it out.
... View more
08-08-2017
11:36 AM
|
0
|
0
|
1714
|
|
POST
|
Bengi, below is the relevant code, and here's a modified version of the 'Add Shapefile' sample: Add Shapefile //
// STEP #1a - GET ZIPPED SHAPEFLE FROM EXTERNAL SERVER //
//
var urlToExternalZippedShapefile = "http://apps.sfgov.org/datafiles/view.php?file=sfgis";
var zippedShapefileName = "sflnds_current";
request({
url: lang.replace("{0}/{1}.zip", [urlToExternalZippedShapefile, zippedShapefileName]),
handleAs: "blob",
load: function (zipResponse) {
//
// STEP #1b - CREATE FORM USING RETURNED ZIPPED SHAPEFILE AS BLOB //
//
var formNode = domConstruct.create("form", {
"method": "post",
"enctype": "multipart/form-data"
});
var formData = new FormData(formNode);
formData.append("file", zipResponse, zippedShapefileName + ".zip");
//
// THIS PART STAYS ALMOST SAME AS BEFORE //
//
var params = {
'name': zippedShapefileName,
'targetSR': map.spatialReference,
'maxRecordCount': 1000,
'enforceInputFileSizeLimit': true,
'enforceOutputJsonSizeLimit': true
};
var extent = scaleUtils.getExtentForScale(map, 40000);
var resolution = extent.getWidth() / map.width;
params.generalize = false;
params.maxAllowableOffset = resolution;
params.reducePrecision = true;
params.numberOfDigitsAfterDecimal = 0;
var myContent = {
'filetype': 'shapefile',
'publishParameters': JSON.stringify(params),
'f': 'json'
};
//
// STEP #2 - CALL 'GENERATE' TO CONVERT SHAPEFILE TO FEATURECOLLECTION BUT USING BLOB NOW //
//
request({
url: portalUrl + '/sharing/rest/content/features/generate',
content: myContent,
form: formData, // NOTICE HOW WE USE THE FORMDATA OBJECT THAT HAS THE EMBEDDED ZIPPED SHAPEFILE AS A BLOB //
handleAs: 'json',
load: lang.hitch(this, function (response) {
if(response.error) {
errorHandler(response.error);
return;
}
var layerName = response.featureCollection.layers[0].layerDefinition.name;
dom.byId('upload-status').innerHTML = '<b>Loaded: </b>' + layerName;
addShapefileToMap(response.featureCollection);
}),
error: lang.hitch(this, errorHandler)
});
}
});
... View more
08-07-2017
07:20 PM
|
0
|
2
|
1714
|
|
POST
|
Bengi, is this the same question as How to Pass File Directly to esriRequest Instead of Using Form Upload? This task will probably involve a two step process; first get the file from the server and then call the 'generate' endpoint. The important thing here is to understand the call you're trying to make: Generate: ArcGIS REST API. The call to 'generate' doesn't have a parameter for URLs and since you're dealing with a zipped shapefile you'll have to use the 'file' parameter which then means you need to send the actual zipped shapefile as a file. Since the zipped shapefile is on a different server you'll first need to get the file to the client machine before sending it to the 'generate' call. Do you have a JSBin or JSFiddle that shows what you're trying to do?
... View more
08-07-2017
05:23 PM
|
0
|
3
|
1714
|
|
POST
|
Then it's a two step process, first you'll first have to retrieve the file from the mentioned uri (and convert it to a blob/arraybuffer if necessary), then the second step is to use some of the techniques mentioned in the post to send it directly in the form property. How you retrieve the file from the server will depend on the server and what it allows, ideally you can retrieve the file as a blob or arraybuffer as that will simplify the process (handleAs:"blob" or handleAs:"arraybuffer").
... View more
08-04-2017
09:40 AM
|
0
|
0
|
2081
|
|
POST
|
Here's a similar question that might provide some clues: Add attachment without form node The reason we were able to do this in the mentioned post is because we already had the file/image contents as a blob but, as mentioned by Thomas, obtaining local files directly is as security issue. You might be able to do this if you already have the file object as a blob, maybe obtained from an external server/service or some other API.
... View more
08-04-2017
09:14 AM
|
1
|
2
|
2081
|
|
POST
|
Since 4.0; watching properties is the 4.x way of handling this use case.
... View more
07-28-2017
08:57 AM
|
0
|
0
|
2155
|
|
POST
|
Read the section "Watching properties" here: Working with properties | ArcGIS API for JavaScript 4.4 view.watch("extent", (newValue, oldValue, property, object)=>{
console.info("Extent has changed: ", newValue);
});
... View more
07-28-2017
08:50 AM
|
1
|
4
|
2155
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-07-2024 04:14 PM | |
| 1 | 02-23-2024 12:40 PM | |
| 1 | 03-01-2024 10:48 AM | |
| 2 | 08-03-2023 02:34 PM | |
| 2 | 07-19-2023 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-24-2024
06:01 PM
|