|
POST
|
var radarloop = new modules.WURadarLayer('###'); The namespace is modules and that is how it must be called, per above. Now it works nicely.
... View more
01-29-2013
07:35 AM
|
0
|
0
|
1540
|
|
POST
|
I actually have the same question. I want to use popupTemplate for to create an "Identify" for all our layers, like in ArcMap. Only when they are visible of course. For all features, all layers. Or at least top feature of all layers would do for now. But so that it has that little "arrow" next to the close button in the popup Infowindow that lets us page through all the layers (example would be 1 of 3, where there are 3 coincident points that Identify finds and puts in the popup.) Hopefully this method can be extended for not just Feature Layers (most of our layers are Feature) but also Dynamic Layers. But based on a few other threads with samples it seems like we have to handle Dynamic differently than Feature? I just want popups like ArcGIS.com viewer provides. They "just work"! Identifies all features, any type of layer. It seems like all the various samples here have to be "glued" together to make this "Identify" functionality or tool. I recommend to ESRI they consider including this in the next Basic Viewer template: a robust, configurable Identify tool. (And hierarchical Table of Contents (like ArcMap or AGSTOC) and Query Widget.) For now, I've just coded in a popup InfoWindow for every layer manually and enabled it with over a dozen blocks of the following: dojo.connect(LayerName, "onClick", function (evt) { map.infoWindow.setFeatures([evt.graphic]); map.infoWindow.show(evt.mapPoint); }); This doesn't provide the little arrow that pages through multiple layers (should it, out of the box, with popup dijit?) that are coincident and doesn't work on Dynamic layers. Also there is a better way with some looping code I have not implemented yet. I will experiment with the code examples above soon. Thank you Diana, dcastano and evtguy for posting!
... View more
01-25-2013
11:09 AM
|
0
|
0
|
2261
|
|
POST
|
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. Thanks Bill. You are right, firebug shows me it looks for WURadar at "NetworkError: 404 Not Found - http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/modules/WURadarLayer.js". How did you get yours working, as an AMD module or inline code? The new code by Matt Driscoll is AMD and a module, from my understanding. Our site calls the ESRI edge server for the API and thus also Dojo. So the Dojo is a hosted CDN (wherever ESRI points to). I am just beginning to learn Dojo.... There is documentation on the Dojo site regarding use of a CDN while using local modules. Furthermore, since I am still developing the site it does not have a final URL yet, it just runs out of the local webserver folder Visual Studio 2012 generates on the fly. However there is a way to "detect" the current URL with Javascript, then tack on something additional, to tell it to load a local module, in dojoConfig, even though the library itself is CDN hosted. http://dojotoolkit.org/documentation/tutorials/1.8/dojo_config/ has this exact exdample of a local module with Google CDN of Dojo Lib loading a local module "demo'. If you need to detect the local URL the Javascript syntax location.pathname.replace(/\/[^/]+$/, "") is supposed to find current URL so you can append soemthing e.g. "+ /javascript" to get the path to our local module. For example, in my project structure, which is the Basic Viewer template, I have a javascript folder. (ProjectName/javascript which contains layout.js as well as WURadar.js). So I put the appropriate code into dojoConfig which we made a separate file, preLoad.js. I put it above the ESRI API (and tried it below, every which place) in the index.html. So this is our preLoad.js
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'
}]
};
I also tried putting it in the root of the project folder and referring to just / above. In my layout.js I tried both the old 1.6 require syntax dojo.require("modules.WURadarLayer"); as well as the new AMD syntax, no luck. It always says 'WURadar is undefined'. When I tried inline code, using brandoncopeland's original code as well as Matt's, I got other weird syntax errors. While keeping it modular would be best, as Matt designed, if anyone has this working via inline code in layout.js that works, I'd be glad if you could share that as well. Or could you share the steps you took to get it working Bill, as a module? Other documentation I reviewed: http://dojotoolkit.org/reference-guide/1.8/loader/amd.html and http://dojotoolkit.org/reference-guide/1.7/quickstart/cross-domain.html
... View more
01-24-2013
05:12 AM
|
0
|
0
|
1540
|
|
POST
|
Is it possible to add this toolbar to the Basic Javascript viewer: http://help.arcgis.com/en/webapi/javascript/arcgis/samples/toolbar_navigation/index.html if so, does it go in the layout.js file? Thanks, BIll Hi Bill, The addition of additional widgets to the esri sample Viewers is exactly what I'm working on now, too. I want to add the AGS TOC widget that adds a layer table of contents like ArcMap. http://forums.arcgis.com/threads/75725-BasicViewer-with-TOC I am just beginning to read the appropriate DojIt appears is you must work with the Dojo BorderContainer and ContentPane. http://dojotoolkit.org/documentation/tutorials/1.8/dijit_layout/ It is probably best practice to have widgets each in separate .js files. My layout.js has grown enormously and I will be refactoring and modularizing it soon. I will post when I have results or insights.
... View more
01-23-2013
08:29 AM
|
0
|
0
|
1317
|
|
POST
|
The ESRI JS Basic Viewer template has a separate Layer List widget and Legend. This layer list does not group layers hierarchically. Also it seems to make sense to combine the layer list and legend. The AGS TOC widget by poster nliu here is great, it does these both. http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/examples/toc.html Has anyone integrated this with the ESRI Basic Viewer template? If not.. I will try to do this, and share back.
... View more
01-21-2013
09:20 AM
|
0
|
10
|
3978
|
|
POST
|
With the help of great ESRI customer support we solved this. For my example, here is the code:
geocoder.startup();
esri.setRequestPreCallback(updateLocator);
dojo.connect(geocoder, "onFindResults", function (results) {
dojo.some(results.results, function (result) {
//display a popup for the first result
map.infoWindow.setTitle(i18n.tools.search.title);
map.infoWindow.setContent(result.name);
map.infoWindow.show(result.feature.geometry);
return true;
});
});
dojo.connect(geocoder, "onClear", function () {
if (map.infoWindow.isShowing) {
map.infoWindow.hide();
}
});
}
function updateLocator(ioArgs) {
if (ioArgs.url === "http://sagisservices.thempc.org/saint/rest/services/Locators/SAGIS.CENTERLINES/GeocodeServer" + "/findAddressCandidates") {
ioArgs.content['Street'] = ioArgs.content.singleLine;
}
return ioArgs;
}
This works as above, like a charm!
... View more
01-17-2013
12:17 PM
|
0
|
0
|
1260
|
|
POST
|
nliu this is fantastic! Have your or anyone integrated this into ESRI's Basic Viewer sample viewer template? I'm just beginning with javascript and I would be very appreciative if anyone that has integrated these could share their code.
... View more
01-17-2013
09:42 AM
|
0
|
0
|
1438
|
|
POST
|
Yep. correct. 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.
... View more
01-17-2013
07:33 AM
|
0
|
0
|
1540
|
|
POST
|
If my address search field is Street and the locator URL is http://sagisservices.thempc.org/saint/rest/services/Locators/SAGIS.CENTERLINES/GeocodeServer would the code be the following, below? function updateLocator(ioArgs){
if(ioArgs.url === "http://sagisservices.thempc.org/saint/rest/services/Locators/SAGIS.CENTERLINES/GeocodeServer" + "/findAddressCandidates"){
ioArgs.content['Street'] = ioArgs.content.singleLine;
}
return ioArgs;
}
Where do we put this, after the new esri.dijit.Geocoder? After geocoder.startup()? I tried it in a few places and still got the following outgoing JSON request http://sagisservices.thempc.org/saint/rest/services/Locators/SAGIS.CENTERLINES/GeocodeServer/findAddressCandidates?singleLine=1%20E%20Bay%20St&f=json&outSR=%7B%22wkid%22%3A102100%7D&outFields=*&callback=dojo.io.script.jsonp_dojoIoScript25._jsonpCallback However, of course when I modified it by hand to put Street in, I got the right return. Without it, I got the standard JSON 400 error "Street or Intersection required". Is the code above right, and where shall I place it? Thank you all!
... View more
01-15-2013
06:16 AM
|
0
|
0
|
1260
|
|
POST
|
Is it decided that this issue will indeed be fixed, so the geocoder dijit can use custom address search fields? If not I can look in to this workaround, but we can wait if this is a fix that is planned. Thanks!
... View more
01-14-2013
11:23 AM
|
0
|
0
|
1260
|
|
POST
|
This widget is recommended. I am using it in an app that we are designing currently for internal requirements (or i would give you a link to check how it works )but the link provided by jsn should get anyone going with a well presented common TOC. Awsome work from the developer. [ATTACH=CONFIG]20446[/ATTACH] Thanks jsn for providing the link. I'm going to attempt to integrate this TOC/Legend above as well. Creating a map with several groups of layers that each have over ten sublayers, needs a hierarchical layer menu, e.g. a TOC like ArcMap itself. Combining a TOC and Legend in this case just make sense. It would be great if ESRI would incorporate this widget into the Basic Viewer sample javascript viewer. However for now I will integrate the widget above.
... View more
01-14-2013
10:26 AM
|
0
|
0
|
922
|
|
POST
|
I have seen the examples and API Reference. Only with an arcgisGeocoder it is possible to set an placeholder. Not with the esri.dijit.geocoder: var geocoder = new esri.dijit.Geocoder({ map: map, autocomplete: true, esriGeocoder: { name: "Zoek plaats/straat", placeholder: "Zoek Straat/Plaats" NOT WORKING } },"search"); I also did some element inspector on Google Chrome. Does anyone know how to set the placeholder <input aria-haspopup="true" id="search_input" tabindex="0" placeholder value="" autocomplete="off" type="text" data-dojo-attach-point="inputNode" data-dojo-attach-event="ondijitclick:_inputClick" role="textbox" style=""> Try putting it in "value". See the "whole enchilada" section on the GitHub page for this dijit https://github.com/Esri/geocoder-search-widget-js/blob/master/resources/media_wiki.txt Note: we are waiting for a fix for using this dijit where the queried JSON field is something that is not 'SingleLineInput', e.g. Streets, as discussed in detail in the Sample Viewer thread.
... View more
01-11-2013
04:50 AM
|
0
|
0
|
491
|
|
POST
|
Update: The SingleLineInput field is indeed hard-coded into the dijit Geocoder, but they are looking in to updating this. I'll post when it's fixed. In the meantime tasks.locator is an alternative.
... View more
01-11-2013
04:01 AM
|
0
|
0
|
1317
|
|
POST
|
dawenx you're right, I don't see a Search anywhere either. This should be added back. FYI I loaded that page fine in FF 17.
... View more
01-10-2013
04:57 AM
|
0
|
0
|
889
|
|
POST
|
the website will take some getting used to, but I like the look and feel of it so far. Looking forward to seeing the full list of enhancements and bug fixes. Hm. The website has been "mobilified". For touch navigation on mobile devices I suppose the interface is good. axxl et al what do you think the best new things are with the new Dojo? Will you do anything new now that leverages the new Dojo? Just curious, thanks.
... View more
01-10-2013
03:44 AM
|
0
|
0
|
889
|
| Title | Kudos | Posted |
|---|---|---|
| 23 | 12-16-2014 10:46 AM | |
| 2 | 06-06-2014 06:45 AM | |
| 1 | 12-15-2014 01:07 PM | |
| 1 | 07-14-2014 01:18 PM | |
| 1 | 07-15-2014 05:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|