|
POST
|
For your query, I don't see a 'where' clause or a geometry being sent. The query needs to query by tabular values (where) or by spatial location (geometry). Also, I don't see the queryTask being instantiated, at which point you would identify the URL (layer) that you would be querying. Take a look at the queryTask page for more information: QueryTask Also, I would add an error catcher to see just what is going on, as in: queryTask.execute(query).then(function(results) {
console.log(results);
}
.catch(function (error) {
console.error("Query Error: " + error);
});
... View more
03-26-2021
09:06 AM
|
1
|
0
|
2292
|
|
POST
|
I'm seeing nothing new on the ArcGIS Online side for this user. The result of the page only shows the default "Arcgis Portal Directory" and 'Api Reference' link. Truly not sure if it worked or not. But now that I think about the result, I was hoping more for a file to download from the site, not be added to the content on ArcGIS Online. I am thinking it might be better to go with a geoprocessing service on my Portal. That way I can handle the content easier. Thanks again for helping me out.
... View more
03-25-2021
02:42 PM
|
0
|
0
|
2984
|
|
POST
|
But... When I post the resulting URL directly , it doesn't give me an error. Not sure where any downloaded Excel file went to, but it must be working. Thanks Tim, I'll accept this as the solution to how to get the ArcGIS REST API Export to work against an ArcGIS Online feature service, now I just have to figure out why my code keeps coming up with the 'unexpected token < in JSON at postion 0' error.
... View more
03-25-2021
02:25 PM
|
0
|
0
|
2990
|
|
POST
|
Tim, Thanks for getting back to me. I just thought that was an example URL so I disregarded it. I had an Esri tech on the phone tell me that the URL provided in my sample was correct. I didn't have the completed function at that time so I couldn't test it in front of him. I did try to connect using a URL pointing to the the user, with Export on the end to follow up on your suggestion, but that didn't work either. It actually gave me the same error: Export Excel Error: [request:server]: Unexpected token < in JSON at position 0
... View more
03-25-2021
02:19 PM
|
0
|
0
|
2991
|
|
POST
|
I'm trying to use the Export function off of an ArcGIS Online feature service, but I keep getting an error: Export Excel Error: [request:server]: Unexpected token < in JSON at position 0 When I try to send the URL directly, I get this error: The requested layer (layerId: export) was not found. This is the code I'm trying to use: // Export to excel
btnExport = document.getElementById("btnExport");
btnExport.onclick = function () {
let exportURL = "https://services2.arcgis.com/2t1927381mhTgWNC/arcgis/rest/services/Regional_Bus_Stops/FeatureServer/export";
exportURL += "?itemId=9feab4597b8d435e9c9ba41a4931d09f";
exportURL += "&title='Regional_Bus_Stops'";
exportURL += "&exportFormat='Excel'";
exportURL += "&exportParameters=" + "%7b'layers'%3a%5b%7b'id'%3a0%7d%5d%7d";
console.log(exportURL);
esriRequest(exportURL, {
method: "post",
responseType: "json"
}).then(function (response) {
console.log(response);
})
.catch(function (error) {
console.error("Export Excel Error: " + error);
});
} I think it has something to do with how I'm passing the Export parameters. I've cleaned up the 'layer:0' text using URL encoded values, but that still doesn't seem to work. Any help would be greatly appreciated. Thanks, Jeff.
... View more
03-25-2021
12:10 PM
|
0
|
5
|
3042
|
|
POST
|
In the JS 3.x, we used to set the LODs in the map creation. The LODs looking like this: var mapLods = [
{"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},
{"level" : 20, "resolution" : 0.149291070823808, "scale" : 564.248588},
{"level" : 21, "resolution" : 0.074645535411904, "scale" : 282.124294}
]; Looking at the JS API 4.x MapView (Constraints ), the Constraints property does have a possibility for setting 'lods'. I've never tried it at 4.x but I'd be interested to know if it works. By setting the level of details you would still be selecting the zoom level at whole numbers, but with the resolution set by the LODs themselves. We used to do it to get finer resolution ability, especially when using aerial photography, but a lot of Esri basemaps won't display at the finer resolutions.
... View more
03-25-2021
11:25 AM
|
1
|
1
|
2813
|
|
POST
|
I think the form element is setup to go when the enter key is identified. You could possibly set up a routine to identify any key down/press event and determine if it's an enter key, such as: function onKeyDown(event) {
// Shift key
if (event.which === 16) { console.log('shift key pressed'); }
else if (event.which === 27) { console.log('escape key pressed');}
else if (event.which === 39 || event.which === 37) {
console.log('arrow keys pressed');
}
else if (event.which === 13) {
// Peform the function that you need, or disregard it.
console.log('Enter key!');
}
} but this can get ugly, fast. I would recommend that you don't setup, whatever it is that you are setting up, in a form. Just have the input elements and set up an onclick event for the button to do something at that point. Such as: btnSubmit = document.getElementById("btnSubmit");
btnSubmit.onclick = function () {
let val1 = document.getElementById("textbox1").value;
let val2 = document.getElementById("textbox2").value;
// Do something with these values...
} You'll need 'id' values in your elements but this should work. Also, 'document.getElementById' is old school, but you could also import the Dojo 'dom' and use 'byId' that way.
... View more
03-25-2021
10:27 AM
|
1
|
1
|
1637
|
|
POST
|
Using the Javascript API (4.x) you can add the ElevationProfile widget to a Web Scene. The example that you pointed to does exactly that. Look at the 'sandbox' to see the exact code. In order to use this you will need to put the file (a single HTML page for this example) into a and internet management service (Internet Information Server (IIS) for Windows, or Apache for Linux) in order for the page to be rendered and accessible from a browser. But everything to accomplish what you are asking is in that example.
... View more
03-25-2021
10:06 AM
|
0
|
0
|
1960
|
|
POST
|
Not sure what you are trying to do when you say 'post feature layers to database'. You can edit the existing layers (if you have edit access) by using the Editor widget (Editor ), or create a new online layer to add data to (by editing) (Create ), or export the ArcGIS Online layer by using the Export option (Export ). I'm currently trying to work through an Export operation to get to an Excel spreadsheet of the data, but you could export to a Shapefile or File Geodatabase format as well.
... View more
03-25-2021
09:59 AM
|
1
|
0
|
1084
|
|
POST
|
Set up a field list and specify how to show/handle specific columns: var lstFields = [
{ name: OBJECTID, visible: false },
{ name: "StopID", label: "Stop ID: ", direction: "asc", editable: false },
{ name: "Location", label: "Bus Stop Location: " },
{ name: "Routes", label: "Routes Served: ", direction: "asc"},
{ name: "Jurisdiction", label: "Jurisdiction: ", required: true }
] Then, when you define the FeatureTable you can use this field list for the 'fieldConfigs' value: busStopViewTable = new FeatureTable({
view: view,
layer: busStopsLayer,
editingEnabled: true,
menuConfig: {
items: [{
label: "Zoom to feature(s)",
iconClass: "esri-icon-zoom-in-magnifying-glass",
clickFunction: function (event) {
//zoomToSelectedFeatureTable();
console.log("Need to build zoomToSelectedFeatureTable function");
}
}]
},
// Autocast the FieldColumnConfigs
fieldConfigs: lstFields,
container: document.getElementById("tableDiv")
});
... View more
03-22-2021
09:56 AM
|
1
|
1
|
1548
|
|
POST
|
There are a lot of things I'm unsure of in this sample. I've included some code below that works, but I've left out the proxy (I don't need it) and the geometry service (you don't need it in this sample piece so not sure why it's there). Also, you can set the initial zoom location and scale through the view initialization, not sure why you have a secondary extent and resolution. I left those out and just relied on the initial View zoom. Also, the coordinates and map projection may not be correct, unless you are looking at the west coast of Africa (usually the first sign you're not). I'm sure there's a lot more to this than what you're showing but this would work (with a good projection) using the code you have provided so far: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Testing</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/dark-blue/main.css">
<script src="https://js.arcgis.com/4.18/"></script>
<style>
html,
body,
#mapMatriCAD {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/Map",
"esri/layers/FeatureLayer",
"esri/layers/GraphicsLayer",
"esri/views/MapView",
"esri/geometry/Extent",
"esri/widgets/BasemapToggle"
], function (Map, FeatureLayer, GraphicsLayer, MapView, Extent, BasemapToggle
) {
// Create the Map
const matricadMap = new Map({
basemap: "topo-vector"
});
// Set map extent
const matricadMapExtent = new Extent({
xmin: 145998.0719999969,
ymin: 162020.52899999917,
xmax: 152430.14699999988,
ymax: 167383.29899999872,
spatialReference: {
wkid: 31370
}
});
// Create a MapView instance (for 2D viewing) and reference the map instance
const matricadMapView = new MapView({
container: "mapMatriCAD",
map: matricadMap,
center: matricadMapExtent.center,
zoom: 9,
highlightOptions: {
color: "orange"
}
});
// Carbon storage of trees in Warren Wilson College.
var featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});
matricadMap.add(featureLayer);
// Toggle backgrounds layers
const basemapToggle = new BasemapToggle({
view: matricadMapView,
nextBasemap: "hybrid"
});
matricadMapView.when(function () {
/* Set ArcGIS Server proxy URL */
//esriConfig.request.proxyUrl = proxyiedUrl;
/* Set ArcGIS GeometryService URL */
//esriConfig.geometryServiceUrl = 'https://<my-geometry-service>';
//matricadMapView.extent = matricadMapExtent;
// Set initial zoom
//matricadMapView.constraints = {
// minScale: 25000
//};
// Get graphic properties from view click
matricadMapView.on('click', function (event) {
matricadMapView.hitTest(event).then(function (response) {
if (response.results.length) {
console.log(response);
}
});
});
});
});
</script>
</head>
<body>
<div id="mapMatriCAD"></div>
</body>
</html>
... View more
03-22-2021
09:03 AM
|
0
|
1
|
2669
|
|
POST
|
Jessica, it's good that you have some well defined parameters. You are looking for a widget or control that will provide certain properties, methods, and events. With this information, you need to evaluate either the ArcGIS Javascript API 3.X (3.35 now I think) or the 4.X (4.18 now) version and determine if the widget/control as defined by these API's is sufficient for your purposes. In regards to table views, I think the biggest difference between 3 and 4 versions is that 4 is just getting into editing, and there's still some issues with that. Since you seem to not need editing I would look at either. By going to the API web sites, you should look at the samples page. From the many samples it should be easy to determine if the API in question can provide you with what you seek. The samples also show you how to construct a complete program following ArcGIS Javascript API recommended development patterns. You can easily string multiple samples together to get what you are looking for, if that's needed as well. Just type ArcGIS Javascript API 3.x into a browser and it'll take you to a page that you can access either API from. Once you feel you have found a control/widget that will provide you what is needed, visit the specific page for it and look at its properties, methods, and events to see if you can further develop its capacity beyond what was available in the sample(s). If you can't come across a widget/control that is functional to your particular needs, you may need to go further such as looking at Dojo (which the APIs are based on), and maybe specifically Dgrid for more access to a table widget (as far as the properties, methods, and events). Whatever direction you decide on going, once you get started and run into some issues you can always throw up some code to the Community web site to ask for further help. Or start a ticket with Esri directly if you are under a maintenance contract. This is a broad question and sorry but I had to give a broad answer. Happy hunting and good luck!
... View more
03-15-2021
10:17 AM
|
1
|
0
|
982
|
|
POST
|
I just set up a Python routine to do this, but it's using the Union function which very easily locates 'donuts' by uninioning only the 1 layer and closing gaps, and then searching for a missing attribute that the 'donuts' wouldn't have. You could set up a geoprocessing service to return the polygons with donuts, but that might be more than you are looking for. My next thought was that it would be in the 'rings' attribute of the Polygon object. There should be a different ring for the inner 'donut' so if you parse out the separate rings and look for one being contained by the other you could determine that an 'inner cavity' existed.
... View more
03-11-2021
03:23 PM
|
0
|
4
|
1768
|
|
POST
|
Is there a way to get the selected features when the Editor widget is engaged? I was looking for a way to attach to a selection event, and then hopefully determine the features from that event, but I can't find that anywhere. I tried doing the layerView watch and then using 'queryFeatures' on the layerview, but that shows all of the available features in the layer. view.whenLayerView(busStopLayer).then(function (busLayerView) {
busLayerView.watch("updating", function (val) {
if (!val) { // wait for the bus stop layer view to finish updating
busLayerView.queryFeatures().then(function (results) {
console.log(results.features); // grabs client-side graphics
});
}
});
});
... View more
03-11-2021
03:13 PM
|
0
|
0
|
769
|
|
POST
|
Dan, I’ve reposted it at https://community.esri.com/message/939475-determine-minimum-distance-between-all-points-in-two-tables. Thank you. <https://www.valleymetro.org> Jeffrey Wilkerson Senior GIS Administrator 101 N. 1st Ave., Suite 1400, Phoenix, AZ 85003 o: 602-495-8273 c: 480-272-1243 JWilkerson@valleymetro.org <https://www.valleymetro.org/> <https://www.facebook.com/valleymetro> <https://twitter.com/valleymetro> <https://www.instagram.com/valleymetro/> <https://www.valleymetro.org/news/our-response-covid-19> CONFIDENTIALITY NOTICE: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
... View more
07-07-2020
11:06 AM
|
0
|
0
|
2591
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-01-2022 02:02 PM | |
| 1 | 02-28-2024 01:40 PM | |
| 2 | 02-27-2024 01:13 PM | |
| 1 | 10-18-2022 11:31 AM | |
| 1 | 06-23-2023 09:13 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-28-2025
09:15 AM
|