POST
|
Hi, I have a need to take a 'aaData' returned JSON object and convert it to a graphics layer. Does anyone know of an example out there? my JSON object returned as aaData is below.. [["CityName","State","lat","lon"],["Washington","DC","38.901","-77.043"],["Richmond","VA","37.541","-77.439"],["VirginiaBeach","VA","36.859","-75.983"],["Salisbury","MD","38.36","-75.598"],["Greensboro","NC","36.079","-79.803"],["Raleigh","NC","35.777","-78.639"]] Andy.. It is simple, just format your json to The way ESRI format a feature..eg [HTML]{ "geometry" : {"x" : -118.15, "y" : 33.80}, "attributes" : { "OWNER" : "Joe Smith", "VALUE" : 94820.37, "APPROVED" : true, "LASTUPDATE" : 1227663551096 } [/HTML] and then create a featureLayer. Here is a very good example that you can look at it to start... http://gis.stackexchange.com/questions/8791/featurelayer-creating-in-javascript-arcgis-api Thanks
... View more
12-13-2012
01:13 PM
|
0
|
0
|
297
|
POST
|
Hi all this is one of my first programs where I am trying to display the legend on a tab what is missing to show the legend. thanks
var dynamicUrl = "http://<server>j/ArcGIS/rest/services/OneLayer/MapServer";
var dynamicLayer = new esri.layers.ArcGISDynamicMapServiceLayer(dynamicUrl );
dojo.connect(map,'onLayersAddResult',function(results){
//add the legend
var legend = new esri.dijit.Legend({
map: map,
layerInfos: [{ layer: dynamicLayer, title: ""}],
arrangement: esri.dijit.Legend.ALIGN_RIGHT
}, "legendDiv");
legend.startup();
});
map.addLayer(dynamicLayer);
}
//show map on load
dojo.addOnLoad(init);
</script>
</head>
<body class="soria">
<form id="form1" runat="server">
<div id="mainWindow" dojotype="dijit.layout.BorderContainer" design="headline"
gutters="false" style="width:100%; height:100%;">
<div id="header" dojotype="dijit.layout.ContentPane" region="top">
This is the header section
<div id="subheader">subheader</div>
</div>
<div dojotype="dijit.layout.ContentPane" id="leftPane" region="right">
<div dojotype="dijit.layout.TabContainer" >
<div id="layersTab" dojotype="dijit.layout.ContentPane" title="Layers" selected="true" style="display: none; margin-bottom: 5px;">
<br />
<div id="layersToc">
</div>
<br />
</div>
<div dojotype="dijit.layout.ContentPane" title = "Legend" >
<div id="legendDiv"></div>
</div>
</div>
</div>
<div id="map" dojotype="dijit.layout.ContentPane" region="center">
</div>
<div id="footer" dojotype="dijit.layout.ContentPane" region="bottom" >
this is the footer section
</div>
</div>
</form>
</body>
</html> replace map.addLayer(dynamicLayer);
With map.addLayers([dynamicLayer]); It worked for me so lets hope it will work for you.
... View more
12-13-2012
11:23 AM
|
0
|
0
|
235
|
POST
|
Finding of Xmin, Ymin and Xmax Ymax co-ordinates for a city? zoom to your city http://help.arcgis.com/en/webapps/flexviewer/extenthelper/flexviewer_extenthelper.html and this will give you extent.....
... View more
11-16-2012
08:03 AM
|
0
|
0
|
781
|
POST
|
Point clustering - I want to add different colored pins (ex: red pin for documents and yellow pin for images and etc) in same latitude and longitude Thanks, Srihari why dont you add some offset value so that they are not overlapping or not on top of each other.?
... View more
11-16-2012
08:01 AM
|
0
|
0
|
224
|
POST
|
I have added following two lines but still legend is not showing up.. [HTML] esri.config.defaults.io.proxyUrl = "/proxy/proxy.ashx"; esri.config.defaults.io.alwaysUseProxy = true;[/HTML] I can see that its accessing proxy and it is configure correctly but when it tries to get layerinfo, its not using proxy so cant get legend info because of cross origin issue.."is not allowed by Access-Control-Allow-Origin."
... View more
11-04-2012
07:49 AM
|
0
|
1
|
506
|
POST
|
I have the exact same problem! I hope someone knows the answer. I did a temporary work around by using the year only (ex: 2012), no month and day with slashes. you need to configure your date field and to get what you are looking for... Here is how you can configure, date field in popUpconfig.xml... How to format dates and numbers. See API Reference for more details. This tag has the following attributes: dateformat???Can be set to either one of the constants below or a DateFormatter formatString like YYYY-MM-DD. Optional. The default is "shortDateShortTime". "dayShortMonthYear"???for example, "21 Dec 1997" "longDate"???for example, "Sunday, December 21, 1997" "longMonthDayYear"???for example, "December 21, 1997" "longMonthYear"???for example, "December 1997" "shortDate"???for example, "12/21/1997" "shortDateShortTime"???for example, "12/21/1997 6:00 PM". This is the default. "shortDateShortTime24"???for example, "12/21/1997 18:00" "shortMonthYear"???for example, "Dec 1997" "year"???for example, "1997"
... View more
07-13-2012
07:58 AM
|
0
|
0
|
1154
|
POST
|
I am trying to access "nowCOAST 'obs' WMS" (only temperature) in viewer but with no luck. Any help will be highly appreciated (THANKS NOAA in Advanced for still using OLD OLD OLD stuff and not using ArcGIS Server....and much more....) Here is the URL http://www.arcgis.com/home/item.html?id=862ea07f603e4a52a4eff50899451176 Thanks
... View more
07-11-2012
07:17 AM
|
0
|
25
|
4330
|
POST
|
Yes, you can use the excludelayer tag. See: http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Legend_widget_tags/01m30000001r000000/ I have three sublayers and I just want to exclude one of the sublayer..so this is not going to help me as I do want those other two layers in the legend
... View more
06-29-2012
12:51 PM
|
0
|
0
|
312
|
POST
|
Is it possible to exclude sublayer from legend? Flex Viewer (3.0)
... View more
06-29-2012
11:11 AM
|
0
|
5
|
1808
|
POST
|
Using the new 3.0 flex viewer and having some issues with the Legend Widget. It appears to be loading all layers in my configuration whether they are turned on or not. This happens when the widget first loads. If I then turn a layer on and back off, it is properly removed from the legend. But, as it stands now, the widget takes forever to load as it's building the legend for 50+ layers that are set as visible="false" in the config. File. Anyone else seeing this behavior. I am experiencing same problem....
... View more
06-15-2012
03:00 PM
|
0
|
0
|
436
|
POST
|
Shweta, Sorry I haven't implemented a solution to this problem to date but it is something that I want to do soon. I will post up the solution once I have done the work unless there is someone else out there that has already done this and doesn't mind sharing their compilied/uncompilied code (Zahid if you are reading this!!!). Regards Anthony Anthony, Let me know if you still needs code for mapping data from XLS. I have a widget working that allow you to upload xls/gpx files and display data on map... thanks
... View more
06-08-2012
02:42 PM
|
0
|
0
|
524
|
POST
|
Is it possible to exclude a sublayer from Legend (using Legend Dijit)?
... View more
05-24-2012
12:33 PM
|
0
|
5
|
3248
|
POST
|
Zahid, So you are saying that this does not work? var spatRef:SpatialReference = new SpatialReference(102100);
var pl:Polyline = new Polyline(null, spatRef);
var path:Array = [];
path.push(new MapPoint(15558700, 1770100, spatRef));
path.push(new MapPoint(12959100, 3238400, spatRef));
path.push(new MapPoint(11901900, 3238400, spatRef));
path.push(new MapPoint(1447100, 4244300, spatRef));
path.push(new MapPoint(-13627000, 2012200, spatRef));
path.push(new MapPoint(-13330400, 1623400, spatRef));
path.push(new MapPoint(-8733100, -24400, spatRef));
path.push(new MapPoint(-7449500, 1175400, spatRef));
path.push(new MapPoint(-6681300, -4460100, spatRef));
pl.paths = [path];
var graphic:Graphic = new Graphic(pl, null, null); Thanks Robert I know what i was doing wrong... [HTML] var line:Polyline = new Polyline(path,new SpatialReference(4326));[/HTML] Thanks for your help...
... View more
05-22-2012
08:55 AM
|
0
|
0
|
313
|
POST
|
Zahid, Try this: var spatRef:SpatialReference = new SpatialReference(102100);
var pl:Polyline = new Polyline(null, spatRef);
var path:Array = [];
path.push(new MapPoint(15558700, 1770100, spatRef));
path.push(new MapPoint(12959100, 3238400, spatRef));
path.push(new MapPoint(11901900, 3238400, spatRef));
path.push(new MapPoint(1447100, 4244300, spatRef));
path.push(new MapPoint(-13627000, 2012200, spatRef));
path.push(new MapPoint(-13330400, 1623400, spatRef));
path.push(new MapPoint(-8733100, -24400, spatRef));
path.push(new MapPoint(-7449500, 1175400, spatRef));
path.push(new MapPoint(-6681300, -4460100, spatRef));
pl.paths = [path]; Don't forget to click the Mark as answer check on this post and to click the top arrow (promote). Follow the steps as shown in the below graphic: Thanks ROBERT, Upto this point i had it working but cant add to graphics layer or graphic...but if i use inline codes..it work...very strange...any thoughts.. by that i mean if i do something like this it work... [HTML]var graphic:Graphic = new Graphic( new Polyline([paths],new SpatialReference(102100))); [/HTML] What if i dont want both graphics and polylline declaration in ONe line?
... View more
05-22-2012
07:38 AM
|
0
|
0
|
313
|
POST
|
I been trying to create a line using AS3 and add to graphics Layer but with no luck... here is what i am trying to convert(from mxml to as3); [HTML]<esri:Graphic> <esri:Polyline spatialReference="{new SpatialReference(102100)}"> <fx:Array> <fx:Array> <esri:MapPoint x="15558700" y="1770100"/> <esri:MapPoint x="12959100" y="2261100"/> <esri:MapPoint x="11901900" y="3238400"/> <esri:MapPoint x="1447100" y="4244300"/> <esri:MapPoint x="-13627000" y="2012200"/> <esri:MapPoint x="-13330400" y="1623400"/> <esri:MapPoint x="-8733100" y="-24400"/> <esri:MapPoint x="-7449500" y="1175400"/> <esri:MapPoint x="-6681300" y="-4460100"/> </fx:Array> </fx:Array> </esri:Polyline></esri:Graphic>[/HTML] Any help?
... View more
05-22-2012
07:07 AM
|
0
|
4
|
590
|
Title | Kudos | Posted |
---|---|---|
27 | 01-25-2013 10:51 AM | |
27 | 01-25-2013 10:51 AM | |
10 | 04-16-2010 01:00 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|