|
POST
|
It's actually much easier to do in 4.0 now, because you don't need to know event strings to listen to. You want to know when view.extent changes, so you can just do: view.watch("extent", function(newValue, oldValue) {}); And that's it. You can see more in the docs here. Working with properties | ArcGIS API for JavaScript 4.0 And I've done a lot of posts on the Accessor, which is what powers all this, here.
... View more
05-09-2016
02:45 PM
|
2
|
3
|
4442
|
|
POST
|
For the first one, that was a typo on my part, sorry. For second one The tempBookmark you are updating is a single bookmark, so you keep updating the same one and adding it multiple times, but inside the bookmark widget, you basically added the same bookmark multiple times. Create a new bookmark on each loop and you should be ok.
... View more
05-06-2016
07:03 AM
|
2
|
1
|
4606
|
|
POST
|
Those query tasks are asynchronous, so won't be executed immediately. You have a couple of options var queries = [];
for (i = 1; i < allSysNames.length; i++) {
query.where = "SysName =" + allSysNames;
console.log("i inside the loop is: " + i);
queries.push(queryTask.executeForExtent(query));
}
// dojo/promise/all
all(queries).then(, function(results){
// another for loop
for (var j = 0; j < results.length; j++) {
console.log("j inside query task equals to: " + j);
}
});
console.log("outside the loop");
// or
// I prefer this method
var queries = allSysNames.map(function(name) {
query.where = "SysName =" + name;
return queryTask.executeForExtent(query)
});
// dojo/promise/all
all(queries).then(, function(results){
// another for loop
for (var j = 0; j < results.length; j++) {
console.log("j inside query task equals to: " + j);
}
});
console.log("outside the loop"); I have a couple of posts on Promises you could check out. Keeping Promises ArcGIS JavaScript Promises - odoenet Since the Promises is asynchronous, it will finish after your last console statement. Hope that helps a bit.
... View more
05-05-2016
01:06 PM
|
1
|
6
|
4606
|
|
POST
|
You would need to combine the features, via a FeatureCollection in order to be able to do that or else there would be no way to calculate which points to cluster between the two. In that case, you could pull from this sample to work out how to do it. Point clustering | ArcGIS API for JavaScript
... View more
04-28-2016
06:59 AM
|
1
|
0
|
746
|
|
POST
|
Sorry for confusion, For next release of 3.x, we'll include the calcite css used in the API. For 4.0, we are not really using the calcite stuff as widgets have been completely redone, so will not include it. I don't have a date for 3.17, but 4.0 should be out fairly soon. Thanks!
... View more
04-25-2016
02:59 PM
|
0
|
0
|
2154
|
|
POST
|
Shamelessly borrowed code from here Use JavaScript to Export Your Data as CSV - Chris Grimes http://codepen.io/odoe/pen/rerdrm Only exports what the table has downloaded though and only the raw data. Could tweak to export using column data probably.
... View more
04-22-2016
03:42 PM
|
1
|
1
|
5973
|
|
POST
|
Yes, these were omitted in the 3.16 bower release, but they shouldn't be used. You should be using either calcite-web, calcite-bootstrap, or calcite-maps. GitHub - Esri/calcite-web: Authoritative front-end development resources for Calcite design initiative. Includes extenda… GitHub - Esri/calcite-bootstrap: A Calcite theme and a custom build system for building Bootstrap apps. GitHub - Esri/calcite-maps: A framework for building map apps with Calcite styles and Bootstrap. Those calcite files on the CDN are not updated often and I'm still not quite sure what is using them. The API uses some icons in widgets for 3.x, but the 4.x release will have very minimal calcite in itself. I'll revisit this for next 3.x release, but 4.x Bower release will only include what is used in the API, as the options listed above are much better if you want to use the calcite styling. Thanks!
... View more
04-22-2016
09:47 AM
|
0
|
2
|
2154
|
|
POST
|
If my memory is correct, you should pass the token as a URL paramater, so at end of the URL ?token=TOKEN
... View more
04-14-2016
10:21 AM
|
0
|
1
|
4003
|
|
POST
|
I wouldn't think you'd have to, but what if you used JSON.stringify(data)? Try adding an empty geometry too, like geometry: {}
... View more
04-14-2016
09:45 AM
|
0
|
1
|
4003
|
|
POST
|
Roberts answer to send an object is correct. Is this a featureservice without geometries? I notice you're not sending any. You can look at the REST API here. ArcGIS REST API
... View more
04-14-2016
09:15 AM
|
0
|
1
|
4003
|
|
POST
|
I'll investigate this one. The bower build should only be omitting some demo files for the calcite-theme, but everything else should be identical to the CDN. I'm out of town for work this week, but will get to it when I get back. Thanks!
... View more
03-29-2016
07:03 AM
|
1
|
4
|
2154
|
|
POST
|
You can set the maxZoom of the map to prevent it from zooming past a certain level. var map = new Map("map", {
basemap: "topo",
center: [-122.45, 37.75],
zoom: 13,
maxZoom: 15
}); sample app JS Bin - Collaborative JavaScript Debugging
... View more
03-17-2016
01:24 PM
|
3
|
0
|
1557
|
|
BLOG
|
That's a method you get for free with anything created using dojo/_base/declare. It's a nifty little shortcut. dojo/declare.js at master · dojo/dojo · GitHub
... View more
03-16-2016
03:22 PM
|
1
|
0
|
891
|
|
BLOG
|
So last week at DevSummit, there was a lot of solid information being dropped as to the new ArcGIS API for JavaScript 4.0 features and capabilities. Let me tell ya, there's a lot of cool stuff to look forward to! You can get a pretty good overview of 4.0 via this slide deck. One recurring theme I thought came up a lot is the introduction of View Models in the API. You can read more about View Models and developer friendly widgets here. Basically, View Models separate the business logic of the Widget from the View of the Widget. To keep it simple, let's look at the Zoom widget. To give developers a better idea of how the View Models are used, the Widget View source code is included in the SDK. You can use this as a guide to build your own widgets. If we look at the Zoom ViewModel, it's pretty simple. It has two methods, zoomIn and zoomOut. That gives you a lot of room to build your own Zoom interface for your application. You could have a single button to only zoomIn when cities are visible and maybe switch to zoomOut when building footprints are visible. Like I said, it gives you a lot of freedom to build your interface as you want. I have this little sample using React with View Models. You can see a custom Zoom component here. Here's the portion that renders the component. render() {
let btnstyle = this.state.updating ? 'zoom-btns' : 'zoom-btns view-busy';
let maxstate = this.state.maxZoomed ? 'button raised grey narrow disable' : 'button raised grey narrow';
let minstate = this.state.minZoomed ? 'button raised grey narrow disable' : 'button raised grey narrow';
return (
<div className={btnstyle}>
<div className={maxstate} onClick={this.zoomIn}>
<div className="center"><i className="material-icons">add</i></div>
</div>
<div className={minstate} onClick={this.zoomOut}>
<div className="center"><i className="material-icons">remove</i></div>
</div>
</div>
);
} What this does is gray out the zoom buttons when you hit the min/max zoom levels. You can see the live demo here. I talked a lot about integrating the API with multiple frameworks in a session last week. You can see the slides here. A lot of this framework integration really hangs on using View Models to power the inner guts of the JS API and simply wraps new components around the View Models to create new interfaces. There was a really great session on building your own widgets last week that everyone interested in building widgets should look over. Here are the slides. It doesn't only cover custom widgets, but styling and css stuff, it's full of really great info. I'm pretty excited about View Models in the 4.0 API. I imagine people doing some really cool stuff with View Models because technically you don't need a View for your Widget. You could activate View Model methods via an Arduino that may be used for voice recognition. Maybe using some VR tech to allow you to call View Model methods via gestures or some other mechanism. Like I said, the View Models provide the business logic of interacting with a MapView or SceneView, how you use them is up to you. So hack away, build some cool apps and see what you can do! For more geodev tips and tricks, check out my blog!
... View more
03-16-2016
12:08 PM
|
1
|
3
|
3328
|
|
POST
|
Right now Vector Tiles are not supported in the print service, so the JSAPI will substitute the street service for now. You can see the last slide of this presentation from DevSummit for that question. DevSummit 2016: Vector Tiles in the ArcGIS Platform // Speaker Deck That functionality will hopefully come in a future release.
... View more
03-16-2016
10:39 AM
|
2
|
0
|
2776
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 2 weeks ago | |
| 1 | 07-17-2026 10:17 AM | |
| 2 | a month ago | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|