|
POST
|
It looks like scopemap won't work anymore, but according to Dojo docs you should be able to load custom namespaces for different dojo libraries to work with packages you define. Granted, I have not tried this, but could be worth investigating if you need to maintain some legacy compatibility. http://dojotoolkit.org/reference-guide/1.7/loader/amd.html#relocating-module-namespaces
... View more
09-12-2012
06:25 AM
|
0
|
0
|
1037
|
|
POST
|
Getting access to dojo/request would be pretty nice. It looks like a slick module to wrap all the xhr goodies. Notice I said 'nice', not critical. Personally, I've been making heavy use of DnD lately and it looks like it got some updates in 1.8 for touch capabilities, so that would be 'nice'. Glad to hear 3.2 is coming up, along with some css improvements.
... View more
09-12-2012
06:15 AM
|
0
|
0
|
1797
|
|
POST
|
Can you use Firebug or Chrome dev tools to see what the responseObject looks like? Also, you should wrap 'LyrName' with double quotes, so it's "LyrName" to be valid JSON. JSON doesn't use single quotes. You can usually check your JSON validity wth this site. http://jsonformatter.curiousconcept.com/
... View more
09-11-2012
10:11 AM
|
0
|
0
|
2025
|
|
POST
|
I played with this a little bit and the first error was that you had "Symbol" in your showResults method instead of "symbol", but the ESRI earthquake service doesn't work the way as expected with the Find Task. http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/RecentEarthquakesRendered/MapServer Warning - lots of guessing ahead Use the Find method in that REST page and you'll see it returns no attribute or geometry results. I'm guessing it's an event layer in the service generated from a table/rss feed and not an actual shapefile/featureclass. Again, I'm guessing the Find Task doesn't pull the data you expect from a service generated this way. However, when I use the Query Task to pull the data, geometry and attributes are returned, so that may be an alternative. Not as robust as the find task, but usable. Also, in the future you may want to simplify your demo for questions to help narrow down the errors. Hope that helps a little.
... View more
09-10-2012
08:56 AM
|
0
|
0
|
604
|
|
POST
|
I had that problem, but only with jQuery. It occured before I figured out you need to use
define.amd.jQuery = true
I notice you're also using backbone.js. In order to use to use Backbone.js with AGS 3.x/Dojo 1.7 (and really to use it in Require.js without a custom Loader class with .noConflict statements) is to amdify them. Check out these amd friendly repos for backbone and underscore. https://github.com/amdjs/backbone https://github.com/amdjs/underscore They basically use a tool like volo/amdify to wrap the libraries in define module statements. That may be a cause of your issue as well. Take note that the amdify'd libraries are going to look for lower case define/requrie statements of 'jquery', 'underscore', 'backbone'. Since you are looking into these libraries as well, you may want to check out a drop-in replacement for underscore called lodash which is optimized to perform faster than underscore. I was a little hesitant about it at firstm, but once you run the included benchmark, the results are pretty impressive.
... View more
09-04-2012
05:42 AM
|
0
|
0
|
930
|
|
POST
|
I'm no help on the dojo build. I tried getting it set up, but after a few tries I just went back r.js. With a fold structure like this.
release/
src/
- index.html
- js/
- stylesheets/
- templates/
I have a documented app.build.js file looks like this.
/**
* This is the build file I have started using
* to build my ArcGIS JS API 3.0 apps, which are
* based on Dojo 1.7. I used a similar build file
* when I was using Require.js, so it wasn't much different.
*
* I tried using the Dojo Build Tools, but it just seemed
* way too bloated to download the Dojo SDK, sort my files,
* blah blah blah. With r.js I can use Node NPM to
* npm install requirejs and just use the following command
* r.js -o src/js/app.build.js
* Done and done!
*
* This build file is meant to be used with r.js
* http://requirejs.org/docs/optimization.html
*
* For more details on options, you can review
* the sample r.js build file
* https://github.com/jrburke/r.js/blob/master/build/example.build.js
*/
({
appDir : "../",
baseUrl : "js",
dir : "../../release",
paths : {
"jquery" : 'libs/jquery/jquery-1.7.2.min',
"jqueryui" : 'libs/jqueryui/jquery-ui-1.8.20.custom.min',
"jquery.boostrap" : 'libs/boostrap/bootstrap.min',
"underscore" : 'libs/lodash/lodash.min',
"backbone" : 'libs/backbone/backbone-min',
/**
* This is key. Since the namespaces of dojo & esri,
* even dojox and dijit come from the ArcGIS CDN, use the
* empty: scheme so r.js doesn't try pull in these
* dependencies.
* http://requirejs.org/docs/optimization.html#empty
*/
"dojo" : "empty: ",
"esri" : "empty: ",
"text" : "empty:"
},
/**
* r.js uses uglifyjs by default.
* https://github.com/mishoo/UglifyJS/
*
* If you run r.js via java, you can use google closure.
* I tried to integrate closure, but java on my work
* machine kept punching me in the face. Stick with uglify,
* a dude on twitter told me it was faster anyway.
*/
optimize : "uglify",
/**
* This doesn't work as intended for me.
* According to docs and google groups, this
* should remove all combined files when
* optimizing a whole project
*/
//removeCombined : true,
/**
* This option will grab all the text! calls and
* place them in your optimized file to avoid
* making XMLHttpRequests to load the files
*/
inlineText : true,
/**
* This is optional, as setting the modules
* will create a combined file of all dependencies
* in the release folder. You get a single larger file
* to load rather than multiple smaller files.
* Use at your own discretion.
* */
modules : [
{
/**
* I optimze my app file, because I use
* my main file to set up my dojoConfig.
* If doing a single js file optimization,
* DO NOT include the dojoConfig file
* to be included. It will blow you up.
* Optmize the next entry point into your app.
*/
name: "app"
}
],
/**
* Will make your css a single line file
*/
// I had an issue in one app where this caused some issues. Didn't track it down, but only
// happened in the one app. I should look into it further. Just disable if it causes problems.
optimizeCss : "standard",
/**
* Ewww, RegEx. It's easy though,
* just include files/folders you don't want to
* get exported to your release build folder.
*/
fileExclusionRegExp : /\.(coffee|coffee~|js~|html~|css~|swp|rb|lnk)|sass|.sass-cache|build/
})
Hope that helps.
... View more
08-29-2012
05:26 PM
|
0
|
0
|
586
|
|
POST
|
With the move to Dojo 1.7, there really is no longer a need to use Require.js to handle your module loading. You can take full advantage of the dojo define and require loaders. I put up a posting here explaining my zero-day move from AGS JS API 2.8 to 3.0 and moving from Require.js to full Dojo. http://odoe.net/blog/?p=307
... View more
08-29-2012
08:56 AM
|
0
|
0
|
930
|
|
POST
|
I think you need to add the popup.css file in your page. <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/css/Popup.css">
Yeah, I added it in your sample it shows up correctly now.
... View more
08-23-2012
11:02 AM
|
0
|
0
|
1684
|
|
POST
|
Dereks solution below is way better than my css hack.
... View more
08-20-2012
09:43 AM
|
0
|
0
|
1059
|
|
POST
|
It looks like the sample was written to keep application specific objects in their own namespace. For example, when you write var map = new esri.Map("map"); 'map' is bound to the Window object of the browser, which is basically the global namespace. By declaring var app = {}; // This is an empty object, equivalient to window.app app.map = new esri.Map("map"); // map is now bound to window.app.map In the print widjet example, all the application specific values are now in window.app (map, printer, symbols, toolbar). It's a method of organizing the code in the application. It's interesting that it's done in the Print Widget, I don't think I've seen it in other esri js samples before. It's not a strict rule, more of a best practices kind of thing to keep the global namespace clean. It's not mentioned their coding guidelines. In this case maybe there are othe common libraries that may already have a window.printer object defined and they wanted to avoid overrriding it.
... View more
08-20-2012
06:45 AM
|
0
|
0
|
549
|
|
POST
|
try something like this
var m = moment(1300406400000);
console.log(m.toDate());
// result is Thu Mar 17 2011 17:00:00 GMT-0700 (Pacific Daylight Time)
console.log(m.format('M/DD/YYYY'));
// result is "3/17/2011"
... View more
08-17-2012
03:19 PM
|
0
|
0
|
846
|
|
POST
|
Dates are my kryptonite, but to I've had really good luck with moment.js http://momentjs.com/ I was having issues between IE and Chrome parsing dates, this little lib helped simplify the process. The draw for me was it could easily handle asp.net json dates. Maybe it could help you out.
... View more
08-17-2012
02:15 PM
|
0
|
0
|
846
|
|
POST
|
I'm not horribly famiiar with with the dojo date library, but if you add 'a' to your format it will give am/pm or change 'h' to 'H' to get 24 hours time, because it looks like maybe it could be 5 hours behind or 7 hours ahead. Looking at the dojo docs for the dojo.date.locale.format, you may need to adjust for timezone and timezone offset to get the correct result. http://dojotoolkit.org/reference-guide/1.7/dojo/date/locale/format.html
... View more
08-17-2012
07:23 AM
|
0
|
0
|
652
|
|
POST
|
You could try styling the anchor to look like a button. I just copied the various dijit styles of the button to the anchor.
a.esriPrintout
{
text-decoration: none;
font-weight: bold;
display: inline-block;
color: #421B14;
width: 160px; /** this was set in the demo page **/
cursor: pointer;
margin: 0;
line-height: normal;
vertical-align: middle;
white-space: nowrap;
text-align: center;
/** This is where the button look starts to take shape **/
border: 1px solid #DEDEDE;
border-bottom: 1px solid #DEDEDE;
padding: 0.1em 0.2em 0.2em 0.2em;
background: white url(images/buttonEnabled.png) repeat-x top left;
}
a.esriPrintout:hover
{
color: #5EC5E6; /** I just picked something that would stand out **/
}
Luckily they gave the anchor a class that could be reached pretty easily without funky css selectors.
... View more
08-16-2012
02:36 PM
|
0
|
0
|
613
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | 3 weeks ago | |
| 1 | 12-09-2025 08:20 AM | |
| 1 | 11-13-2025 03:13 PM | |
| 2 | 11-06-2025 11:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10 hours ago
|