IDEA
|
@MaryGraceMcClellan - awesome. I have hundreds of useful scripts like these. I will start putting them online when I get a chance.
... View more
10-12-2022
02:53 PM
|
0
|
0
|
1355
|
IDEA
|
@JeffBarrette and @MaryGraceMcClellan: FYI, I have this working. For one of my clients, I had to migrate hundreds of MXDs to ArcGIS Pro, and move their locations. This is how I did it: Create a blank aprx and save it to a temporary location, e.g. C:\temp\blank.aprx For each MXD, import it into the aprx - e.g. aprx.importDocument(mxd) Save the aprx to the new location - e.g. aprx.saveACopy(new_aprx) Remap the datasources Check the datasources were mapped correctly and run a few other validation tests It only took half an hour or so to write the script, and then took a bit longer to test and make changes to handle exceptions. I didn't have any issues with the new aprxs. @MaryGraceMcClellan if you still need help with this, let me know and I will see if I still have a copy of my script, or I can rewrite the script for you when I get a chance.
... View more
09-25-2022
10:09 PM
|
0
|
0
|
1392
|
IDEA
|
@BjornSvensson and @RalucaNicola1. We also need this functionality too. We have a mature configurable app being used by several customers, and this is the only thing we cannot fully customise. We can rebuild the 3D measure tool using the Sketch widget, or our own custom widget, but we prefer to use the 3D measure tool instead. Do you have any idea when you expect this enhancement will be made? If not, we will build our own 3D measure tool using the Sketch widget. FYI, we already rebuilt the 2D measure tool with the Sketch widget because we needed a lot more customisation for our customers.
... View more
08-10-2022
10:14 PM
|
0
|
0
|
1835
|
POST
|
hi Michal, It's a bit late for my reply here but in case you are still trying to do this: portal.load().then(async () => { console.log(portal.credential.token); }); Cheers, Rhys
... View more
11-18-2020
11:30 PM
|
0
|
0
|
1455
|
POST
|
Hi Alexander, This is probably too late for you but posting this here in case it helps someone else. For a vector tile basemap, the easy way to handle this is by adding an array of LODS to the constraints in the MapView constructor. See the working code example below. Also, in case you haven't seen this, it is a good place to find vector tile basemaps: Leaflet Provider Demo Regards, Rhys <!DOCTYPE html>
<html>
<head>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link
rel="stylesheet"
href="https://js.arcgis.com/4.17/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.17/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/Basemap",
"esri/layers/VectorTileLayer",
], function (Map, MapView, Basemap, VectorTileLayer) {
const map = new Map({
basemap: new Basemap({
baseLayers: [
new VectorTileLayer({
url:
"https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer",
}),
],
}),
});
const view = new MapView({
container: "viewDiv",
constraints: {
lods: [
{
level: 15,
resolution: 4.77731426794937,
scale: 18055.954822,
},
{
level: 16,
resolution: 2.388657133974685,
scale: 9027.977411,
},
{
level: 17,
resolution: 1.1943285668550503,
scale: 4513.988705,
}
]
},
map: map,
scale: 10000,
center: [-3.7038, 40.4168],
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
10-13-2020
01:05 AM
|
0
|
0
|
879
|
POST
|
In case it helps anyone, I had to run ArcGIS Pro as Administrator, even though the user I was logged in had admin privileges.
... View more
07-27-2020
12:07 AM
|
1
|
0
|
2127
|
POST
|
Hmm, should have worked for 4.14 but wouldn't surprise me if there was a bug. 4.15 fixed a few bugs I was having with my app.
... View more
05-04-2020
08:07 PM
|
0
|
0
|
7541
|
POST
|
hi Abdelrahman, You may need to add a trusted server, e.g. config | ArcGIS API for JavaScript 4.14 require(["esri/config"], function(esriConfig) { esriConfig.request.trustedServers.push("[<protocol>//]<hostname>.<domain>[:<port>]"); }); Regards, Rhys
... View more
04-05-2020
01:17 AM
|
0
|
5
|
7541
|
POST
|
hi Guys, I know this is an old post but adding this here in case it helps someone. The simple way to handle this is use the listMode property in the constructor for the layer, e.g. const layer = new GraphicsLayer({ listMode: "hide" }); See Layer | ArcGIS API for JavaScript 4.14 Cheers, Rhys https://nz.linkedin.com/in/rhys-donoghue
... View more
03-19-2020
06:01 PM
|
1
|
0
|
966
|
POST
|
I also just tested a large GeoJSON dataset on the new GeoJSONLayer that Rene mentioned. It works great, and is faster than a map service - GeoJSONLayer | ArcGIS API for JavaScript 4.14 .
... View more
02-17-2020
05:51 PM
|
0
|
0
|
699
|
POST
|
I know this is an old post, but just adding my comments here in case it helps someone. I often work with large GeoJSON datasets with Esri's JS API. The very first thing I do is try to reduce the size of my GeoJSON file. The easiest way to do this is normally by reducing the number of vertices in the features. There are various ways to do this using Esri software. If you don't have Esri software, you can use mapshaper. This can reduce a 100MB GeoJSON file down to only 1MB without losing too much feature definition. If the file is still not small enough, then you can decrease the precision of the coordinates, e.g. 12.34522153234 becomes 12.3. This may make no difference to the how the data looks but can easily halve the file size. To decrease the precision, I use Python, although this could be done easily via JavaScript if needed. The other option that I looked at when my data was too big was using Postgres and only requesting the data in the current map extent (how normal ArcGIS Server map services work). This worked fine.
... View more
02-17-2020
05:38 PM
|
1
|
1
|
3271
|
POST
|
If this helps anyone, you can delete an item via this URL: https://[your server]/[your portal name]/sharing/rest/content/users/[your username] - This will show you the content you own, then you can click on the item, then delete it. I had to do this for content that was not showing up in Portal for ArcGIS. I knew it was there and went looking for it and found it via the URL above. Imtiaz Syed - Nice script, thanks for sharing.
... View more
10-23-2019
12:37 PM
|
0
|
0
|
2411
|
POST
|
@jordan - Yes, you are correct, a webmap is a wrapper or collection of layers as JSON, however, a Portal/AGO webmap can also contain other types of layers not supported by (or originating) from ArcGIS Server (e.g. a WMTS layer). A hosted feature layer does not have a corresponding map service, so navigating the REST Services Directory won't show the map service for a hosted feature layer. See @Andrew's comment below.
... View more
08-14-2018
11:23 PM
|
0
|
0
|
1940
|
POST
|
Yes, Andrew is correct. Feature services from ArcGIS Server web services are created by publishing map services and enabling Feature Access. So if you are using ArcGIS Server, you can change "FeatureServer" in the REST endpoint for the feature service to "MapServer" and get the legend info, however, as Andrew correctly points out, if the feature service is hosted with ArcGIS Online or Portal for ArcGIS, it does not have a corresponding map service because the service was not created via ArcGIS Server - it was published from Portal/AGO. To get the legend for the feature service if there is no map service, you need to use the drawingInfo - see here for an example of the drawingInfo object: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/1?f=pjson. Also the drawingInfo.renderer does not match the renderer for Esri's JS API (4.8 at the time of writing this), so you will need to use jsonUtils | API Reference | ArcGIS API for JavaScript 4.8 to convert it to a renderer you can use with the JS API. Once you have the drawingInfo, you can convert it to SVG format to render your custom legend - you can use this: symbolPreview | API Reference | ArcGIS API for JavaScript 4.8 . You can test your legend first using Esri's legend widget: Legend | API Reference | ArcGIS API for JavaScript 4.8 - This will show you the legend works even if there is no corresponding map service for the feature service.
... View more
08-14-2018
11:18 PM
|
1
|
1
|
1940
|
POST
|
Hi Joe, thanks for your response. Your error message is identifying the issue for you. These parameters are not enough "where=1=1&outFields=*&f=pjson". I put them in there as an example of the key parameters you need to change. You may still need all of the other parameters, but you can just use the default values for those parameters. Here's an example using one of Esri's sample services: 1) Open https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query in your browser. 2) In the Where parameter, type 1=1 3) In the Outfields parameter, type * 4) In the Format parameter, use JSON 5) Click Query (GET) and when the response comes back, look at the request parameters in the URL in your browser's address bar, i.e. https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=1%3D1&text=&objectIds=&time=&… You may need those parameters in your request, even though the parameters are empty. You may not need all of the parameters. You will need to check by trial and error. However, in saying that, this URL works fine without all of the parameters: https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=1=1&outFields=*&f=pjson It is possible that earlier versions of ArcGIS Server may require the full parameters but maybe later versions don't. You can check the version via the REST Services Directory endpoint for the map server, e.g. https://sampleserver6.arcgisonline.com/arcgis/rest/services Let me know if it is still not working for you.
... View more
07-26-2018
03:51 PM
|
0
|
0
|
5395
|
Title | Kudos | Posted |
---|---|---|
1 | 03-19-2020 06:01 PM | |
1 | 02-17-2020 05:38 PM | |
1 | 08-14-2018 11:18 PM | |
1 | 12-13-2017 02:47 PM | |
1 | 12-29-2017 02:05 AM |
Online Status |
Offline
|
Date Last Visited |
10-12-2022
02:53 PM
|