POST
|
Rahul, if you're creating the FeatureLayer not from a url as you mention but from a featureCollectionObject, then you should look at the restrictions associated with this FeatureLayer constructor (link) * Does not support queries that need to be performed on the server, e.g. queries with a where clause or non-extent based spatial queries.
... View more
07-26-2012
08:11 AM
|
0
|
0
|
849
|
POST
|
sholyoak, As Derek tries to point out, the call to 'project' is asynchronous which means your inline function that handles the projected geometries will not runs until after you get a reply from the server. On the other hand, the code right after your call to 'project' runs immediately after making the call, which means you're trying to use a variable (newPt) that hasn't been set yet. Try this:
function openStreetView(evt) {
//convert the point //make sure we have a geometry server
if (gsvc === null) initializeProjection();
var outSR = new esri.SpatialReference({ wkid: 4326 });
pt = evt.mapPoint;
gsvc.project([pt], outSR, function (projectedPoints) {
newPt = projectedPoints[0];
// WAIT FOR SERVER RESPONSE AND THEN DO SOMETHING WITH newPt HERE...
}, function (e) { console.log(e.message); });
// CODE HERE RUNS IMMEDIATELY AFTER CALLING PROJECT BUT RESPONSE FROM SERVER MAY NOT HAVE HAPPENED YET...
}
... View more
04-13-2012
08:20 AM
|
0
|
0
|
689
|
POST
|
The language local will be picked up from the browser settings. One way to force language localizations is to set the locale in dojoConfig. Find the following tag in your html file and modify accordingly: <script type="text/javascript"> var dojoConfig = { parseOnLoad:true, locale:"es" }; </script> More details in the JS API Localization concepts page. Additionally, you can explicitly override and/or change the measure tool messages as described in the ArcGIS JavaScript API Dijit Text Strings help topic.
... View more
03-14-2012
07:57 AM
|
0
|
0
|
975
|
POST
|
You are probably reading the values before the map actually changes extent. I suggest you listen to the map.onExtentChange event and then get the map extent values. var factor = 0; var xtent =new esri.geometry.Extent(xmin-factor, ymin-factor, xmax+factor, ymax+factor) var mapExtentChangeHandle = dojo.connect(map, 'onExtentChange', function(newExtent){ dojo.disconnect(mapExtentChangeHandle); alert(dojo.replace("{xmin},{ymin},{xmax},{ymax}", newExtent); alert(map.extent.xmin + ',' + map.extent.ymin + ',' +map.extent.xmax + ',' + map.extent.ymax); }); map.setExtent(xtent);
... View more
03-14-2012
07:44 AM
|
0
|
0
|
401
|
POST
|
I believe 102100 is based on Mercator which is a conformal projection so it does not maintain areas or distances. Try using a Spatial Reference which uses an equal area projection which is appropriate to the location.
... View more
01-31-2012
08:43 AM
|
0
|
0
|
710
|
POST
|
Try using the dojox.grid.enhanced.plugins.Selector (link) as you can connect to selection related events (link).
... View more
01-31-2012
07:26 AM
|
0
|
1
|
662
|
POST
|
Try setting the 'esri.tasks.BufferParameters.bufferSpatialReference' to a Spatial Reference with an equal area projection that is appropriate to your location.
... View more
01-31-2012
07:16 AM
|
0
|
0
|
710
|
POST
|
There are several 'sidd-by-side' Web Application Templates on ArcGIS.com that you could check out. Here's the link to one of them: Side by Side Viewer
... View more
12-12-2011
07:11 AM
|
0
|
0
|
249
|
POST
|
I believe the 'All Layers and Tables' REST resource (<mapServiceUrl>/layers) was added at ArcGIS Server 10.0 (could be 10.0 sp1, but not 100% sure). That is why I started my previous response with 'If available'...
... View more
11-21-2011
07:36 AM
|
0
|
0
|
933
|
POST
|
For this task, the only useful pieces of information about each layer are: Is the subLayer visible Is subLayer within scale range
var identifyLayerIds = dojo.filter(map.layerInfos, function(layerInfo){
var mapScale = esri.geometry.getScale(map);
var layer = map.getLayer(layerInfo.id);
return (layer.visible && isWithinScaleRange(layerInfo,mapScale);
}).map(function(visibleLayerInfo){
return visibleLayerInfo.id;
});
function isWithinScaleRange(layerInfo, mapScale){
var isWithinScaleRange = true;
if ((layerInfo.minScale === 0) && (layerInfo.maxScale !== 0)) {
isWithinScaleRange = (mapScale > layerInfo.maxScale);
} else {
if ((layerInfo.maxScale === 0) && (layerInfo.minScale !== 0)) {
isWithinScaleRange = (mapScale < layerInfo.minScale);
} else {
if ((layerInfo.maxScale !== 0) && (layerInfo.minScale !== 0)) {
isWithinScaleRange = (mapScale < layerInfo.minScale) && (mapScale > layerInfo.maxScale);
}
}
}
return isWithinScaleRange;
}
... View more
11-17-2011
07:32 AM
|
0
|
0
|
716
|
POST
|
The new 'Basic Viewer' app template on ArcGIS.com has some related code (see 'addMeasurementWidget' and 'toggleMeasure' methods). Even though it uses UI elements specific to this app and does other things you might not need, there is some code that might be relevant: measure.clearResult();
if(measure.activeTool){
measure.setTool(measure.activeTool, false);
}
... View more
11-16-2011
07:48 AM
|
0
|
0
|
657
|
POST
|
I'm not sure if this will help, but depending on how a particular style attribute is set in the original widget definition you might have to use !important. Try this: .esriAttributeInspector .atiDeleteButton {
color:red !important;
}
... View more
09-23-2011
08:02 AM
|
0
|
0
|
799
|
POST
|
I would agree with Jeff, use dojo.date.locale to properly format the date values as strings. Below are some links that might be of some help: http://api.dojotoolkit.org/jsdoc/1.6/dojo.date.locale.format http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns
dojo.require("dojo.date.locale");
_covDate = new Date(myAttributes.RecordDate);
var _covDateStr = dojo.date.locale.format(_covDate, {
selector: 'date',
datePattern: 'MM/dd/yyyy'
});
... View more
09-14-2011
08:28 AM
|
0
|
0
|
4571
|
POST
|
Robin, [INDENT]try this:[/INDENT] store.setValue(item, "Company", " "); [INDENT]However, I would recommend you instead check out the 'formatter' and 'get' attributes of the '<th>' table element as they provide additional control of the displayed content in the cell. More information can be found here. [/INDENT] John
... View more
09-06-2011
04:13 PM
|
0
|
0
|
287
|
POST
|
Is the goal to draw the line? ...or the buffers? If you only want to draw the line, try something like this: function drawLine(x1,y1,x2,y2) {
// CREATE GEOMETRY USING WGS84 SPATIAL REFERENCE
var p1 = new esri.geometry.Point(x1, y1, new esri.SpatialReference({wkid:4326}));
var p2 = new esri.geometry.Point(x2, y2, new esri.SpatialReference({wkid:4326}));
var geographicGeometry = new esri.geometry.Polyline(new esri.SpatialReference({wkid:4326}));
geographicGeometry = geometry.addPath([p1,p2]);
// CONVERT GEOMETRY TO WEB MERCATOR
var mapGeometry = esri.geometry.geographicToWebMercator(geographicGeometry);
var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 3);
var graphic = new esri.Graphic(mapGeometry ,symbol);
map.graphics.add(graphic);
}
... View more
09-02-2011
03:57 PM
|
0
|
0
|
342
|
Title | Kudos | Posted |
---|---|---|
1 | 03-07-2024 04:14 PM | |
1 | 02-23-2024 12:40 PM | |
1 | 03-01-2024 10:48 AM | |
2 | 08-03-2023 02:34 PM | |
2 | 07-19-2023 12:05 PM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|