|
POST
|
The Map doesn't have a spatialReference in 4.0, but the View does. MapView | API Reference | ArcGIS API for JavaScript 4.0 So you can do something like view.then(function() {
query.outSpatialReference = view.spatialReference;
// continue rest of code
});
... View more
08-04-2016
11:22 AM
|
1
|
2
|
3117
|
|
POST
|
You can do one of two things to get tokens, which you usually don't need to worry about too many details. Just add the IdentityManager and you'll get a dialog to log in. IdentityManager | API Reference | ArcGIS API for JavaScript 4.0 This authentication is only for the current session, refresh the browser and you are asked to log in again. The recommended method is to use OAuth. You can look at this sample. Access ArcGIS Online items using OAuthentication | ArcGIS API for JavaScript 4.0 Review the source code for this app by using "view source" or developer tools to check the source of this application. The key here is to create an Application in ArcGIS Online, and get an appId/clientId. Let me see if I can get the steps down for you here. Click on "Add Item" Go to the "Settings" tab for the item. Click on "Update" You'll see your "App ID" in there. I blurred it out, but it's really the client secret you do not want to share. If someone has your client secret, they can eat all your AGOL credits, so do not share it. I also like to add "localhost" to the redirct URI. Then when you move this production, add the domain for the server your application will be running from. Here is a link from that JSAPI sample to more docs on OAuth 2.0 ArcGIS Security and Authentication | ArcGIS for Developers Hope that helps.
... View more
08-03-2016
09:00 AM
|
2
|
1
|
1577
|
|
POST
|
Working with FeatureCollections in the ArcGIS API for JavaScript provides some flexibility in what data you can provide as well as how you can update that data. There's a demo in the docs that demonstrates how you might do this. In this demo, I cover how you can take a FeatureService of GPS data and replay the dataset in your map rather than just display all the GPS data at once. You can find the source code for the sample used here. For more GeoDev tips and tricks, check out my blog!
... View more
08-02-2016
11:41 AM
|
1
|
0
|
3140
|
|
POST
|
You have to remove and replace the entire graphic from the "graphics" collection for it to work.
... View more
08-01-2016
07:50 AM
|
0
|
0
|
2390
|
|
POST
|
You can modify the Embedded map URL using URL parameters as described here. Use URL parameters to modify embedded maps—ArcGIS Online Help | ArcGIS Everything else has to do with styling the iFrame used to embed the map and you can learn more CSS and iFrame properties here. <iframe> - HTML | MDN Hope that helps!
... View more
07-30-2016
01:58 PM
|
2
|
0
|
1498
|
|
POST
|
There are a couple of ways you can update existing graphics on the Map in 4.0. You can use the FeatureLayer#source or GraphicsLayer#graphics. If you want to update a Graphic, you can do it by cloning the graphics, update the clone, remove the original and add the update. Something like this. var originalGraphic = featureLayer.source.getItemAt(2);
var graphic = originalGraphic.clone();
graphic.geometry = updatedGeometry;
graphic.symbol = updatedSymbol;
featureLayer.source.removeAt(2);
featurelayer.source.add(graphic); That should work.
... View more
07-29-2016
11:16 AM
|
0
|
1
|
2390
|
|
POST
|
For Electron, you'll need to rename the node require. So maybe in your index.html you would have this <script>
var nodereq = window.require;
var dojoConfig = {
async: true
};
</script> The in your app, you could do this. var configs = nodereq('./helper');
var ipc = nodereq('ipc');
require(["esri/Map"], function(Map) {/*stuff*/}); And the Electron portion of your app can work as normal waiting for ipc messages. I've done some Electron stuff with the JSAPI in the past, maybe I should do a small post on it. Hope that helps.
... View more
07-27-2016
08:56 AM
|
3
|
1
|
2574
|
|
POST
|
You can customize the PopupTemplate however you want. Get started with PopupTemplate | ArcGIS API for JavaScript 4.0 You can also define custom actions for the Popup. Define custom Popup actions | ArcGIS API for JavaScript 4.0
... View more
07-14-2016
08:09 AM
|
1
|
0
|
2459
|
|
POST
|
You can use the "click" event of the View and "view.hitTest()" as shown here. MapView | API Reference | ArcGIS API for JavaScript 4.0
... View more
07-13-2016
08:34 PM
|
0
|
0
|
2459
|
|
POST
|
It looks like that warning comes from a new version of typings. I updated the repo to fix these updates. GitHub - odoe/esrijs4-ts: Sample EsriJS 4 TypeScript Application
... View more
07-13-2016
07:52 PM
|
0
|
0
|
2829
|
|
POST
|
The JS API doesn't provide specific editing support for external services/db like MongoDB. 4.0 doesn't have editing currently, but even in 3.x you can only edit FeatureServices. In both 3.x and 4.x you'll need to create a custom interface to edit your MongDB data. In 3.x, you'll want to do something similar to this sample. ArcGIS API for JavaScript Sandbox Where you can move the points, updating the coordinates and then you will need to publish those updates back to your service via a CRUD API of your own.
... View more
07-13-2016
08:08 AM
|
2
|
0
|
2459
|
|
POST
|
This would be a bug in 4.0. You can currently work around the issue by setting the view.extent to itself immediately after setting the visibility. on(layersElement, ".layers-item:click", function(e) {
var node = document.querySelector(".layers-item");
node.classList.toggle("visible-layer");
tileLyr.visible = !tileLyr.visible;
// add this line
view.extent = view.extent;
}); Thanks!
... View more
07-12-2016
09:41 AM
|
2
|
1
|
1448
|
|
POST
|
On line 70, you have and assignment instead of a boolean check. if (newstate = "on") Should be if (newstate === "on")
... View more
06-23-2016
01:45 PM
|
0
|
0
|
1558
|
|
POST
|
Maybe I worded it wrong. It will cache the files regardless of source, but it's a cache per domain. So whether they are hosted on your own server or via CDN, they'll get cached in the browser. I think we're saying the same thing though. All I meant was that by using the CDN, like using the Google CDN for jQuery, is that it's now cached in your browser for all pages to use.
... View more
06-21-2016
01:21 PM
|
0
|
1
|
3319
|
|
POST
|
If you use ctrl+f in the editor part of the window you'll get the find tools for the Ace editor used in that app. Ignore the other search one, I should remove that. The order of the layers is the order they are drawn, so be mindful of that.
... View more
06-21-2016
01:17 PM
|
1
|
1
|
2074
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 2 weeks ago | |
| 1 | 07-17-2026 10:17 AM | |
| 2 | 07-22-2026 11:24 AM | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|