Solved! Go to Solution.
Are you looking for Radar?
I found something on GitHub and modified it a litte and converted to AMD.
http://driskull.github.com/esri-weatherunderground/
https://github.com/driskull/esri-weatherunderground
Originally came from this: https://github.com/brandoncopeland/esri-weatherunderground
This is just a simple example and could be expanded. I believe there's other API's that can do radar motion as well.
OK, if I understand this correctly I will need an api key from http://www.wunderground.com correct to get this to work correctly?
Yep. correct.
<script type="text/javascript" src="javascript/WURadarLayer.js"></script>
require([ "dojo/ready", "dojo/_base/connect", "modules/WURadarLayer" ]);
var wuradar = new WURadarLayer('#####');
map.addLayers([wuradar, more layers...)
Matt that's great! Thank you!
I downloaded the file, and placed it in my javascript folder in my Basic Viewer template project site. I then added the following to my index.html file:<script type="text/javascript" src="javascript/WURadarLayer.js"></script>
I saved this file as a plain file with a .js extension and didn't modify it. I signed up for an API key (###) which I then put in where you showed us in the ReadMe. I put the following line in layout.js at the top ....require([ "dojo/ready", "dojo/_base/connect", "modules/WURadarLayer" ]);
(I guess this new Dojo syntax is a bit different from the past, with things like dojo.require("esri.dijit.Popup"); )
I then put .....var wuradar = new WURadarLayer('#####');
into my list of layers and put it in my layer loading list...map.addLayers([wuradar, more layers...)
But I got an error "0x800a1391 - JavaScript runtime error: 'WURadarLayer' is undefined" from Vis Studio / IE.
So did I declare right? I am just beginning at Javascript thank you for any help. This was exactly what I was looking for, a radar loop! Thanks to you both!
And, does anyone know of an example using the standard RIDGE Radar? http://atlas.resources.ca.gov/ArcGIS/rest/services/Atmosphere_Climate/RIDGE_Precip_Radar/MapServer
That may also be helpful as the Wunderground API limits the amount of use.
I think I had the same error and the problem I found was that the .js file was in the wrong place and it could be read. I was using firebug to check the error.
var dojoConfig = { parseOnLoad: true, packages: [{ name: "esriTemplate", location: location.pathname.replace(/\/[^/]+$/, '') }, {name: "WURadarLayer.js", location: location.pathname.replace(/\/[^/]+$/, "") + '/javascript/WURadarLayer.js' }, { name: "utilities", location: location.pathname.replace(/\/[^/]+$/, '') + '/javascript' }] };
var radarloop = new modules.WURadarLayer('###');
The namespace is modules and that is how it must be called, per above. Now it works nicely.