|
POST
|
hehe... ^_^'', you are right, (sorry, for the dummy question) -> https://jsbin.com/fuworis/13/edit?html,output What about the ViewLayer, it should be updated when a new feature shows up on the screen, right?
... View more
04-04-2018
06:01 AM
|
0
|
2
|
3415
|
|
POST
|
I have found an strange behaviour, as you can see here: The layerView is not updating when new features are showing up and the query doesn't seem to be displaying the number of features in the screen, right? This is the source code: https://jsbin.com/fuworis/11/edit?html,output Any ideas?:Rene Rubalcava / Robert Scheitlin, GISP
... View more
04-04-2018
03:24 AM
|
0
|
4
|
3415
|
|
POST
|
Thanks Robert Scheitlin, GISP & Rene Rubalcava!! Now it works , I'll share the app as soon as I have something to show ;-***
... View more
04-03-2018
10:42 AM
|
1
|
0
|
3415
|
|
POST
|
Ok Kathy Smikrud, I'll try to get back to you, but I case I don't please write me a message in a couple of weeks. Best
... View more
04-02-2018
03:25 AM
|
0
|
0
|
760
|
|
POST
|
I'm using JS API 4.6 and I'm trying to show in a table all graphics been displayed in the current extent directly querying the client/view. You can find a live sample of the skeleton I'm using here or directly in here: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Query graphics on webmap</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
<script>
var dojoConfig = {
has: {
"esri-featurelayer-webgl": 1
}
};
</script>
<script src="https://js.arcgis.com/4.6/"></script>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 400px;
width: 100%;
}
</style>
<script>
require([
"esri/WebMap",
"esri/views/MapView",
"esri/widgets/LayerList",
"esri/widgets/Legend",
"esri/geometry/geometryEngine",
"esri/core/watchUtils",
"esri/tasks/support/Query",
"dojo/domReady!"
],
function(
WebMap,
MapView,
LayerList,
Legend,
geometryEngine,
watchUtils,
Query
) {
webmap = new WebMap({
portalItem: {
id: "19d21df5e87f4f5a9aa5b8d678b174d6"
}
});
view = new MapView({
container: "viewDiv",
map: webmap,
popup: {
dockEnabled: true,
dockOptions: {
buttonEnabled: false,
breakpoint: {
width: 1000
},
position: "bottom-left"
}
},
});
view.when(function() {
var featureLayer = webmap.layers.getItemAt(0);
featureLayer.labelingInfo = [{
labelExpression: "[title]",
labelExpressionInfo: {
"expression": "$feature[\"title\"]"
},
labelPlacement: "always-horizontal",
symbol: {
type: "text",
color: [ 255,255,255,0.85 ],
font: {
size: 16,
weight: "bold",
family: "Arial Unicode MS"
},
haloColor: [255, 255, 255, 255],
haloSize: 0.75,
}
}];
var legend = new Legend({
view: view,
layerInfos: [{
layer: featureLayer,
title: "Actor type"
}]
});
view.ui.add(legend, "bottom-right");
});
view.when(function() {
var layerList = new LayerList({
view: view
});
view.ui.add(layerList, "top-right");
});
watchUtils.whenTrue(view, "stationary", function() {
if (view.extent) {
var info = `the view extent changed: \n
xmin = ${view.extent.xmin.toFixed(2)} xmax = ${view.extent.xmax.toFixed(2)} \n
ymin = ${view.extent.ymin.toFixed(2)} ymax = ${view.extent.ymax.toFixed(2)}`;
console.log(info);
}
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
<div>
<p>Visible graphics:</p>
<!-- TODO: Display visible graphics-->
</div>
</body>
</html>
I have been trying different things: 1) Using queryGraphics as I found at the GraphicsLayerView | API Reference | ArcGIS API for JavaScript 4.6 l = view.allLayerViews.getItemAt(1);
l.queryGraphics().then(function(results){
console.log("results=",results);
}); But the "then" promise was not resolved, maybe because I didn't added in the right place. 2) So I tried using queryFeatures, similar al Robert Scheitlin, GISP suggested in Capture attribute values from a WebMap without click event directly on the console: view.allLayerViews.getItemAt(1).queryFeatures(query).always(function(results){
console.info(results);
}); But this time I used "always" and I got an: {
name: "FeatureLayerView2D",
message: "Not ready to execute query",
details: undefined
} 3) I didn't know what "Not ready to execute query" means so I keep trying this time using the view event layerview-create as Ken Buja mentioned atCannot access items array property of MapView.allLayerViews (ArcJS API 4.4) : view.on("layerview-create", function(event) {
var query = new Query();
query.where = '1=1';
query.outSpatialReference = view.spatialReference;
query.outFields = ["*"];
console.log("event.layer.title=",event.layer.title)
event.layerView.queryFeatures(query).always(function(results){
console.info(results);
});
});
But I got the same error. 4) Next time I tried a different way, using layerView.featuresView.graphics as Thomas Solow mentioned at Design Question - Feature Layer Queries on Client-Side? l = view.allLayerViews.getItemAt(1);
l.layer.title // return "Startups"
l.featuresView.numFeatures // return 374
l.featuresView.graphics // return undefined And I don't understand why graphics are undefined this time... ^_^. I also tried using queryFeatures on l.featuresView but the method didn't exist. 5) Desperately I also tried using the Accessor: l = view.allLayerViews.getItemAt(1)
l.watch("updating", function (newValue, oldValue, propertyName, target) {
target.queryFeatures().then(function (results) {
console.log("results", results);
})
console.log("graphics=", target.featuresView.graphics")
}); But nothing ;( I have spent several hours reading, trying different things and searching in the answered questions, but I'm running out of ideas. Please, could you help me solve this problem? I guess it should be quite easy to do but I'm not able to make it work. Thanks in advance.
... View more
04-01-2018
04:57 PM
|
1
|
8
|
4138
|
|
POST
|
You're welcome Kathy!. I'm going to try and make these changes as you suggested and use your new deployable version. Hopefully I can do this I'm not very savy with javascript but you've given awesome directions! Good luck with that! . are the individual locations within a tab referenced similar to the 'story-tab-navigation' you've added or would that amount to specifying each location somehow? Nope, I forgot to add that too, but I have added it to the ToDo List (a.k.a. repo issues). If this is very important & urgent for you and want me to help you find a partner willing to help you with that just let me know. Cheers!
... View more
03-19-2018
04:27 AM
|
0
|
1
|
760
|
|
POST
|
I think that endpoint is only valid for Portal for ArcGIS, but not for ArcGIS Online: Create User—ArcGIS REST API: Administer your portal | ArcGIS for Developers Example: Add members to the portal—Portal for ArcGIS (10.6) | ArcGIS Enterprise I can not find that on ArcGIS Online, ialixandroaeesriro-ro-esridist, Tom Wayson, Gavin Rehkemper, John Gravois any of you could confirm us that?
... View more
03-19-2018
04:19 AM
|
0
|
0
|
2082
|
|
POST
|
Hi Kathy Smikrud, I have already talked to Mark Cooney using the GitHub issues and finally I have made a fork of the original repo and added some changes to help you with this. So now you can download a new deployable version here, you just need to: Add your GA code in the index.html Check the custom-scripts.js file and decide if you want to track something different On this screenshot you will see it is already tracking: I hope this is helpful to you. Cheers!
... View more
03-15-2018
12:02 PM
|
1
|
7
|
2248
|
|
POST
|
About the other question, I'm not sure if it is possible for you to create a user though the REST API. I have just tried using this endpoint: https://{{urlKey}}.maps.arcgis.com/sharing/rest/portals/self/invite And I tried to send this payload: {
"invitations": [{
"username": "USERNAME",
"password": "PASSWORD",
"firstname": "FNAME",
"lastname": "LNAME",
"fullname": "FNAME",
"email": "EMAIL",
"role": "account_user",
"level": "2",
"provider": "enterprise",
"userType": "arcgisonly"
}]
} But it didn't work (this is the Postman collection I used). Sorry I can't be more helpful.
... View more
03-15-2018
05:33 AM
|
0
|
0
|
2082
|
|
POST
|
That REST API is not documented , I found it debugging the browser, but in your case you are talking about a name user inside an org. A public account is not linked to an organization and only can create items (Web Maps, Web Mapping Applications, etc) but it is very limited.
... View more
03-15-2018
05:03 AM
|
0
|
0
|
2082
|
|
POST
|
Hi Jerry, What kind of user? An user in an organization? <- Create User—ArcGIS REST API: Administer your portal | ArcGIS for Developers An ArcGIS.com public account? <- https://www.arcgis.com/sharing/rest/community/signup What do you mean with "the provider=enterprise"? Cheers
... View more
03-15-2018
01:27 AM
|
0
|
4
|
2082
|
|
POST
|
Aha, great, if you have already downloaded the 'ready-to-deploy' app you only would need: Add your Google Analytics code to the template as explained in the article Bind the storymap events to a method using the 'ga.send()' function from Google Analytics to each individual event you want to track. To do so: Edit the custom-scripts.js file Track events "story-whatever-event". I have checked and I found three events implemented in the core/viewer: story-update-entries story-tab-navigation story-perform-action-media I guess you would need to use the "story-tab-navigation" event, something like: topic.subscribe("story-tab-navigation", function(index){
console.log(`Index = ${index}`);
var data = {
hitType: 'event',
eventCategory: 'section',
eventAction: 'story-tab-navigation',
eventLabel: strip(app.data.getStory()[index].title).trim()
};
console.log('Sending data to GA: ', data);
ga('send', data);
});
topic.subscribe("story-update-entries", function(arg){
debugger
});
topic.subscribe("story-perform-action-media", function(arg){
debugger
}); But for some reason it is not working to me (but it worked with the StoryMap Journal), I have opened an issue on Github and let see if mcooney-esristaff can help us with this. Cheers!
... View more
03-14-2018
08:52 PM
|
0
|
0
|
2247
|
|
POST
|
Hi Kathy Smikrud, I know how to do that but not using the template hosted on ArcGIS Online. I could help you doing so, adding some custom code to the existing template on Github, but afterwards you would have to add it to your organization (are you using ArcGIS Online or Portal). This way you would have to host it by your own or if you don't mind I could hosting it on Github for you. Would that work for you? Cheers!
... View more
03-13-2018
10:03 PM
|
0
|
2
|
2247
|
|
POST
|
Thanks Ramunas Kraujutis!! it works now! So finally I created this item: http://www.arcgis.com/home/item.html?id=444e615e7b9f471ab2a4c5d9194b538e#overview I have added this request to a Postman collection we started on Github. Thanks again!
... View more
03-13-2018
07:09 PM
|
2
|
0
|
2139
|
|
POST
|
Thank you very much Ramunas Kraujutis, I have just tried this: curl -X POST \ https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/CreateMapArea/submitJob \ -H 'cache-control: no-cache' \ -H 'content-type: application/x-www-form-urlencoded' \ -d 'mapItemId=4965122d0a9c4ea187fa643cda58c670&token=MY_TOKEN_HERE' But I'm still getting the same response, maybe I didn't understand your message, did I? Cheers, Raul
... View more
03-13-2018
10:18 AM
|
0
|
2
|
2139
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 07-11-2025 08:28 AM | |
| 1 | 06-09-2025 08:42 AM | |
| 1 | 02-18-2025 03:33 AM | |
| 2 | 02-18-2025 01:14 AM | |
| 1 | 11-21-2024 11:32 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-12-2025
03:46 AM
|