|
POST
|
Hi Marco Amaya, Did you discover your mistake already? Your code is fine, including the use of the spatialreference parameter, except for the fact that you are using comma's (",") instead of dots (".") as decimal separators in your X and Y values. As soon as you have replaced the decimal separators you are good to go! With the coordinates you have given I end up on the southwestern outskirts of Tegucigalpa, Honduras, right? HTH, Egge-Jan [
{
"geometry": {
"x": -87.2618664,
"y": 14.045737,
"spatialReference": {
"wkid": 4326
}
},
"attributes" : {
"field1" : "test",
"field2" : "SI",
"field3" : "EC",
"field4" : "test",
"field5" : "test"
}
}
]
... View more
07-20-2020
06:01 AM
|
3
|
0
|
2547
|
|
POST
|
Hi rajni sharma, Please have a look at this page Configure Map Viewer—AppStudio for ArcGIS | Documentation for information about accessing secured web maps: To access a secured web map in your organization or ArcGIS Enterprise portal using OAuth2, register your app and provide a client ID. For more information, see Sign your app. By default, only public web maps will appear in the Map Viewer gallery; to access secured maps, enable the support secured maps property in the app's settings. HTH, Egge-Jan
... View more
07-20-2020
01:54 AM
|
0
|
0
|
464
|
|
POST
|
Hi Lambert Ngenzi, Is this the Grayson you are looking for: Grayson, California | OpenStreetMap ? This World Imagery tile layer from Esri offers fairly recent (and fairly high res) coverage of most of the world, including Grayson, California. The settlement doesn't look too big to me, so if you really need imagery for the current date, flying over it with a drone would be the fastest solution, I would guess. Did you contact the local authorities already? HTH, Egge-Jan
... View more
07-14-2020
12:50 PM
|
0
|
0
|
797
|
|
POST
|
Hi Javed, Yes, you are perfectly right. From the coordinates you are giving [-82.438496,28.010780], I can see that you are centering your map on Tampa, Florida. The trails layer you are adding to your map only contains a handful of trails near Santa Monica, California. (It most probably is just a sample data set for testing and demonstration purposes.) So, even though you center your map somewhere else, the trails layer will always appear where it is. If you want to show bike trails in Tampa, you will go and have to look for another data source. HTH, Egge-Jan
... View more
07-14-2020
07:13 AM
|
0
|
3
|
921
|
|
POST
|
Hi Cam Code, When I try the two values given, it works out fine for me. See below. (Date.prototype.toUTCString() - JavaScript | MDN ) What exactly is the content of your variable date1? HTH, Egge-Jan const event = new Date(1593543128000).toUTCString();
console.log(event);
// expected output: Tue, 30 Jun 2020 18:52:08 GMT
const event = new Date(1593021559000).toUTCString();
console.log(event);
// expected output: Wed, 24 Jun 2020 17:59:19 GMT
... View more
07-13-2020
07:47 AM
|
2
|
6
|
3504
|
|
POST
|
Hi Josh Harris, OK - I just provided an example to show how you can pass url parameters to query feature layers. (And yes, I did use some Dutch data in this example, so that's why the view has 28992 as a spatial reference.) It is up to you now to apply this workflow to your own data. I am unable to test your code, because you starred out quite an essential part, i.e. the input feature service url. So I can't tell what is going well and what is going wrong. What browser are you using? Do you see any error messages in the console? Please let us know how you managed to solve the issue. Egge-Jan
... View more
07-13-2020
04:25 AM
|
0
|
0
|
3908
|
|
POST
|
Hi Josh Harris, For the zoom bit, please have a look at this example: Zoom to extent of all features | ArcGIS API for JavaScript 4.16 As you can see in my example, 1) a single municipality is filtered out, 2) this municipality is added to the map, 3) the extent of this layer is queried and then you can zoom in with view.goTo(). // When the layer is loaded, query for the extent
// of all features in the layer. Then set the view's
// extent to the returned extent of all features.
layer
.when(function() {
return layer.queryExtent();
})
.then(function(response) {
view.goTo(response.extent);
}); HTH, Egge-Jan
... View more
07-13-2020
02:02 AM
|
0
|
2
|
3908
|
|
POST
|
Hi Josh Harris, Yes, this is possible 🙂 Please see the example below using the URLSearchParams interface. It will read the municipality name from the url and zoom in to the relevant municipality. HTH, Egge-Jan Just 3 examples: https://twiav.nl/cursus/arcgis/javascript/cursus_arcgis_javascript_query_featurelayer_met_url_parameters.htm?m=Amsterdam https://twiav.nl/cursus/arcgis/javascript/cursus_arcgis_javascript_query_featurelayer_met_url_parameters.htm?m=Leeuwarden https://twiav.nl/cursus/arcgis/javascript/cursus_arcgis_javascript_query_featurelayer_met_url_parameters.htm?m=Maastricht <!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 - Query FeatureLayer met URL Parameters</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.16/esri/css/main.css">
<script src="https://js.arcgis.com/4.16/"></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/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: "Gemeente {Gemeentenaam}",
content: "Gemeentecode {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
}
}
};
if ('URLSearchParams' in window) { // Feature detection (URLSearchParams is not supported by Internet Explorer)
var url = new URL(document.URL);
var search_params = url.searchParams;
if(search_params.has('m')) {
var municipality = search_params.get('m');
var expr = "Gemeentenaam = '" + municipality + "'";
} else {
var municipality = "";
var expr = "1=1";
}
};
var municipalityLayer = new FeatureLayer({
url: "https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/Bestuurlijke_Grenzen_Gemeenten_2019/FeatureServer/0",
definitionExpression: expr,
title: "Gemeenten " + municipality,
minScale: 5000000,
popupTemplate: popupTemplate,
renderer: renderer
});
map.add(municipalityLayer);
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"
});
municipalityLayer
.when(function() {
return municipalityLayer.queryExtent();
})
.then(function(response) {
view.goTo(response.extent);
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
07-12-2020
06:55 AM
|
0
|
4
|
3908
|
|
POST
|
Hi John Stigkas, Most probably you have entered the wrong URL. To connect to a WMS service you have to enter the WMS server URL. The address you are pointing to is just a website showing a map with the data from this service. But please note: this WMS service ( from the Hellenic Navy Hydrographic Service) is not free. See this page: https://www.hnhs.gr/en/component/k2/739-web-map-service-wms Anyone wishing to use the WMS for this purpose must fill in the respective application and pay the fee established in the HNHS’s pricing policy for this service. So, most probably they will provide you with the correct server URL after you have paid your fee. HTH, Egge-Jan
... View more
07-09-2020
07:29 AM
|
1
|
2
|
5745
|
|
POST
|
Hi Kathleen B Schaefer, 1. The quickest and easiest way would be to create the image from the ArcGIS Online map viewer: In the ArcGIS Online map viewer, click the Print drop-down menu. There are two options available, which is printing only the Map or the Map with Legend. A printer-friendly web page of the map is displayed. You will soon discover that only the 'map' part is an image, which can be copied and pasted right away to your Word document. (The map viewer uses MAP_ONLY and PNG32 as the output formats.) If you want to copy the whole layout (i.e. including the title and the legend) you will have to take a screen capture to paste to your Word document. 2. A slightly more advanced way would be to build a Web Mapping Application (using the ArcGIS Web AppBuilder) and add a print widget to this app. The options in this print widget will allow you to set the scale, define the scale bar units, set a title, an author and copyright text, etc. With this print widget you can print the whole layout to an image (e.g. a PNG file) directly. Hope this helps 🙂 BR, Egge-Jan
... View more
07-08-2020
12:36 PM
|
0
|
0
|
959
|
|
POST
|
Hi Scott Sumners, Does this page provide the information you need? Manage apps in the app launcher—Portal for ArcGIS (10.8) | Documentation for ArcGIS Enterprise BR, Egge-Jan
... View more
07-08-2020
08:49 AM
|
0
|
7
|
2435
|
|
POST
|
Hi P Herk, Assuming that your Feature Layer is hosted in ArcGIS Online, these are the steps to follow: in ArcGIS Online go to the item page of your hosted feature layer go to the Data tab and select the layer you want to modify click Fields to see the existing fields and their properties here you will also find the Add button to add a field after adding the field you can optionally create a list of values (domain) to limit the input to the new field HTH, Egge-Jan
... View more
07-07-2020
02:57 AM
|
0
|
0
|
1312
|
|
POST
|
Hi, I have found a nice way to get, and set, my x and y coordinates and zoom level from, and to, the query string of my url. With the URLSearchParams interface I can manipulate the search parameters and with the History.replaceState() method I can modify the url. It works alright. The search parameters in this link ArcGIS JavaScript with UK data - URL Parameters: x, y and zoomlevel (?x=345835&y=381863&l=14) will fly you directly to John Lennon Airport in Liverpool. More info in this blog: https://community.esri.com/people/EPolle_TensingInternational/blog/2020/07/06/arcgis-javascript-with-uk-data-urlsearchparams And now the question: Is this the correct approach, or should I have used urlUtils.urlToObject() instead? What would be the pros and cons of either way? What is your opinion? TIA, Egge-Jan
... View more
07-06-2020
01:26 PM
|
0
|
0
|
745
|
|
BLOG
|
https://community.esri.com/people/EPolle_TensingInternational/blog/2020/03/24/arcgis-javascript-with-uk-data-table-of-content Setting x, y and zoom level in url to retain map view When you zoom in on a particular location on a map, you sometimes wish you could retain that map view, e.g. to share it with someone else. That's why we were looking for a way to get the x, y and zoom level from the search parameters in our url. But not only do we want to be able to read the values from the query string (i.e. everything behind the question mark), we also want to be able to set them, and to modify them whenever the map view changes, i.e. when the user pans and zooms around on the map. Below is a description of the functionality we use to grab the x an y coordinates (in British National Grid, rounded to the full meter) and to modify the url. URLSearchParams and History.replaceState() The URLSearchParams interface defines utility methods to work with the query string of a URL. In the example below we use the following methods of this interface: The has() method indicates whether a parameter with the specified name exists The get() method returns the (first) value associated to the given search parameter The set() method sets the value associated with a given search parameter. And very important: if the search parameter does not yet exist (which might initially be the case), this method will create the search parameter. The History.replaceState() method modifies the current history entry. This method is particularly useful when you want to update the URL of the current history entry in response to some user action, e.g. the panning and zooming mentioned before. And this is how it works: If you provide the url without any parameters, you will start at the Default map view. But as you will see, the default parameters are added immediately to the address bar: https://twiav.nl/en/arcgis/javascript/arcgis_javascript_with_uk_data_url_parameters.htm And as soon as you start zooming and panning around, these parameters will be adjusted every time the view becomes "stationary" (we do use reactiveUtils to check the state of the view, stationary or not), In this way, you can zoom in to a particular spot and copy the url to make sure to share exactly that map view. If you click on the link below you will immediately end up in Steòrnabhagh (or Stornoway in English, we are using the Web Map GB Cartographic Local Names here), on the island of Lewis and Harris in the Outer Hebrides: https://twiav.nl/en/arcgis/javascript/arcgis_javascript_with_uk_data_url_parameters.htm?x=143956&y=932940&l=12 Happy coding! The code <!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 - URL Parameters: x, y and zoomlevel</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/Home",
"esri/Viewpoint",
"esri/core/reactiveUtils"
], function(Map, Point, MapView, Home, Viewpoint, reactiveUtils) {
var sr = 27700;
var xCoordHome = 500000;
var yCoordHome = 500000;
var zoomLevelHome = 5;
var scaleHome = 4612360;
var xCoord = xCoordHome;
var yCoord = yCoordHome;
var zoomLevel = zoomLevelHome;
if ('URLSearchParams' in window) { // Feature detection (URLSearchParams is not supported by Internet Explorer)
var url = new URL(document.URL);
var search_params = url.searchParams;
// get searchparams if x, y and l are provided in url
if(search_params.has('x') && search_params.has('y') && search_params.has('l')) {
var xCoord = parseInt(search_params.get('x'));
var yCoord = parseInt(search_params.get('y'));
var zoomLevel = parseInt(search_params.get('l'));
}
};
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: sr,
container: "viewDiv",
map: map,
center: new Point({x: xCoord, y: yCoord, spatialReference: sr}),
zoom: zoomLevel
});
var home = new Home({
view: view,
// viewpoint of home needs to be defined (hard coded) because otherwise this home depends on the x, y and l values in the searchparams
viewpoint: new Viewpoint({targetGeometry: new Point({x: xCoordHome, y: yCoordHome, spatialReference: sr}), scale: scaleHome})
});
view.ui.add(home, "top-left")
reactiveUtils.when(
() => view?.stationary === true,
() => {
modifySearchParams();
});
//modify url with new coords and zoomlevel as searchparams
function modifySearchParams() {
if ('URLSearchParams' in window) { // Feature detection (URLSearchParams is not supported by Internet Explorer)
xCoordNew = parseInt(view.center.x);
yCoordNew = parseInt(view.center.y);
zoomLevelNew = view.zoom;
search_params.set('x', xCoordNew);
search_params.set('y', yCoordNew);
search_params.set('l', zoomLevelNew);
url.search = search_params.toString(); // change the search property of the main url
new_url = url.toString(); // the new url string
history.replaceState(null, '', new_url);
}
}
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>
... View more
07-06-2020
12:46 PM
|
0
|
0
|
1112
|
|
POST
|
Hi Steve Brown, You can export your ArcGIS Pro bookmarks to a *.bkmx file: Manage bookmarks—ArcGIS Pro | Documentation But the bookmark format of ArcGIS Pro is not backward compatible with ArcMap; ArcGIS Pro uses the .bkmx bookmark file format, while ArcMap uses the .dat bookmark file format. The bookmarks are modelled differently, and the properties are not the same. Esri Technical Support provides an How To: Replicate bookmarks from ArcGIS Pro to ArcMap A workaround is to replicate bookmarks from ArcGIS Pro to ArcMap through ArcGIS Online with an organizational account. Maybe it is just easier to set your bookmarks manually in ArcMap? HTH, Egge-Jan
... View more
07-06-2020
09:05 AM
|
1
|
0
|
3941
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 01-17-2024 10:19 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|