|
POST
|
Hi Roman Chueh, Would this work for you? Date.prototype.toLocaleString() - JavaScript | MDN Example: var today = new Date();
console.log(today); // Output: Mon Jul 29 2019 19:06:57 GMT+0200 (Midden-Europese zomertijd)
options = {day: 'numeric', month: 'numeric', year: 'numeric'}
console.log(today.toLocaleString('nl-NL', options)); // Output: 29-7-2019
console.log(today.toLocaleString('en-US', options)); // Output: 7/29/2019
HTH, Egge-Jan
... View more
07-29-2019
10:16 AM
|
0
|
3
|
2891
|
|
POST
|
Hi Gaurav Chadha, You have two follow a two-step-approach here, I guess: First you have to convert the CSV files into shape files (or, maybe better, import them into a file geodatabase); Next, you can zip the shape files (or the fgdb) and import the zip package into developers arcgis. Does this solve your issue? Best regards, Egge-Jan
... View more
07-29-2019
08:34 AM
|
1
|
2
|
3354
|
|
POST
|
Hi Adam Daily, Thanks. You might ask this additional question (about the limit for number of fields in a layer) in a new thread to the entire community. I did do some googling and I found this discussion: Which is the limit of the number of fields that a Feature Layer hosted one can have? Here, in the end, the issue was not the number of fields but an invalid character in one of the field names. Could it be that in your case the trouble is caused by a similar issue? Egge-Jan
... View more
07-29-2019
08:13 AM
|
0
|
1
|
4391
|
|
POST
|
Hi Adam Daily, Thanks for your reply. Apparently I did overlook the option to check/uncheck all fields at once using the checkbox next to Field Name. (I have modified my initial answer above...) Doesn't this mean that both your questions have been answered? ("How do you turn off fields and change symbology in a AGOL View Layer") Since your question has been answered you may close it by marking my answer as correct. Cheers, Egge-Jan
... View more
07-29-2019
05:25 AM
|
0
|
3
|
4391
|
|
POST
|
Hi Adam, Your first question is: How do you turn off fields in a AGOL View Layer? The answer is: You don't set this on the Data tab, but on the Visualization tab instead. On this Visualization tab, click More Options (the dots) and in the menu choose Set View Definition > Define Fields (see screen capture Define the fields that will be available in this layer. Unselected fields are completely hidden to others. If the field is grayed out in the list, its visibility can't be changed. In this dialog you can also check/uncheck all fields at once by clicking the checkbox next to Field Name. Your second question is: How do you change symbology in a AGOL View Layer? The answer is: you are on the right track. I tested this on my view and it works for me. So, I don't know why you get an empty drop down list... 😞 Can this be caused by the large number of fields in the service (you say "hundreds of fields")? Can you please check and try to change the symbology on the original feature layer the view is based on? In this way you can establish whether it actually is an issue on the view layer, or on the featureset as a whole. Does the issue still occur after you have limited the number of fields to 10 (see step 1 above)? Please keep us posted. HTH, Egge-Jan
... View more
07-26-2019
03:17 AM
|
1
|
5
|
4391
|
|
POST
|
Hmmmm, that sounds strange to me. (And it is contrary to what I state above...) In the help (Add Features—ArcGIS REST API: Services Directory | ArcGIS for Developers) Esri uses an example with decimal degrees. Could you please check the output of your service? According to the help: The structure of each feature in the array is the same as the structure of the json feature object returned by the ArcGIS REST API. What do you get in the output? Decimal degrees or meters? Egge-Jan
... View more
07-23-2019
06:04 AM
|
0
|
1
|
1818
|
|
POST
|
Hi kawish abbas, The value and the format of the coordinates you have to provide depends on the Spatial Reference of the service you are talking to. So, in the Lahore Tiger example I have given in this thread I did use coordinates with WKID 102100 (which is essentially EPSG: 3857) to land on the lawn of Lahore Fort, because that is the WKID used by this service: https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Hazards_Uptown_Charlotte/FeatureServer So the question is: what is the Spatial Reference of your Karachi service? If you provide coordinates in the same Spatial Reference your point will appear correctly on the map. Does this answer your question? Egge-Jan [
{
"attributes" : {
"HazardType" : "Dangerous Animal",
"Description" : "We saw a tiger on the lawn",
"SpecialInstructions" : "No Action",
"Status" : "Active",
"Priority" : "High"
},
"geometry" : {
"x" : 8272644.51,
"y" : 3709258.71
}
}
]
... View more
07-23-2019
03:12 AM
|
0
|
3
|
1818
|
|
POST
|
Hi Kawish, Could you please be so kind to mark my original answer as "correct", as this was the correct answer to your original question 🙂 This will show the question with a green mark, instead of the question mark in blue. In this way we can help others to find correct information. Please feel free to mark my other answers as "useful", if you think they are... 🙂 Good luck with your exploration of the ArcGIS REST API. Best regards, Egge-Jan
... View more
07-21-2019
09:19 AM
|
1
|
0
|
6421
|
|
BLOG
|
https://community.esri.com/people/EPolle_TensingInternational/blog/2019/06/02/aan-de-slag-met-arcgis-javascript-inleiding Ga naar XY met RD-coördinaten In de oefening van vandaag bouwen we een dialoogvenster (een <form>) waarin gebruikers een X- en een Y-coördinaat op kunnen geven om op basis hiervan op een locatie in te zoomen. De functie die hiervoor geschreven is (goToRDXY - zie de code hieronder) vangt de invoer van de gebruiker af. Als de invoer correct is, dan wordt een puntobject aangemaakt. Dit puntobject wordt op de kaart geplaatst, en er wordt naartoe gezoomd. Hieronder staan de coördinaten van enkele willekeurige locaties, om de applicatie mee te testen. Locatie X Y Vrijthof, Maastricht 176220 317750 Strandpaviljoen de Piraat, Cadzand 15940 378700 Rode Vuurtoren, Schiermonnikoog 205405 611450 En weet je wat zo leuk is? Het formulier werkt de hele foutafhandeling af. De RD-coördinaten moeten immers binnen bepaalde waarden liggen (zie hiervoor de afbeelding in https://community.esri.com/people/EPolle_TensingInternational/blog/2019/05/11/aan-de-slag-met-arcgis-javascript-nederlandse-basiskaart ). Maar als de gebruiker nog niet de juiste waarden heeft ingevuld, dan doet de knop Ga naar locatie het nog niet. De foutafhandeling verschilt per browser, maar pas als er twee vinkjes staan, kan de gebruiker doorgaan Bovenaan in de code is wat aanvullende CSS toegevoegd om de look-and-feel van het dialoogvenster en het formulier te beïnvloeden. Klik hier om het resultaat te zien: Aan de slag met ArcGIS JavaScript - Ga naar XY (RD-coördinaten) <!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 - Ga naar XY (RD-coördinaten)</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
font-family: sans-serif;
}
.dialogDiv {
background-color: white;
}
.dialogHeader {
color: white;
font-weight: bolder;
width: auto;
background-color: #3c84a7;
padding: 5px;
}
.coordinatesDiv {
background-color: white;
padding: 10px;
}
fieldset {
border: 1px solid grey;
margin: 10px;
}
legend {
padding: 1em 0.5em;
font-size:90%;
}
input:invalid+span:after {
content: '✖';
padding-left: 5px;
}
input:valid+span:after {
content: '✓';
padding-left: 5px;
}
</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/Graphic"
], function(Map, Point, MapView, Graphic) {
var map = new Map({
basemap: {
portalItem: {
id: "7aea6fa913a94176a1074edb40690318" // Topo RD
}
}
});
var view = new MapView({
spatialReference: 28992,
container: "viewDiv",
map: map,
center: new Point({x: 155000, y: 463000, spatialReference: 28992}),
zoom: 3
});
view.ui.add("rdCoordinatesDiv", "bottom-left");
var simpleMarkerSymbol = {
type: "simple-marker",
style: "triangle",
angle: 180,
size: 16,
yoffset: 8, // De onderste punt van de driehoek wijst naar de locatie met de opgegeven coördinaten
color: [255, 0, 0],
outline: {
color: [255, 255, 255],
width: 2
}
};
// Maak een Graphic aan zonder geometrie - deze wordt later toegevoegd
var xyMarkerOnTheMap = new Graphic({
symbol: simpleMarkerSymbol
});
// Voeg de 'onzichtbare' Graphic toe aan de view
view.graphics.add(xyMarkerOnTheMap);
// Event Listener
document.getElementById("rdCoordinatesForm").addEventListener("submit", goToRDXY);
// Functie
function goToRDXY (event) {
event.preventDefault() // De preventDefault() method wordt hier gebruikt om te voorkomen dat het formulier gesubmit wordt. Input wordt lokaal - in deze functie - verwerkt.
xyMarkerOnTheMap.geometry = null;
let rdX = document.getElementById("rdXCoordinate").value;
let rdY = document.getElementById("rdYCoordinate").value;
let target = new Point({x: parseFloat(rdX), y: parseFloat(rdY), spatialReference: 28992});
xyMarkerOnTheMap.geometry = target;
console.log(target);
view.goTo({target: target, zoom: 13});
}
});
</script>
</head>
<body>
<div id="viewDiv"></div>
<div class="dialogDiv" id="rdCoordinatesDiv">
<div class="dialogHeader">
Ga naar XY
</div>
<form id="rdCoordinatesForm">
<fieldset>
<legend>RD-coördinaten (EPSG: 28992)</legend>
<div class="coordinatesDiv">
<label for="rdXCoordinate">X-coördinaat:</label>
<input id="rdXCoordinate" type="number" name="rdXCoordinate" step="0.001" min="10000" max="290000" required>
<span class="validity"></span>
</div>
<div class="coordinatesDiv">
<label for="rdYCoordinate">Y-coördinaat:</label>
<input id="rdYCoordinate" type="number" name="rdYCoordinate" step="0.001" min="300000" max="620000" required>
<span class="validity"></span>
</div>
</fieldset>
<div class="coordinatesDiv">
<input type="submit" value="Ga naar locatie">
</div>
</form>
</div>
</body>
</html>
... View more
07-21-2019
08:12 AM
|
0
|
0
|
395
|
|
POST
|
Hi kawish abbas, In that case you might have a look at the ArcGIS REST API to add a feature directly through an HTTP POST request. Let's take the Hazards service from the Editor widget example: https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Hazards_Uptown_Charlotte/FeatureServer/0 (This is a public service, maintained by Esri's jsapi_team. You can add records freely to this service, for testing purposes. I guess they remove the records every now and then...) We want to report a hazard, a wild animal: let's pretend we have seen a tiger on the lawn of Lahore Fort!! Go to https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Hazards_Uptown_Charlotte/FeatureServer/0/addFeatures and enter the feature you want to add: [
{
"attributes" : {
"HazardType" : "Dangerous Animal",
"Description" : "We saw a tiger on the lawn",
"SpecialInstructions" : "No Action",
"Status" : "Active",
"Priority" : "High"
},
"geometry" : {
"x" : 8272644.51,
"y" : 3709258.71
}
}
] As soon as you click Add Features, your Tiger Warning will be added to the service and hence be added to the map. Is this something you would like to investigate? Best regards, Egge-Jan
... View more
07-21-2019
05:28 AM
|
2
|
2
|
6421
|
|
POST
|
Hi Chris Lovelace, Can you please elaborate a little bit more on your project? What API are you using? What steps did you take until now? As a first step towards automation: can you describe how you would go about to execute the query in the web app manually? The more information you provide, the easier it is for community members to help you 🙂 HTH, Egge-Jan
... View more
07-20-2019
03:20 PM
|
0
|
1
|
1111
|
|
POST
|
Hi kawish abbas, Regarding your new question in this thread: Did you already have a look at the Editor widget? It has been introduced in version 4.11 of the ArcGIS API for JavaScript. There is a nice sample available: Edit features with the Editor widget | ArcGIS API for JavaScript 4.12. This sample allows you to actually edit and modify a sample data set provided by Esri. Nice 🙂 The widget automatically recognizes if there are any editable feature layer(s) within the map. If there are, the layer or layers will display within the widget. Based on the editing functionality set on the feature layer, you can Edit existing features and/or Add new features. Does this suit your needs? Best regards, Egge-Jan
... View more
07-20-2019
03:06 PM
|
0
|
4
|
6421
|
|
POST
|
Hi Kawish, Did the above solution solve your original issue? Please be so kind to mark it as correct. This will help other JavaScript developers in the Esri Community to find useful and correct information. Thanks in advance for your community spirit, Egge-Jan
... View more
07-20-2019
02:53 PM
|
0
|
1
|
6421
|
|
POST
|
Hi Kawish, I think you have to apply a parseFloat() function to your arguments to turn them into floating point numbers. So, essentially your code is correct, apart from this parsing that is missing. (By the way, please note that Internet Explorer 11 does not support the Arrow Function you are using... but maybe we should consider that a non-issue - LOL) Based on the research I have done to investigate your issue I have published a sample app using the corrected code below: ArcGIS JavaScript Tutorial - Use view.goTo() to zoom to given location If you enter the coordinates 74.315 and 31.588, it will fly you directly to Lahore Fort, the fortified 16th-century Mughal citadel in Lahore, Pakistan. So, your code should become: let lon = document.getElementById("lon");
let lat = document.getElementById("lat");
let btnLocation = document.getElementById("btnlocation");
btnLocation.addEventListener('click', () => {
view.goTo({
target:[parseFloat(lon.value), parseFloat(lat.value)]
})
}) Does this solve your issue? Best regards, Egge-Jan
... View more
07-18-2019
08:21 AM
|
2
|
8
|
6421
|
|
POST
|
Hi Havan Cong, I have had a quick look at your data (see screen captures below). You could use the following tools to accomplish what you want: Dissolve - Aggregates features based on specified attributes. Multipart To Singlepart - Creates a feature class containing singlepart features generated by separating multipart input features. The first step will combine all features base on the content of the field QUY_HOACH and will reduce the number of records from 1,126 to only 11. In the second step you split these 11 multipart objects into 852 singlepart features. Does this solve your issue? Best regards, Egge-Jan
... View more
07-18-2019
04:40 AM
|
2
|
5
|
5252
|
| 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
|