|
POST
|
Ok, this is killing me. I recently started usiing MVC4 and the new Web API to build an app. Everything works great when running in Visual Studio and even works fine when running from my deployment server if I access the url as localhost/application, but once I change to the site name //<servername>/application it looks like the regex for loading modules with Dojo CDN break. Here is my main.js
(function () {
'use strict';
var root = this;
require({
async: true,
parseOnLoad: true,
aliases: [["text", "dojo/text"]],
packages: [
{
name: "views",
location: location.pathname.replace(/\/[^/]+$/, "") + "Scripts/app/views"
}, {
name: "models",
location: location.pathname.replace(/\/[^/]+$/, "") + "Scripts/app/models"
}, {
name: "helpers",
location: location.pathname.replace(/\/[^/]+$/, "") + "Scripts/app/helpers"
}, {
name: "widgets",
location: location.pathname.replace(/\/[^/]+$/, "") + "Scripts/app/widgets"
}, {
name: "app",
location: location.pathname.replace(/\/[^/]+$/, "") + "Scripts/app"
}
]
}, ['app/run']);
}).call(this);
I am not using the bundler for my modules Here is my Script Render function on my cshtml file @Scripts.Render("~/bundles/jquery",
"~/bundles/jqueryui",
"~/Scripts/toastr.js",
"//serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3compact",
"~/Scripts/app/main.js"); The error I get is http://serverapi.arcgisonline.com/jsapi/arcgis/3.2compact/js/dojo/dojo/Scripts/app/run.js 404 (Not Found) So for some reason, it looks like location.pathname.replace() regex isn't working when using the servername, but is fine when using localhost. If anyone has deployed successfully a MVC4 app in this manner, I'd appreciate any help. As it is, I'll need to work on reworking this as a non-MVC4 app in the meantime.
... View more
01-17-2013
01:58 PM
|
0
|
6
|
6267
|
|
POST
|
That's because the first one is using version 1.6 if the API. When Esri upgraded the API at version 3.0 to work with Dojo 1.7, the way Dojo now handles module loading requires that you run it within a server environment.
... View more
01-17-2013
05:33 AM
|
0
|
0
|
2316
|
|
POST
|
Well, 3.3 uses straight 1.8.0 You can check in Chrome/Firefox console dojo.version
Object
flag: ""
major: 1
minor: 8
patch: 0
revision: 29458 I have not seen a changelog for patches, you may want to ask over at the dojo community board on that one. You can check commit logs on github, but not really useful in this case. Esri includes full dojo/dijit/dojox/dgrid in their builds, so you should be good there. You shouldn't need to include anything extra from in your build unless maybe you have a need for something that may have been fixed in a patch update. I have never had much luck with dojo build tools and the esri api, but apparently others have had better luck than myself. http://ideas.arcgis.com/ideaView?id=087E00000004Rx9&returnUrl=%2Fapex%2FideaList%3Fc%3D09a300000004xET%26category%3DDevSummit%2B2013 I hope to pick his brain at Dev Summit this year about this subject.
... View more
01-17-2013
05:30 AM
|
0
|
0
|
1014
|
|
POST
|
esr/map doesn't actully return an object, not last I checked. You could try declare('mymap', [esri.Map], { ... });
... View more
01-16-2013
11:07 AM
|
0
|
0
|
865
|
|
POST
|
Where are you placing this require statement? I just tried it and it worked, even returned a utils object. Is this inside a define() module or the entry point for your application?
... View more
01-16-2013
08:05 AM
|
0
|
0
|
815
|
|
POST
|
Let me see if I follow. You have two identify tasks, one triggered by a map click at all times and one triggered by a button then a map click, correct? Since both are triggered by a map click, in the map click handler you check to see what state you are in? Something like
connect.connect(map, 'onClick', function(e){
if (ID_STATE = 'DEFAULT') {
// execute =idtask1
} else if (ID_STATE == 'BUTTON_CLICK') {
// execute idtask2
}
});
Does each identify task have it's own handler or are you passing the same handler function to each Identify Task? If you need to process the results differently, then yes you would need to do the same, but if that's the case, then I suggest a different handler per Identify Task. But, if you are handling your clicks this way, might a suggest a different method. This actually has worked since the API moved to Dojo 1.7, I just didn't have a real need for it until earlier this week. Dojo has a dojo/on method that works on all dom events. Since the map is a dom element and has a click event, this will work. http://dojotoolkit.org/reference-guide/1.8/dojo/on.html Here is a sample working with a map https://gist.github.com/4542944 So in your case you could do something like this.
var handler1 = on.pausable(map, 'click', function() {
// stuff
idtask1.execute(/*stuff*/);
});
on(button, 'click', function() {
// here's the cool part, this event only happens one time
var id_handler = on.once(map, 'click', function() {
idtask2.execute(params, function() {
/** handle results **/
handler1.resume(); // turn the default map click handler back on
});
});
});
Add in an error handler to resume default map click events and you are good to go.
... View more
01-16-2013
06:08 AM
|
0
|
0
|
726
|
|
POST
|
You'll want to create a date object from the data before displaying it. So something like var d = new Date(1352935936000). Then you can use d.toString() and format your date accordingly. http://msdn.microsoft.com/en-us/library/ie/ff743760(v=vs.94).aspx Dojo comes with dojo/date/locale that can help you format the dates as well. http://dojotoolkit.org/reference-guide/1.8/dojo/date/locale/format.html
... View more
01-14-2013
09:13 AM
|
0
|
0
|
1371
|
|
POST
|
One thing in 1.8 I want to give a try is the router for single page apps. Could be interesting.
... View more
01-10-2013
05:45 AM
|
0
|
0
|
1779
|
|
POST
|
Looks like it's something I have to changed in IIS. http://forums.arcgis.com/threads/1507-Beta-10-FeatureServer-Bug?highlight=arcgisoutput+folder Got it.
... View more
01-10-2013
03:16 AM
|
0
|
0
|
606
|
|
POST
|
I wasn't exactly sure to post this, as I'm not sure if it's something that needs to be configured in the MXD before publishing or I borked something on the install of my Server. When I send the request for htmlPopup to the REST endpoint for a FeatureService, the paths to the arcgisoutput folder are pointing the server name and not the IP. For example, http://testserver1/arcgisoutput/ATTID_NUMBER.jpg Instead of http://ip.add.ress/arcgisoutput/ATTID_NUMBER.jpg Everything else on the serve has worked just fine, all services work, I can edit FeatureServices no problem. One thing on this box I do a bit different if it matters is I copy my mxd to this machine from a different machine that has ArcMap on it and use the Web Manager to publish it from the localhost. Right now, I parse out the name with the base url manually to get it to work, but I'm thinking I must have done something wrong along the way and maybe there was a simple fix. Thanks.
... View more
01-09-2013
01:15 PM
|
0
|
1
|
971
|
|
POST
|
nevermind, my reading comprehension is poor at best before coffee
... View more
01-08-2013
04:38 AM
|
0
|
0
|
2743
|
|
POST
|
dojo/query does most DOM selection that jQuery does. Just to chime in, I really think a lot of people give Dojo a bad rap. Since 1.7 the docs for Dojo have vastly improved with lots of credit to the Sitepen guys. The reference docs are not the easiest to navigate, but the other documentation works great. You find more jQuery info online in general because of the popularity. The implementation of dgrid for dojo is a big improvement over dojo DataGrid. My biggest gripe with Dojo is the way dijits are an overabundance of divs/spans. Styling can take more work than I'd like sometimes, but overall I have been very happy with the Dojo tools I have at hand for the work I do. I've pretty much removed jQuery from my Esri projects without missing anything.
... View more
12-31-2012
04:11 PM
|
0
|
0
|
2706
|
|
POST
|
Funny you should ask, I am in the process of prototyping some stuff that does just this, so I'm curious to see what approaches people may have. I have heard people mention they implemented it, but not the actual steps or how to handle the nuances. I haven't coded much beyond capturing errors when offine and storing some points. I have not yet pushed an edit on reconnect. But, here is my plan if I may share in a rough format, On the editing portion, I have a simple add feature (pt, polygon, line) button to do edits. So far, I listen for an error on my base layers onUpdateEnd, it's jsut an error message though, not an error code, but for now I assume I've lost connection. Then I popup a message that the user is now working in a "limited offline mode". At this point, I start to store basic edit info in the local storage. I try to strip it to x,y's and attributes unique to the edit. Local storage is small. It's supposed to be 5MB, but you can probably only rely on 2.5MB and even then if they are using other apps accessing local storage, even less. It's the returning to online mode I have not fully tested yet. If my base onUpdateEnd does not return an error, return to online mode and retrieve updates from local storage, push them out to the featureservice, clear the local storage and voila, done, magic 😄 In theory it sounds great. Major snag I hit was the base layer tiles. You only have access to cached tiles, once you pan somewhere new no more tiles. I'm not sure if you can somehow precache tiles to the browser without the user knowing. Maybe sending a request to download 2 or 3 extra tiles around extents without user knowing. I just imagine that would add some overhead, but won't know until I try to test it. This would give you some wiggle room, but not a lot. This is all just rough ideas I've been toying with. I have by no means successfully implemented these in a production environment. I'm sure there is a better way to detect when I've gone offline, but this little method works so far, but only afer you pan the map and no data is returned. I suppose you could try to listen for error event from the feature you are trying to edit? I think the key with an app that can do any edits outside of a desktop environment is simplicity. The simpler it is overall, the easier it will be to handle an offline situation. Local storage will only get you so far. I have been using a cool add-on for FireFox called Elite Proxy Switcher to quickly test offline mode with one button click. I just point the proxy to an obscure port on my localhost. Sorry, just thinking out loud.
... View more
12-21-2012
07:45 AM
|
0
|
0
|
642
|
|
POST
|
The minimum version of AGS to run the legend from an internal service is 10.0 SP1. Make sure you at least have SP1 installed or make the service publicly available and it be generated via arcgis.com http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/legend.htm If the layer is an ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer created using ArcGIS Server 10.0 SP1 or higher the legend is generated using the REST Map Service legend resource. If the layers are version 10 or lower the legend is created using the ArcGIS.com legend service. In order to use the ArcGIS.com legend service your map service needs to be publicly accessible and your application must be able to access ArcGIS.com.
... View more
12-18-2012
06:05 AM
|
0
|
0
|
1107
|
|
POST
|
As of right now there are still parts of the API that are not fully AMD, as in they don't all return an object. The map is still one of these. It provides "esri/map" in it's define method and has a dojo.provide("esri.map"). A lot of the API has been updated since 3.0 to return objects via AMD, but not completely yet. I'm sure it's a big task on their end.
... View more
12-17-2012
05:08 AM
|
0
|
0
|
1270
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM |
| Online Status |
Online
|
| Date Last Visited |
5 hours ago
|