POST
|
Check out the migrating to 3.0 page http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp/migration_30.htm I was able to load the cbtree library as a package and got no errors when I added it to some defines. I didn't try to actually build a tree node though. dojoConfig = { async: 1, parseOnLoad: true, packages: [ { name: "cbtree", location: location.pathname.replace(/\/[^/]+$/, "") + "src/libs/cbtree" } ] }; Then I was able to load it in an app like this. define(['cbtree/Tree', 'cbtree/models/TreeStoreModel'], function(Tree, TreeStoreModel) { return { treeTest: function(){ console.log("cbtree files loaded:", Tree, TreeStoreModel); } }; }); Chrome shows the js files were loaded. The docs for this dijit talk about adding these files to the dojo directory and stuff, which in this simple test wasn't needed. Hope that helps a bit.
... View more
07-09-2012
06:12 AM
|
0
|
0
|
1246
|
POST
|
I believe the reason for this a Dojo 1.7 issue and not an ESRI API issue. If run locally, Dojo will try to load the files locally, which is why you get these errors. Let's look at the dojo/text tool. It will load a file as plain text to use in your application, mostly used for templating. This a XHR request, which cannot be done locally and will only work in a server environment. It can be a little annoying if you are not used to keeping a server up locally. If you want a ridiculously easy local server to use, try xampp. http://www.apachefriends.org/en/xampp.html It's a simple, one-click install of apache/mysql/tomcat and more. You can just use it to run apache which will work for running the samples. There's even a version to run it off a usb drive. I've been using it for quite a while at work so I don't need to work off a test server.
... View more
07-05-2012
01:47 PM
|
0
|
0
|
836
|
POST
|
This was discussed in a previous thread, but also make sure that your server environment is configured to serve .json, as that is how the point data for this sample is stored under the "/data" folder.
... View more
06-29-2012
02:35 PM
|
0
|
0
|
460
|
POST
|
Where exactly are you adding this? The measurement.js tool has a field called result. So you can grab measurement.result.toFixed(2) and apply it to the tooltip or some other feature. I actually just use jQuery to grab the results and display them in a "history list". After some trial and error, it was just the simplest route. If you wanted to modify the measurement.js, you may just want to use dojo.extend.
... View more
06-29-2012
06:03 AM
|
0
|
0
|
455
|
POST
|
nvm. What happens if you remove the reference to the arcgis css? Since you're using compact, you may not need it. <link rel=�??"stylesheet" type=�??"text/�??css" href=�??"http:�??/�??/�??serverapi.arcgisonline.com/�??jsapi/�??arcgis/�??2.8/�??js/�??dojo/�??dijit/�??themes/�??claro/�??claro.css">�??
... View more
06-28-2012
09:12 AM
|
0
|
0
|
399
|
POST
|
I add that package in a test app real quick and used a dojo.require "help_panel.HelpPanel" and the js file was downloaded in my app. I don't know what it does or how to use it, but it downloaded. The only thing different in my dojoConfig is I have async: true, but I don't know if that would make a difference in this case.
... View more
06-17-2012
07:16 PM
|
0
|
0
|
348
|
POST
|
Good, I assumed it was because I was running from a localhost, but then I pushed to a server and got same errors. In my case, it does not break my app, just a little annoying error. I've been running 3.0 through it's paces since yesterday and think I'm finally ready to update my apps.
... View more
06-14-2012
07:59 AM
|
0
|
0
|
571
|
POST
|
It looks like you have it fixed now, but I've run into that very error before and it had to do with trying to initialize the legend before the layers had been added to the map. If you were to have commented out the legend.startup(), I'm almost positive the error would have gone away (no legend of course, but helps track down issue). It's usually safest to use map.addLayers([lyr1, lyr2, lyr3, ...]) when using the legend dijit. If you look at the docs http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/map.htm#onLayersAddResult Fires after all layers are added to the map using the map.addLayers method. I don't know why that would effect your layout, maybe the error was blocking something, but just throwing it out there for future reference.
... View more
06-07-2012
02:23 PM
|
0
|
0
|
526
|
POST
|
I dl'd your project and just added console.log("methodname", evt); and various other items to console.log and various other items as I followed what methods were being executed. I think I found what your problem is. You are using a div in your aspx page to hold the infoWindow contents for identify.
<!-- Identify Window Begin -->
<div id="tabs"
dojoType="dijit.layout.TabContainer"
style="width:385px;height:150px;">
<!-- Safezone Tab Begin -->
<div id="safeZoneTab"
dojoType="dijit.layout.ContentPane"
title="Location">
</div>
<!-- Safezone Tab End -->
</div>
<!-- Identify Window End -->
When you project your point, you are setting up new content for the map infowindow for the projected data. It looks like this is deleting the "tabs" dom element from your page, so it is no longer available the next time you do your identify.
geometryService.project([point], ptOutSR, function (projectedPoints) {
point = projectedPoints[0];
ptGraphic.setInfoTemplate(new esri.InfoTemplate("Coordinates",
"<p> X: " + point.x +
"<br/> Y: " + point.y +
"</p>" +
"<input type='button' value='Convert back to LatLong' onclick='projectToLatLong();' />" +
"<div id='latlong'></div>"));
map.infoWindow
.setTitle(ptGraphic.getTitle())
.setContent(ptGraphic.getContent()) // This deleting the "tabs" dom element, if I comment out, id still works, but project results not show
.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
});
I tried to go through and wrap that content in a templating engine, but I'm not fully familiar with the app, so I'm not sure where the changes would need to be made. You might be able to to use dojo.create() to do it manually, but since it's a dojo dijit element, I'm not sure how to make sure it's fully initialized when loaded. You also have the "tabs" dom tied to some other stuff in your app like a map resize it looks like.
... View more
05-23-2012
02:26 PM
|
0
|
0
|
417
|
POST
|
Area you able to verify via console.log or Chrome debug tools that the identifyParams are still correct after you run the project point? I would console.log the whole path of execution to find out where something is not firing. I glanced over the code, but nothing glaring seems to stick out.
... View more
05-23-2012
12:43 PM
|
0
|
0
|
417
|
POST
|
If I understand you right, you want to display the alias field name for your data? As far as I know, you still need to use the actual name in the infotemplate, but there are a couple of ways to do it. If it's a featurelayer, you can get the alias from the fields property. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/featurelayer.htm#fields Which is an array of fields http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/field.htm You can then iterate the array, find the value you want and apply it. something like
var content = "";
for (var i=0, field; field = fields; i++) {
if (field.alias == "TARGET") {
tmp = field.alias + ": ${" + field.name + "}";
content += tmp;
}
}
If not a featurelayer, you can use esri.request to get the field information.
var handle = esri.request({
url: "URLPATH",
content: {"f" : "json"},
handleAs: "json"
});
handle.then(function(result){
var fields = result.fields;
// do your iteration to get template data here
});
I'm not sure if that's exactly the solution you are looking for, but I have a similar situtaion with a layer that has a join where I want to display the alias and not the long sde.dbo.blahblah name and this is similiar to how I do it.
... View more
05-23-2012
09:19 AM
|
0
|
0
|
624
|
POST
|
If the geometry you are passing into that function is a valid json object, you probably need to convert it to a Geometry object to create the graphic. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#fromJson
... View more
05-23-2012
03:54 AM
|
0
|
0
|
232
|
POST
|
You guys provided some great info, thanks. I tried searching, but nothing came up. I ran into this problem yesterday where I had relationships built in mxd, working in service, regular MapServer. Added a join to the feature in mxd and relates stopped working in REST. Removed join, they work again. It's really annoying, because now I have to fall back the old method of writing custom service endpoints to perform these queries, then merge them to the spatial data client-side.
... View more
05-17-2012
05:40 AM
|
0
|
0
|
189
|
POST
|
We were told this issue would be fully fixed with 10.1, so I'm hoping that is still the case. We've held off an all SP upgrades above SP1 because of this bug.
... View more
05-11-2012
10:41 AM
|
0
|
0
|
1880
|
POST
|
To zoom to a point, it's easier to use the maps centerAndZoom method http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/map.htm#centerAndZoom map.centerAndZoom(graphic.geometry, 17)
... View more
05-11-2012
07:10 AM
|
0
|
0
|
300
|
Title | Kudos | Posted |
---|---|---|
1 | Friday | |
1 | a week ago | |
2 | a month ago | |
1 | a month ago | |
1 | a month ago |
Online Status |
Offline
|
Date Last Visited |
yesterday
|