|
POST
|
Hi Liz Eidsness, Thanks. This is cool! I did apply it immediately on one of my hobby projects (Jamhuri ya Kenya, an interactive map of the Republic of Kenya) I am working on, and it works a treat 🙂 I was always bothered by this silly "No Legend" text (or "Geen legenda" in a Dutch interface). Of course there is no legend, it is not needed, if a layer is invisible... And with your addition to the CSS it is al gone now 🙂 Thanks again, Egge-Jan
... View more
07-17-2019
08:19 AM
|
1
|
0
|
2001
|
|
BLOG
|
https://community.esri.com/people/EPolle_TensingInternational/blog/2020/06/14/tutorial-arcgis-api-for-javascript-4x-table-of-contents listMode: show or hide OK - This is a nice one to share, I think. The question is: I have two layers in my file that are scale dependent. How can I force the layerlist widget to only show that layer when the user is zoomed in to the point that the layer is visible and able to be turned on and off? We will show how to do this. As you can see in the code of the web map below, for one of the feature layers in the view (the municipalities) the minScale (minimum scale) is set to 500000. This means that if the view is zoomed out beyond the scale of 1:500,000 that layer will no longer be visible in the view. By default, layers that are present but not visible in the view are grayed out in the LayerList. But now we do NOT want to show invisible layers at all in this list and only add them at scales where they are visible. The trick to accomplish this, is: 'watch' the scale of the map with a watch handler set the listMode of the layer to hide or show accordingly. And this is the code needed to do this trick: // watch handler: the callback fires each time the scale of the view changes
var handle = view.watch('scale', function(newScale) {
console.log("Scale: ", newScale);
if (newScale > 500000) {
dutchMunicipalitiesLayer.listMode = 'hide';
} else {
dutchMunicipalitiesLayer.listMode = 'show';
}
}); You can see the full solution in action via this link: ArcGIS JavaScript Tutorial - Scale dependent layers visibility in LayerList And the full code (html, css and javascript) is listed below: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>ArcGIS JavaScript Tutorial - Scale dependent layers visibility in LayerList</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.12/esri/css/main.css">
<script src="https://js.arcgis.com/4.12/"></script>
<script>
require([
"esri/Map",
"esri/geometry/Point",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/widgets/LayerList"
], function(Map, Point, MapView, FeatureLayer, LayerList) {
var map = new Map({
basemap: {
portalItem: {
id: "7aea6fa913a94176a1074edb40690318" // Topo RD
}
}
});
var popupTemplate = { // autocasts as new PopupTemplate()
title: "The municipality of {Gemeentenaam}",
content: "Municipal Code: {GM_Code}"
};
var renderer = {
type: "simple", // autocasts as new SimpleRenderer()
symbol: {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
style: "none", // The polygon has no fill
outline: { // autocasts as new SimpleLineSymbol()
width: 1.5,
color: "#F5B041" // Hex Color Code
}
}
};
var dutchMunicipalitiesLayer = new FeatureLayer({
url: "https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/Bestuurlijke_Grenzen_Gemeenten_2019/FeatureServer/0",
title: "Municipalities (2019)",
popupTemplate: popupTemplate,
renderer: renderer,
minScale: 500000
});
popupTemplate.title = "The province of {Provincienaam}";
popupTemplate.content = "";
renderer.symbol.outline.width = 2.5;
renderer.symbol.outline.color = "#8B4513";
var dutchProvincesLayer = new FeatureLayer({
url: "https://services.arcgis.com/nSZVuSZjHpEZZbRo/ArcGIS/rest/services/Bestuurlijke_Grenzen_Provincies_2019/FeatureServer/0",
title: "Provinces (2019)",
popupTemplate: popupTemplate,
renderer: renderer
});
map.addMany([dutchMunicipalitiesLayer, dutchProvincesLayer]);
var view = new MapView({
spatialReference: 28992,
container: "viewDiv",
map: map,
center: new Point({x: 155000, y: 463000, spatialReference: 28992}),
zoom: 3
});
var layerList = new LayerList({
view: view
});
view.ui.add(layerList, {
position: "top-right"
});
// watch handler: the callback fires each time the scale of the view changes
var handle = view.watch('scale', function(newScale) {
console.log("Scale: ", newScale);
if (newScale > 500000) {
dutchMunicipalitiesLayer.listMode = 'hide';
} else {
dutchMunicipalitiesLayer.listMode = 'show';
}
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
07-16-2019
01:10 PM
|
1
|
0
|
2646
|
|
POST
|
Hi Ashley Peters, By default, if a layer is not visible in the map due to scale dependencies, it is grayed out in the LayerList. This is neat functionality, but apparently not what you want... The trick to accomplish what you want is: 'watch' the scale of you map with a watch handler set the listMode of your layer(s) to hide or show accordingly. See this code snippet: // watch handler: the callback fires each time the scale of the view changes
var handle = view.watch('scale', function(newScale) {
console.log("Scale: ", newScale);
if (newScale > 500000) {
dutchMunicipalitiesLayer.listMode = 'hide';
} else {
dutchMunicipalitiesLayer.listMode = 'show';
}
}); I have published the fully working example here: ArcGIS JavaScript Tutorial - Scale dependent layers visibility in LayerList Hope this helps, Egge-Jan
... View more
07-16-2019
02:37 AM
|
1
|
2
|
2588
|
|
POST
|
Hi Therese Gopal, Yes, I would say: that's the way to visualize individual households within one building. Please see the screen capture below, taken from a Registry in the Netherlands, with addresses ("Adressen") in buildings ("Gebouwen"), publicly accessible via this link BAG viewer In the picture below, all single address dwellings (polygons) do contain a single address point. The building polygon selected in the center is, as you can see, a multi-story apartment building: 4 stories with 5 apartments each, visualized by 20 dots, neatly distributed within the polygon. Best regards, Egge-Jan
... View more
07-12-2019
04:51 AM
|
0
|
1
|
2236
|
|
POST
|
Hi GNOMIC Admin, Did you already have a look at ArcGIS Online Assistant ? Here you can log in to your Portal for ArcGIS, search for item and select the option I want to Copy Content You can copy between accounts and there are two options: Simple copy creates a reference to the original service in the destination account. Full copy (EXPERIMENTAL) replicates the original service in the destination account and harvests all of its associated data. HTH, Egge-Jan
... View more
07-12-2019
01:44 AM
|
2
|
1
|
6534
|
|
POST
|
Hi reneesh tk, Please find below the code for a working example of a Search Widget searching a Feature Layer. It searches a Feature Layer with Dutch municipalities ("Gemeenten"): https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/Bestuurlijke_Grenzen_Gemeenten_2019/FeatureServer/0 and if you type Amster it will come up with the suggestion Amsterdam 🙂 You can see the page in action here: Aan de slag met ArcGIS JavaScript - Feature zoeken I hope this example will help you to get your code up and running. Best regards, Egge-Jan <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Aan de slag met ArcGIS JavaScript - Feature zoeken</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.11/esri/css/main.css">
<script src="https://js.arcgis.com/4.11/"></script>
<script>
require([
"esri/Map",
"esri/geometry/Point",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/widgets/Search"
], function(Map, Point, MapView, FeatureLayer, Search) {
var map = new Map({
basemap: {
portalItem: {
id: "7aea6fa913a94176a1074edb40690318" // Topo RD
}
}
});
var rdOrigin = new Point({
x: 155000,
y: 463000,
spatialReference: 28992
});
var view = new MapView({
spatialReference: 28992,
container: "viewDiv",
map: map,
center: rdOrigin,
zoom: 3
});
var featureLayerGemeenten = new FeatureLayer({
url: "https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/Bestuurlijke_Grenzen_Gemeenten_2019/FeatureServer/0",
popupTemplate: {
// autocasts as new PopupTemplate()
title: "Gemeente {Gemeentenaam} </br>CBS Code: {GM_Code}",
overwriteActions: true
}
});
var searchWidget = new Search({
view: view,
sources: [
{
layer: featureLayerGemeenten,
searchFields: ["Gemeentenaam", "GM_Code"],
suggestionTemplate: "{Gemeentenaam} ({GM_Code})",
exactMatch: false,
outFields: ["Gemeentenaam", "GM_Code"],
placeholder: "Zoek gemeente (naam of code)"
}
],
includeDefaultSources: false
});
view.ui.add([searchWidget], "top-right");
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
07-11-2019
03:07 AM
|
1
|
0
|
1562
|
|
POST
|
Hi Tilottama Ghosh, You might have a look at this post: pyqgis - Python Zonal Statistics Problems in QGIS - Geographic Information Systems Stack Exchange for a working example. Alternatively, you can ask the students in your class to try to solve the issue themselves. Because the teacher (you, in this case) does not have to know everything, as long as he/she does provide a stimulating and inspiring learning environment to the audience. HTH, Egge-Jan
... View more
07-11-2019
02:12 AM
|
0
|
0
|
2470
|
|
POST
|
Hi Madhava Paliyam, Your issue might have something to do with the maxRecordCount of the feature service you are accessing. This value defaults to 1,000 but can be increased if needed. Depending on the number of records you try to import there are two possible solutions: Increase the value of maxRecordCount, following the instructions given here: How To: Update the maximum record count for feature services in ArcGIS Online Alternatively you can loop over the data and import them in batches of a thousand records at the time. HTH, Egge-Jan
... View more
07-11-2019
01:56 AM
|
0
|
0
|
1310
|
|
POST
|
Hi Peter Lambert, Did you have a look at these resources? Get started with ArcGIS Indoors—ArcGIS Indoors | ArcGIS Desktop Video: ArcGIS Indoors: An Introduction There is even an ArcGIS Indoors Specialty Learning Plan which is a required learning plan for partners to be approved for the ArcGIS Indoors Specialty. HTH, Egge-Jan
... View more
07-11-2019
01:21 AM
|
1
|
0
|
1058
|
|
POST
|
Hi Piero Peppucci, The short answer is: no, this is not possible. In the Basic Viewer the legend is just a legend (and is not capable to act as a layer list). You are familiar with the Configurable app with the Interactive Legend (see this article Create simple filter apps with Interactive Legend or this sample application), so that's the way to go to obtain the functionality you are looking for. Alternatively, you could use Filters (definition queries) to split your layer in multiple sublayers, each showing it's own category. In this way you will be able to turn on and off the different categories in the layer list. HTH, Egge-Jan
... View more
07-10-2019
03:11 AM
|
0
|
0
|
1042
|
|
POST
|
Hi Dharma Rajan, Please note: an MXD is a map document showing data from one of more Feature Classes in a particular setup. If you start an edit session (with Start Editing), you are not editing the MXD in itself, but the underlying data in one or more of the Feature Classes. This is an important concept in GIS, which you have to understand: there might be cases that your map document (i.e. the MXD) did not change at all, but where the content of the map (i.e. the data you are looking at) has changed because the underlying Feature Classes have been edited. So, to protect your MXD: make sure that the *.mxd file is stored in a location on your file system where users can access it in read-only mode. This will avoid the MXD accidentally being overwritten... To protect the underlying data: make sure the permissions to edit the Feature Classes in the geodatabases are set correctly. A more general consideration is: why would you use an expensive desktop product (like Arcmap10.6.1) as a simple viewer? Wouldn't it be more easy and flexible to share your geodata through ArcGIS Online (or Portal for ArcGIS), depending on your needs and the audience you want to reach? You could consider to build your own custom web mapping application using the ArcGIS API for JavaScript, to allow your users to view the data in a web browser of their preference (e.g. Firefox - or at least that would be my choice...:-)). Please let us know what you think. Best regards, Egge-Jan
... View more
07-10-2019
12:49 AM
|
0
|
0
|
1164
|
|
POST
|
Hi Joshua Bixby, Joshua Bixby markeerde het antwoord van Emily Catt als juist Why did you mark the "Thank you" as the correct answer, and not the actual answer I gave to the question? Just curious 🙂 Egge-Jan
... View more
07-09-2019
02:13 PM
|
0
|
1
|
6362
|
|
POST
|
Hi Emily Catt, Sounds like your issue has been solved, doesn't it? Would you please be so kind to mark your question as being answered? This will help the community in finding correct information. Cheers, Egge-Jan
... View more
07-09-2019
08:25 AM
|
1
|
0
|
6362
|
|
POST
|
Hi Emily Catt, As you can see in the screen capture below I did take the content of the field POSTCODE to populate the field POSTCODE_SHORT with only the first part of the postal code. Using Calculate Field, the very pythonic syntax to accomplish this is: ''.join(!POSTCODE!.split())[:-3] So in your case that would be: ''.join(!Match_addr!.split())[:-3] Please refer to this discussion for additional explanation: Python Remove last 3 characters of a string - Stack Overflow Hope this helps, Egge-Jan
... View more
07-09-2019
07:50 AM
|
5
|
0
|
6362
|
|
POST
|
Hi James Tedrick, Thanks a lot for your reply. It did set me on the right track to solve the issue 🙂 I started by checking the web hooks on the Survey123 side by going to https://survey123.arcgis.com/ and having a look at the Settings > Webhooks section of the survey. There I found multiple web hooks which I created last week during testing, all properly configured as far as I could see. However, in this section I also found a link to additional documentation Webhooks—Survey123 for ArcGIS | ArcGIS with a brilliant remark: Note: If the survey you apply a webhook to has already been downloaded in the Survey123 field app, it will need to be downloaded again for the webhook to work. So, that was the issue: I was testing my MS Flows with the Windows version of Survey123 for ArcGIS (Version 3.5.164) on my desktop. But of course, if you modify a survey (by adding a web hook or otherwise) you have to download it again in the Survey123 field app for the changes to take effect... Now all my MS Flows work flawlessly. Thanks again. Egge-Jan
... View more
07-08-2019
03:26 AM
|
3
|
1
|
2520
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-11-2019 08:58 AM | |
| 1 | 03-30-2020 09:03 AM | |
| 2 | 12-12-2024 03:56 AM | |
| 2 | 04-15-2024 03:25 AM | |
| 2 | 03-25-2024 02:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-19-2025
02:25 AM
|