|
POST
|
The browser will handle caching the files for you. Once you load the CDN, it will just use the cache for every subsequent request. You can check this via the Chrome Developer tools, when you refresh a page, you'll see it comes (from cache). This is a benefit of using the CDN, as it will be cached across your applications.
... View more
06-21-2016
08:52 AM
|
0
|
3
|
3319
|
|
POST
|
Are all three people working on the same file? Ideally, someone should own that widget and they maintain and update it. Maybe break out some functionality into helper modules and others could own those. As far as working in a team environment, git all the way. Learn the basics of git, then look at something like git flow. Centralized Workflow | Atlassian Git Tutorial Basically, add new features/fix bugs via a feature branch so others can keep working on their part. Make a pull-request, maybe have someone review it before it's merged, stuff like that. Git is invaluable in a team environment.
... View more
06-21-2016
08:40 AM
|
1
|
0
|
1059
|
|
BLOG
|
In the ArcGIS API 4 for JavaScript, a new layer type was introduced to help you do manage grouping your layers into like-minded categories. The GroupLayer provides some really interesting functionality for you to do pretty much exactly what it says, group your layers. Let's assume you have a Dynamic Map Service, like say this NOAA Storm Reports service. This is a handy little service that gives a quick overview of storm reports. However, it is a dynamic map service, which would normally be displayed in a MapImageLayer, however this layer type (formerly known as ArcGISDynamicMapServiceLayer) doesn't support popups in the initial 4.0 release. It's conceivable that the data behind these points might prove useful, so you may want to display popups for them in your application. There's an easy way around that, you could just use each individual layer in the service as a FeatureLayer and you can define popups and the world is right again. But maybe you have some logic in your application that requires you to treat this data as a single layer, such as turn them all off at the click of a button. Now you'll want to hug your GroupLayer. Let's look at what the code for that might look like. require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/layers/GroupLayer"
], function (Map, MapView, FeatureLayer, GroupLayer) {
var url = "http://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/NOAA_storm_reports/MapServer/";
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv",
map: map,
center: [-98.648, 36.374],
zoom: 5,
ui: {
components: ["zoom", "attribution", "compass"]
}
});
var titles = [
"NOAA HAIL Storm Reports (24 hours)",
"NOAA TORNADO Storm Reports (24 hours)",
"NOAA WIND Storm Reports (24 hours)",
"NOAA TORNADO Storm Reports (past week)"
];
var layers = ["0", "1", "2", "3"].map(function(index, idx) {
return new FeatureLayer({
url: url + index,
outFields: ["*"],
popupTemplate: {
title: titles[idx],
content: "{*}"
}
});
});
var groupLayer = new GroupLayer({
layers: layers,
visibilityMode: "inherited",
visible: true
});
map.add(groupLayer);
view.then(function() {
var btn = document.createElement("div");
btn.className = "esri-button esri-widget-button esri-interactive esri-icon-feature-layer";
btn.title = "Toggle Storm Data";
view.ui.add(btn, "top-right");
btn.addEventListener("click", function() {
groupLayer.visible = !groupLayer.visible;
});
});
}); What we've done here is added the Storm Report data as individual FeatureLayers, but we've wrapped them in a GroupLayer. Then we added a simple button to the UI that does one thing. It toggles the the visibility of the grouped storm data on and off. Notice that I set the visibilityMode of the GroupLayer to "inherited". This means that all the sublayers will inherit their visibility from the parent GroupLayer. You could change this if you wanted to some conditional visibility of layers in the GroupLayer and get fancy, but for this use case, everything just works. You can see a live demo of this application here. You aren't limited to wrapping FeatureLayers with the GroupLayer, you could group any layer types, which could prove very convenient when controlling the visibility of multiple map services in your application. So take the GroupLayer for a spin in your next ArcGIS API 4 for JavaScript application! For more geodev tips and tricks, check out my blog. Title photo via Mel Aclaro at group hug | Flickr - Photo Sharing!
... View more
06-09-2016
10:44 AM
|
0
|
0
|
1440
|
|
POST
|
If you search the buildreport.txt for stuff like " error" (the space is important) try and see if that can clarify what the issue might be? Are you using closure or uglify? If closure, what version of Java? You can check out the demo build app on github and compare your build profile with ours, and see if that helps. jsapi-resources/3.x/bower/dojo at master · Esri/jsapi-resources · GitHub I'm assuming this is 3.x, but 4.x isn't much different.
... View more
06-08-2016
07:32 AM
|
0
|
1
|
1650
|
|
POST
|
Thanks! Appreciate it. I don't have a sample using the widget samples, but I do have this simple sample on my github account. GitHub - odoe/esrijs-modular: Sample modular app
... View more
06-01-2016
08:12 PM
|
0
|
0
|
2587
|
|
POST
|
Yeah, I don't know the parks guide app, but that is some custom loading of non-module code. You can start here. Embrace your AMD modules Get familiar with how to write AMD modules and you'll be good to go.
... View more
06-01-2016
05:22 PM
|
2
|
0
|
2587
|
|
BLOG
|
It's that time of year again! We're in June, will it be hot, will we see the sun? It's always a coin-toss, but one things for sure, the 2016 Esri UC is right at the end of this month and if you aren't attending, someone in your organization probably is, maybe even you boss. So you're a developer or maybe you work with developers or manage developers in your organization. As developers, we get hung up on learning the latest tech, just to learn it, but sometimes we need to step back and look at what we are doing with that tech, or what we could do. A quick look at the agenda and you can already tell it's going to be a jam-packed week. You probably haven't even begun to think about what sessions you're planning to see, much less think about what you could see. Before joining Esri, I think I've been to about half a dozen UCs, I even had a booth and each year it was always a mad rush to try and figure out what I should spend my time learning. Relax. Don't be like me. Personally, I would be remiss if I didn't mention that you should check out the sessions I'm involved in. I'm lucky, I get to co-present with some great people during these sessions. Learn from your peers I'll admit, I'm more a Dev Summit kind of guy, but the UC is a great opportunity to see how all the cool technology that we like to build on actually gets used. Yes, all the cool SDKs and APIs we developers get so excited about actually have to be proven useful or we're just wagging our keyboards around. If you happen to be around on Monday night, the Lightning Talks are a great way to hear from other users on some cool stuff they've done or tips and tricks. These aren't typically done by Esri employees, these are users sharing real world experiences. The next thing I would recommend are the moderated paper sessions. The moderated paper sessions are where you can find some real gems. Plus, you get to support your peers working in your field or a particular industry. Remember, plenty of these presenters don't present often, some for the first time, so there may be some nerves, but I've learned so much over the years from users in these sessions, it's invaluable. Struggled with integrating that asset management system and massive infrastructure data into your GIS? Someone may have done just that, so go learn how they overcame similar challenges. Here are just a few sessions that stood out to me. 3D Lidar Point Clouds: Earth and Mars Based Navigation Modeling with ArcGIS Advanced Spatial Analytics for Forest Planning and Operation Asset Management for DOTs Developing a GIS in a Water Utility Managing Building Indoor Assets Using Collector & AGOL for Asset and Pavement Management GIS Support to Military Operations Multidimensional Extraction and Analysis of Buildings Utilizing Procedural Modeling, Lidar and Imagery with the ArcGIS Platform Trends and Analysis of Big Data for Transportation Again, if you are a developer I highly recommend popping in to a couple of the moderated paper sessions and see how users are actually using the technology and learn from their work. You may even find inspiration for your next project! Get the deets! The Esri UC is where you'll learn about all the latest on the ArcGIS platform, ranging from topics for the developer to the techs, to cartographers and analysts. It's a great time, if you are a developer, to brush up on some analysts skills. You may have been nose-deep in code so long you forgot how to do population projections or maybe you never touched the analysis part of GIS, go learn a little! I haven't done nose-to-the-stones geo analysis in a long time. I've done my fair share of hydro analysis and creating watersheds and all kinds of other tasks from my analysis days, but I like to at least brush up on these things once or twice a year so I don't lose touch. Here are some cool tech sessions from Esri you may want to check out. 2D Visualization with the ArcGIS API for JavaScript 3D Analysis: An Overview 3D Visualization with the ArcGIS API for JavaScript ArcGIS Pro: Mapping and Visualization Applying Spatial Analysis Techniques to Make Better Decisions ArcGIS Online: Data Exploration with Smart Mapping Extending the Operations Dashboard for ArcGIS Operations Dashboard for ArcGIS: Monitor Your Operations Introduction to Using Spatial Analysis in ArcGIS Online Spatial Analyst: Finding the Best Locations Using Suitability Modeling Leveraging Vector Tile Layers in Web Apps Vector Tiles: Styling Your Own Base Maps Desktop Mapping: Creating Vector Tiles Remember, these tech sessions are done by Esri employees, working directly with the tech on a first-hand basis. Take notes, ask questions, that's what we're there for! Although I have at least one session where I'll have to book it from one side of the convention center to the hotel at the other end in like 10 minutes, so if I'm in a rush at that time, sorry in advance. Protip - If you manage developers, don't go back to the office and make them learn all the cool stuff you saw. Give them a summary, ask them to investigate some subjects further, put them in contact with presenters you may have talked to. If they see a solution to a problem, trust me, they'll learn it! And if you really want to them to learn the details of the tech, approve their Dev Summit requests. Socialize Don't be a hermit. People attending the Esri UC are your peers, these are our peeps. Get to know some new people, attend a Special Interest Group, look up any social activities. Hang out in lounge areas and get to know some folks. Make sure to check out the Map Gallery to check out some cool cartographic maps. There's a reception on Monday afternoon where you can mingle. Wander the Expo and check out all the vendors. There's usually some cool schwag you can pick up and you'll probably see some vendors you can partner with to help you accomplish some tasks in your organization. There's also a GeoDev Meetup on Weds night that I highly recommend! I'm sure plenty of people will stay connected throughout the week on Twitter, so keep an eye out for what's going on. Watch the #EsriUC hashtag to see where people are drinking or just hanging out for the night. I would also use Twitter all the time at the UC to check if people were talking about one particularly cool presentation that I might want to jump in if the current one I was in wasn't doing it for me. Most of all, enjoy the UC. Learn a thing or two and have fun! For more geodev tips and tricks, check out my blog. Title photo via Gary J Wood San Diego Convention Center | Flickr - Photo Sharing!
... View more
06-01-2016
10:31 AM
|
0
|
0
|
2170
|
|
POST
|
You can check out the frameworks session from DevSummit Using Frameworks with the ArcGIS API for JavaScript | Esri Video I also have numerous posts on my own blog using everything from React and Ember to Elm and CycleJS odoenet - programming geo
... View more
05-29-2016
11:36 AM
|
1
|
1
|
2986
|
|
POST
|
The built.html has the dojoConfig omitted because it is embedded in the built file for you. jsapi-resources/build.profile.js at master · Esri/jsapi-resources · GitHub The built.html is copied to the build directory as index.html so the built app will run correctly. This is only for demonstration purposes. In a production environment, you should use some tooling to modify the HTML file. You can look at this sample here using Grunt that will modify the HTML file during the build process. esrijs-generator-demo/index.html at master · odoe/esrijs-generator-demo · GitHub This is using a tool called grunt-processhtml. I just didn't think it was worth piling on too much tooling for the demo app in the jsapi-resources repo
... View more
05-24-2016
09:53 AM
|
1
|
0
|
852
|
|
POST
|
You'll want to use the view.hitTest method to get graphics in the View. view.on("click", function(event) {
view.hitTest(event.screenPoint).then(function(response) {
var graphics = response.results;
graphics.forEach(function(graphic) {
console.log(graphic);
});
});
}); The benefit here over how you would have done it in 3.x is that in 3.x you would only get the top-most graphic that was clicked. Now you'll get any graphics under the location where you clicked by using the hitTest. You can also look at this sample. ArcGIS API for JavaScript Sandbox
... View more
05-19-2016
09:15 AM
|
1
|
3
|
4275
|
|
POST
|
This is a follow up video to a video published earlier. In this video, I cover a little bit more information on using the TypeScript Definition Files global namespace types versus using them as simply constraints. This video and the earlier video both provide a good overview of using the ArcGIS API 4 for JavaScript TypeScript Definition Files in a TypeScript project. You can read more info on my blog with more resources
... View more
05-18-2016
08:45 AM
|
2
|
2
|
7433
|
|
POST
|
Right now you should be able to do this. var g = graphic.clone();
g.geometry = newGeometry;
graphicsLayer.remove(graphic);
graphicsLayer.add(g);
... View more
05-16-2016
08:29 PM
|
1
|
0
|
4089
|
|
POST
|
Not sure exactly what cause is, but does it help if you put the require method inside the siteTimeout, to delay the map creation? Tested on my machine, and yeah, moving the require inside the setTimeout fixes the issue. You can also load the webmap, but delay the view creation until inside the setTimeout as well. require([
// modules
], function (
// modules
) {
var webmap = new WebMap({
portalItem: { // autocasts as new PortalItem()
id: "fd6d257add064e30b8e5ee21282b2e5f"
}
});
var isLegendVisible = false;
setTimeout(function () {
var elem = document.getElementById("splash");
elem.disabled = true;
elem.style.zIndex = -99;
elem.parentNode.removeChild(elem);
var view = new MapView({
map: webmap,
container: "viewDiv"
});
// ... other stuff
}, 4000);
});
... View more
05-10-2016
11:21 AM
|
2
|
0
|
1048
|
|
POST
|
That would be an asynchronous task. Watching for property changes doesn't necessarily replace events. There are still events in the API, but watching for property changes let's you get real specific on what it is you care about that might change on an object. It sounds like you want to be able to cancel something like a QueryTask, or the applyEdits or similar. In that case, we don't really have a mechanism in place to cancel a task. It's something we can look at, but once the request is in flight, we could only at best ignore the result, it doesn't mean the request didn't go through to the service and your edits didn't apply though. Once the request is at the server, not much we can do to cancel that.
... View more
05-09-2016
03:25 PM
|
1
|
0
|
4442
|
|
POST
|
The watch method returns what is called a WatchHandle that has a remove() method so you can stop listening for property changes. Accessor | API Reference | ArcGIS API for JavaScript 4.0 The prevent zooming in/out beyond extent stuff is separate. You would want to look at the constraints of the View to define those. MapView | API Reference | ArcGIS API for JavaScript 4.0
... View more
05-09-2016
03:01 PM
|
1
|
1
|
4442
|
| 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
|