POST
|
LayerList | API Reference | ArcGIS Maps SDK for JavaScript 4.29 | ArcGIS Developers: To hide layers in the map from the LayerList widget, you must set the listMode property on the desired layers to hide.
... View more
04-24-2024
12:59 PM
|
0
|
0
|
527
|
POST
|
The translation of this label, for the Italian locale, comes from this file @ArcGIS\core\assets\esri\widgets\Search\t9n\Search_it.json. You may want to change it there yourself, or you could ask the ArcGIS JS Development team to modify the translation.
... View more
04-15-2024
03:25 AM
|
2
|
1
|
328
|
POST
|
Hi @ForrestLin, Thanks for checking this out. I think it works 'as designed': Esri, of course, wants you to use their portal, and - as you indicate - the summary you set there will appear in the popup. There is no way, as far as I know, to set this popup text in the code. Can someone from Esri confirm? Code wise, you can only set the title, which will then appear in the popup (like in my code snippet above).
... View more
04-11-2024
03:16 PM
|
0
|
1
|
424
|
POST
|
Yes, when is the answer 🙂 when() may be leveraged once an instance of the class is created. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#methods-summary Example // Although this example uses the BasemapGallery widget, any class instance that is a promise may use when() in the same way
let bmGallery = new BasemapGallery();
bmGallery.when(function(){
// This function will execute once the promise is resolved
}, function(error){
// This function will execute if the promise is rejected due to an error
}); Does this solve the issue? Egge-Jan
... View more
04-11-2024
08:57 AM
|
0
|
1
|
368
|
POST
|
Hmmm, what is the source of your TileLayer? Can you set a description in the portal, as indicated in the first part of my answer above...?
... View more
04-11-2024
08:38 AM
|
0
|
2
|
439
|
POST
|
Hi @ForrestLin, Your LocalBaseMapSource will contain one or more Basemaps. If the Basemap is coming from ArcGIS Online (or ArcGIS Enterprise) then you can edit the tooltip text in your portal: it is the description you give to the item. Alternatively, if your Basemap is coming from another source, you can give your Basemap a title which will pop up in the tooltip. See code snippet below. For the Basemap which is based on the WMTSLayer, it is the title "BRT Achtergrondkaart (PDOK)" which will show in the tooltip. HTH, Egge-Jan import Basemap from "@arcgis/core/Basemap";
import WMTSLayer from "@arcgis/core/layers/WMTSLayer";
import LocalBasemapsSource from "@arcgis/core/widgets/BasemapGallery/support/LocalBasemapsSource";
import SpatialReference from "@arcgis/core/geometry/SpatialReference";
const epsg28992 = new SpatialReference({wkid:28992});
// // BRT Achtergrondkaart van PDOK als achtergrondkaart
let brt_Achtergrondkaart_PDOK = new Basemap({
baseLayers: [
new WMTSLayer({
url: "https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0?",
copyright:
"<a target='_top' href='https://www.pdok.nl/introductie/-/article/basisregistratie-topografie-achtergrondkaarten-brt-a-'>BRT Achtergrondkaart</a> van <a target='_top' href='https://www.pdok.nl/'>PDOK</a>",
activeLayer: {
id: "brtachtergrondkaart"
}
})
],
title: "BRT Achtergrondkaart (PDOK)",
id: "brtachtergrondkaart",
spatialReference: epsg28992,
thumbnailUrl: "brt_achtergrondkaart_pdok.jpg"
});
// Basiskaarten Esri Nederland
let topo_RD_EsriNL = new Basemap({portalItem: {id: "7aea6fa913a94176a1074edb40690318"}, id: "topo"}); // Topo RD --> https://www.arcgis.com/home/item.html?id=7aea6fa913a94176a1074edb40690318
let hr_Luchtfoto_Actueel = new Basemap({portalItem: {id: "9455a421f9a74887b03593cfa410abdf"}, id: "luchtfoto_hr"}); //Hoge Resolutie Luchtfoto RD
let lightGrayCanvas_RD_EsriNL = new Basemap({portalItem: {id: "9ff6521e85d24df1aa9cd4aebfef748b"}, id: "lichtgrijs"}); //Lichtgrijze Canvas RD
let darkGrayCanvas_RD_EsriNL = new Basemap({portalItem: {id: "62a3befb579e4d9f9c5c51576c8a7c25"}, id: "donkergrijs"}); //Donkergrijze Canvas RD
let osm_RD_EsriNL = new Basemap({portalItem: {id: "37292449670841d5bf5d590f4940c368"}, id: "osm_rd"}); //OpenStreetMap in RD via Esri Nederland
let baseMaps = new LocalBasemapsSource({
basemaps: [brt_Achtergrondkaart_PDOK, topo_RD_EsriNL, hr_Luchtfoto_Actueel, lightGrayCanvas_RD_EsriNL, darkGrayCanvas_RD_EsriNL, osm_RD_EsriNL]
});
export { baseMaps };
... View more
04-11-2024
01:47 AM
|
0
|
1
|
465
|
POST
|
Hi @ReneRubalcava, Cool. Didn't know about this little widget. I did quickly create a small sample to test it (see code below) and it works fine. I do like this little compass indicating the orientation of the map (when not 0), allowing you to reset the map orientation (to 0). Of course I cannot speak for the original poster, but I think this offers most of the functionality requested. Here is my little sample: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>ArcGIS JavaScript with UK data - DirectionalPad</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.29/esri/css/main.css">
<script src="https://js.arcgis.com/4.29/"></script>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<script>
require([
"esri/Map",
"esri/geometry/Point",
"esri/views/MapView",
"esri/widgets/DirectionalPad"
], function(Map, Point, MapView, DirectionalPad) {
var map = new Map({
basemap: {
portalItem: {
id: "5b9d5ac7e17f402a9111f1ca2c22bf56"
// GB Cartographic Local Names, hosted by EsriUKContent, see: https://www.arcgis.com/home/item.html?id=5b9d5ac7e17f402a9111f1ca2c22bf56
}
}
});
var view = new MapView({
spatialReference: 27700,
container: "viewDiv",
map: map,
center: new Point({x: 500000, y: 500000, spatialReference: 27700}),
zoom: 5
});
const directionalPad = new DirectionalPad({
view: view
});
view.ui.add(directionalPad, "bottom-right");
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html> Cheers, Egge-Jan
... View more
03-25-2024
02:06 PM
|
2
|
5
|
765
|
POST
|
Hi @Tom_Prutz, Good evening, I don't know whether your question is still relevant, as you posted it almost 2 weeks ago... Actually I think your code snippet should work, so we have got to find out why it is not working - as you say - in your case. You can find more information about reactiveUtils in the ArcGIS JS API Reference, and there it is suggested to put a question mark behind view. But I did test your sample without a question mark, and that did the job as well... reactiveUtils.when(
() => view?.stationary === true,
() => {
console.log("view is stationary now");
}); To see a working example you have a look at this blogpost ArcGIS JavaScript with UK data - URL.searchParams. It might seem an older post, but I just updated it tonight, to use reactiveUtils (instead of the deprecated, and now even completely removed, watchUtils which I used in an earlier version of the post). As you can see, the parameters in the URL are updated every time the view becomes stationary. So, in the end, the conclusion might be, that your issue is caused by your test setup. Can you please provide us with more information/code to explain what you are trying to do? Cheers, Egge-Jan
... View more
03-25-2024
01:13 PM
|
0
|
1
|
366
|
POST
|
Hi @StephM, Can you please share the code snippet where you add your icons? In that way it will be easier for the community to provide suggestions on what to change to make it work (again) in the 4.29 version of the ArcGIS Maps SDK for JavaScript. I can provide you with an example - using an svg instead of base64, so maybe not completely what you are looking for... - that works fine in 4.29: function createZoomEntireCountryBtn() {
const zoomEntireCountryBtnDiv = document.createElement('div');
zoomEntireCountryBtnDiv.innerHTML = `
<div id="zoomEntireCountryBtn" class="esri-component esri-widget--button esri-widget" role="button">
<span title="Zoom uit op heel Nederland"><calcite-action><img src="nederland.svg" style="width:25px;height:25px;" alt="nederland"></calcite-action></span>
</div>`;
document.body.appendChild(zoomEntireCountryBtnDiv);
document.getElementById("zoomEntireCountryBtn").addEventListener("click", zoomEntireCountry);
} The actual file nederland.svg is 924x924 pixels in size, but renders perfectly on my custom button: Hope you will find a solution (and - maybe - share it here to the benefit of the community :-)) Cheers, Egge-Jan
... View more
03-25-2024
06:27 AM
|
0
|
0
|
222
|
POST
|
I think you will have to add your own buttons to the map, or actually to the view.ui, with a function to move the center of the map an X number of units to the N/E/S/W when the respective button is clicked. I have never added pan buttons to the ui myself, but for some inspiration you may have a look at this example, where I do add a custom 'previous extent' and 'next extent' button to the user interface: ArcGIS Maps SDK for JavaScript example: Previous a... - Esri Community HTH, Egge-Jan
... View more
03-25-2024
06:07 AM
|
0
|
0
|
794
|
POST
|
Hi @azy141, Can you please explain why you would want to add pan controls to your ArcGIS4 JS map? The reason I ask this, is because I think it is not necessary at all to add such controls to the user interface. It is quite easy to pan the map - grabbing it with a left mouse click, using the arrow keys on your keyboard or just with your fingers on a mobile device. So, the map is 'panable' by default. There is no need to add controls to activate a pan modus. What is your opinion about this? Cheers, Egge-Jan
... View more
03-25-2024
05:22 AM
|
0
|
1
|
806
|
POST
|
Could this be useful? Building ArcGIS API for JavaScript Apps with NextJS (esri.com). It comes with the source code for the application in this blog post on github.
... View more
01-18-2024
04:54 AM
|
0
|
3
|
1217
|
POST
|
Yes, as @BlakeTerhune suggests, you should really consider, while you are already migrating from 3.x to 4.x, to also leave the legacy AMD modules, with their require() statement, behind and switch to ES Modules instead. For a quick comparison between AMD and ES, you might have a look at this blog post by @AndyGup : ArcGIS API for JavaScript – Working with frameworks and build tools just got easier – Part 2 (esri.com). And sample apps, provided by Esri, ae available here: jsapi-resources/esm-samples at main · Esri/jsapi-resources · GitHub
... View more
01-17-2024
10:19 AM
|
1
|
0
|
1286
|
POST
|
Hi @vijaybadugu, Have you seen this page already? Migrating from 3.x to 4.28 | Overview | ArcGIS Maps SDK for JavaScript 4.28 | ArcGIS Developers Here an overview is provided for developers like yourself, with knowledge of and experience with the 3.x API, looking to migrate to 4.x. Most important message here, as far as I am concerned: Consider rewriting applications instead of simply trying to update them. And if you have any more specific challenges, this community is there to help. Always. Cheers, Egge-Jan
... View more
01-17-2024
09:16 AM
|
0
|
2
|
1332
|
POST
|
Hi, Search | API Reference | ArcGIS Maps SDK for JavaScript 4.26 | ArcGIS Developers includeDefaultSources: false Cheers, Egge-Jan
... View more
05-10-2023
09:21 AM
|
0
|
0
|
750
|
Title | Kudos | Posted |
---|---|---|
2 | 04-15-2024 03:25 AM | |
2 | 03-25-2024 02:06 PM | |
1 | 01-17-2024 10:19 AM | |
1 | 03-30-2023 05:57 AM | |
2 | 02-02-2023 02:47 PM |
Online Status |
Offline
|
Date Last Visited |
07-26-2024
02:35 PM
|