|
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
|
2004
|
|
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
|
1774
|
|
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
|
1600
|
|
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
|
1600
|
|
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
|
1667
|
|
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
|
1338
|
|
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
|
631
|
|
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
|
6833
|
|
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
|
1020
|
|
POST
|
I can't view your code at work because dropbox is blocked, but I can tell by your zoom bar that you don't have <body class="claro"> set. Try adding the class and see if that fixes it.
... View more
04-19-2012
05:30 AM
|
0
|
0
|
3771
|
|
POST
|
Try to cast the layer to coerce the result you want.
Bindable]
private var annexLayer:FeatureLayer = FeatureLayer(map.getLayer("Annexations"));
If you read the docs on the Map::getLayer() method, you'll see it will always return a base Layer that you would need to cast to the proper type in most cases.
... View more
04-02-2012
06:28 AM
|
0
|
0
|
1422
|
|
POST
|
Sorry, put it in your init function, after the dojo.connect for the map.
... View more
03-23-2012
02:15 PM
|
0
|
0
|
922
|
|
POST
|
Actually, this will work
dojo.connect(dijit.byId("mySelect"), "onChange", function(value){
console.log("value = ", value);
});
... View more
03-22-2012
02:23 PM
|
0
|
0
|
922
|
|
POST
|
I should note too, that in the context of a standalone application, you don't really need to stringify the results of the conversion. That was done in the context of using the solution via REST.
... View more
03-22-2012
07:05 AM
|
0
|
0
|
1336
|
|
POST
|
Nevermind. This works as intended. I was able to track down the issue in my application to a bug in my library that cleared all GraphicsLayers on varying events, including before I ran my FeatureLayer query. My bad, thanks.
... View more
03-14-2012
06:15 AM
|
0
|
0
|
409
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | Tuesday | |
| 1 | 4 weeks ago | |
| 2 | a month ago | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|