POST
|
Hello, I'm having some difficulty accessing my maps/services via REST Services. On my manager panel, I see that my maps exist. However, by each service's status, I see "Stopping...". When I try to press the button to start it again, nothing happens. Additionally, when I try to access REST Services, I see None under each folder. (This is strange, because my admin manager panel tells me that something should be there.) We just upgraded to Server v10.2. We've also tried restarting the server, clearing the cache, and uploading a new map. The same thing happens every time. Does any have any idea as to what's going on? Thanks in advance for your help. (I've attached some screen shots for reference.) [ATTACH=CONFIG]28012[/ATTACH] [ATTACH=CONFIG]28013[/ATTACH] Edit: typo
... View more
10-03-2013
08:49 AM
|
0
|
4
|
3670
|
POST
|
The Flex Viewer only accepts one web map, so "no" you cannot use two web map directly. Some alternatives: * Create a new web map 🙂 * Convert the web maps to operational layers. There's a handy utility, Web Map Converter, for that at: http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Helper_applications/01m30000002m000000/ * Write custom flex viewer code to convert both web maps on the fly. Thank you Bjorn. I had no idea about the Web Map Converter, that will help me out a lot! Rachel
... View more
07-10-2012
10:30 AM
|
0
|
0
|
200
|
POST
|
Hello everyone, I was wondering if its possible to take web map #1 and web map #2 (made public from my content in ArcGIS Online, with their web keys) and combine them into one Flex Viewer application? In other words, I want to take the configured operational layers from map #1 and map #2 and put them together. This will help me to cut down on redundancy. I have over 10 maps with several layers (sometimes 20+) each - and I want to be able to mix-n-match all of the maps (keeping the same layers) without having to completely re-add the layers for each map combination. Does this make sense? Let me know if I need to explain further. Thanks for any advice, Rachel
... View more
07-05-2012
10:53 AM
|
0
|
2
|
414
|
POST
|
[ATTACH=CONFIG]15546[/ATTACH]Hello everyone. I'm having trouble send the legend info about the layer to the legendDiv element. I'll post my code, but you won't be able to see much. Our arcgis server hasn't been made public yet. I can see the layer and the attribute breaks, so I know it exists. (I've attached a screenshot as proof!) I was wondering if anyone could take a peak at the bottom-half of my code, to see if I'm missing anything or what could be going wrong ... TY 🙂 <script type="text/javascript"> dojo.require("dijit.dijit"); // optimize: load dijit layer dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("dijit.layout.TabContainer"); dojo.require("esri.dijit.Legend"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("esri.layers.FeatureLayer"); dojo.require("dojox.charting.Chart2D"); dojo.require("dojox.charting.plot2d.Pie"); dojo.require("dojox.charting.action2d.Highlight"); dojo.require("dojox.charting.action2d.MoveSlice"); dojo.require("dojox.charting.action2d.Tooltip"); dojo.require("dojo.number"); var map; //try other themes (Julie,CubanShirts, PrimaryColors, Charged, BlueDusk, Bahamation,Harmony,Shrooms) var theme = 'Harmony'; dojo.require("dojox.charting.themes." + theme); function init() { var initExtent = new esri.geometry.Extent({ "xmin": -13971902, "ymin": 3681009, "xmax": -12276427, "ymax": 5302127, "spatialReference": { "wkid": 102100 } }); map = new esri.Map("map", { extent: initExtent }); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/"); var referenceBasemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/"); map.addLayer(basemap); map.addLayer(referenceBasemap); var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([4,90,141]), 0.5),new dojo.Color([116,169,207, 0.6])); var renderer = new esri.renderer.ClassBreaksRenderer(symbol, "TotalAges0to18"); renderer.addBreak(0, 831, new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,0,0]), 0.2),new dojo.Color([239, 243, 255, 0.6]))); renderer.addBreak(832, 2701, new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,0,0]), 0.2),new dojo.Color([189, 215, 231, 0.6]))); renderer.addBreak(2702, 6438, new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,0,0]), 0.2),new dojo.Color([107, 174, 214, 0.6]))); renderer.addBreak(6439, 13485, new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,0,0]), 0.2),new dojo.Color([49, 130, 189, 0.6]))); renderer.addBreak(13486, 80000, new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,0,0]), 0.2),new dojo.Color([8, 81, 156, 0.6]))); var template = new esri.InfoTemplate(); template.setTitle("<b>${NAME10} County</b>"); template.setContent(getWindowContent); var childrenMilitaryLayer = new esri.layers.FeatureLayer("http://arcgis.focusproject.org:8399/arcgis/rest/services/SpecialPurpose/SpecialPurpose_Basic_ChildrenMilitaryCaliforniaCounty_20120627/MapServer/0", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate: template, outFields: ["*"] }); childrenMilitaryLayer.setRenderer(renderer); // add the layers //add the legend dojo.connect(map,'onLayersAddResult',function(results){ var layerInfo = dojo.map(results, function(layer,index){ return {layer:childrenMilitaryLayer,title:layer.layer.name}; }); if(layerInfo.length > 0){ var legendDijit = new esri.dijit.Legend({ map:map, layerInfos:layerInfo },"legendDiv"); legendDijit.startup(); } }); map.addLayer(childrenMilitaryLayer); map.addLayer(referenceBasemap); map.infoWindow.resize(275, 275); dojo.connect(map, 'onLoad', function (theMap) { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map, map.resize); }); } function getWindowContent(graphic) { //make a tab container var tc = new dijit.layout.TabContainer({ style: "width:100%;height:100%;" }, dojo.create("div")); //display a dojo pie chart var cp1 = new dijit.layout.ContentPane({ title: "Pie Chart" }); //display attribute information var cp2 = new dijit.layout.ContentPane({ title: "Details", //content: "<a target='_blank' href='http://en.wikipedia.org/wiki/" + graphic.attributes.STATE_NAME + "'>Wikipedia Entry</a><br /><br />Median Age: " + graphic.attributes.MED_AGE + "<br />Median Age (Male): " + graphic.attributes.MED_AGE_M + "<br />Median Age (Female): " + graphic.attributes.MED_AGE_F content: "Ages 0 to 5: <b>" + graphic.attributes.TotalAges0to5 + "</b><br />Ages 6 to 12: <b>" + graphic.attributes.TotalAges6to12 + "</b><br />Ages 13 to 18: <b>" + graphic.attributes.TotalAges13to18 + "</b><br /><br /><b>Total Children: " + graphic.attributes.TotalAges0to18 }); tc.addChild(cp2); tc.addChild(cp1); //create the chart that will display in the second tab var c = dojo.create("div", { id: "demoChart" }, dojo.create('div')); var chart = new dojox.charting.Chart2D(c); dojo.addClass(chart, 'chart'); //apply a color theme to the chart chart.setTheme(dojo.getObject("dojox.charting.themes." + theme)); chart.addPlot("default", { type: "Pie", radius: 60, htmlLabels: true }); dojo.connect(tc,'selectChild',function(tabItem){ if(tabItem.title === "Pie Chart"){ chart.resize(180,180); } }); var total = graphic.attributes.TotalAges0to18; var Ages0to5 = dojo.number.round(graphic.attributes.TotalAges0to5); var Ages6to12 = dojo.number.round(graphic.attributes.TotalAges6to12); var Ages13to18 = dojo.number.round(graphic.attributes.TotalAges13to18); chart.addSeries("PopulationSplit", [{ y: Ages0to5, tooltip: Ages0to5, text: '0 to 5' }, { y: Ages6to12, tooltip: Ages6to12, text: '6 to 12' }, { y: Ages13to18, tooltip: Ages13to18, text: '13 to 18' }, ]); //highlight the chart and display tooltips when you mouse over a slice. new dojox.charting.action2d.Highlight(chart, "default"); new dojox.charting.action2d.Tooltip(chart, "default"); new dojox.charting.action2d.MoveSlice(chart, "default"); // cp1.set('content', chart.node); return tc.domNode; } dojo.addOnLoad(init); </script> </head> <body class="claro"> <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"> Children Dependents of Military Members By County in California (With Pie Chart) <div id="subheader">By Age Groups: 0 to 5, 6 to 12, and 13 to 18</div> </div> <div dojotype="dijit.layout.ContentPane" id="leftPane" region="left"> <div dojotype="dijit.layout.TabContainer" > <div dojotype="dijit.layout.ContentPane" title = "Legend" selected="true"> <div id="legendDiv"> Legend coming soon.<br><br> For now, the darker colors imply a higher population of children. The lighter colors imply a lower population of children. </div> </div> <div dojotype="dijit.layout.ContentPane" title="About" > Click on a county in California to retrieve information about the total number of children in that county.<br><br> This application includes the total numbers and a pie chart displaying the ratio of each category. </div> </div> </div> <div id="map" dojotype="dijit.layout.ContentPane" region="center"> </div> <div id="footer" dojotype="dijit.layout.ContentPane" region="bottom" > Source: unknown, someone please fill Rachel in </div> </div> </body> </html>
... View more
06-27-2012
01:16 PM
|
0
|
2
|
1074
|
POST
|
You should be able to just use the map methods centerAndZoom or centerAt. All you should need is map.centerAt(selectedTaxLot.geometry) or map.centerAt(selectedTaxLot.geometry, 24) Hope that helps! Jay This also worked, but I wasn't able to figure out how to zoom into the point. The code below seemed to work fine. Thanks again for your response! 🙂 Smiles, Rachel
... View more
05-17-2012
07:05 AM
|
0
|
0
|
399
|
POST
|
Rachel, There are a lot of posts on this subject and I think I handle it somewhat differently, which probably is not correct or good coding cause I'm a total hack but here's how I handle it:
//Zoom to the parcel when the user clicks a row
function onRowClickHandler(evt){
var clickedId = grid.getItem(evt.rowIndex).OBJECTID;
var g;
dojo.forEach(map.graphics.graphics,function(graphic){
if((graphic.attributes) && graphic.attributes.OBJECTID === clickedId){
g = graphic;
return;
}
});
if (g.geometry.type == "point"){
var pExtent = new esri.geometry.Extent({"xmin":g.geometry.x - 500,"ymin":g.geometry.y - 500,"xmax":g.geometry.x + 500,"ymax":g.geometry.y + 500,"spatialReference":{"wkid":g.geometry.spatialReference.wkid}});
map.setExtent(pExtent);
}
else{
var gExtent = g.geometry.getExtent();
map.setExtent(gExtent);
}
}
That should work! If my post helped or answered your question please send a point my way! Jay Hi Jay, that worked! (Sorry it took me a day or two to get back to you ... Our servers were down.) Thank you so much for your responses.
... View more
05-17-2012
07:05 AM
|
0
|
0
|
399
|
POST
|
Hello everyone, I know that there is a few threads on this topic, but I'm still having some difficulty. In the FindTask sample, I want that same search-n-zoom functionality... but instead of zooming into a polygon, I want to zoom into a point. I've added my layer and the search function works fine .. However, the code seems to break in the onRowClickHandler function, because there's no zoomage to the clicked point. Any ideas as to what I should change in the onRowClickHandler function? (Yes, I left the variables the same...): function onRowClickHandler(evt) { var clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID; var selectedTaxLot; dojo.forEach(map.graphics.graphics, function(graphic) { if((graphic.attributes) && graphic.attributes.OBJECTID === clickedTaxLotId) { selectedTaxLot = graphic; return; } }); var taxLotExtent = selectedTaxLot.geometry.getExtent(); map.setExtent(taxLotExtent); } Let me know if you need to see more code. Thanks everyone, Rach
... View more
05-15-2012
06:38 AM
|
0
|
5
|
726
|
POST
|
For starters you don't have your bing base map key entered:
var bingKey = 'Enter your Bing Maps Key'; Can you get your Map to show? Your extent (YMin, YMax, XMin, XMax) your entering state plane but your spatial ref is 102100 web Mercator so you are trying to reproject it? with this line of code:
map = new esri.Map("map", {extent : esri.geometry.geographicToWebMercator(initialExtent),}); I've never done that...but I'm new to JS...seems like a performance hit...I would just type in your WebMercator coords instead of typing in StatePlane and the running through the Geometry service... Also I don't see a ref to the geometry service? If the BING key doesn't help. I would isolate the base map code and just getting working by itself and then added it back into your code. Jay Hi Jay - I did what you suggested. I isolated the base map code, got it working, and then added it back in. It worked! I also changed the coordinate system .. That was an old part of my code that I forgot to change. Putting all that together seemed to work. Thanks again! Rachel
... View more
04-26-2012
04:15 PM
|
0
|
0
|
262
|
POST
|
Hi Rachel, Your code looks ok, nothing seems wrong. Except that you have a missing semi-colon on the line var formattedImputedSum = dojo.number.format(imputedSum) Could this be causing the problem? Samir Thank you! I knew it was something small. The pop up also works fine for me, too. Also - that layer shows up on my machine.. I still need to do some configuration in order to share that layer with the public. Thanks everyone!
... View more
04-26-2012
11:38 AM
|
0
|
0
|
282
|
POST
|
Hello again! I created a code from this example - to select a bunch of zip codes and then total up the population. I actually had this code working - doing exactly what I wanted to do - for almost a month. Then, I re-visited it, and for some reason it decided to stop working completely. The map doesn't show up anymore. Any ideas as to what happened? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Selecting Zip Codes</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/css/Popup.css"> <style> html, body { margin: 10px; padding: 10px; font-family:"Verdana"; font-size:small; } #map { border: solid #97DCF2 1px; width: 50%; height: 100%; } #header { border: solid #97DCF2 1px; width: 50%; height: 10%; } #footer { border: solid #97DCF2 1px; width: 50%; height: 10%; } #footer2 { border: solid #97DCF2 1px; width: 50%; height: 10%; } #footer3 { width: 50%; height: 10%; padding: 10; } #footer4 { border: solid #97DCF2 1px; width: 50%; height: 10%; padding: 10; font-size: x-small; } </style> <script type="text/javascript"> djConfig = { parseOnLoad : true }; </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script> <script type="text/javascript"> dojo.require("esri.map"); dojo.require("esri.layers.FeatureLayer"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("esri.dijit.Legend"); dojo.require("esri.toolbars.draw"); dojo.require("esri.tasks.query"); dojo.require("esri.dijit.Popup"); dojo.require("dojo.number"); var selectionToolbar, zipCodeLayer; var legendLayers = []; function init() { // Set the Initial Extent var initialExtent = new esri.geometry.Extent(-123.5328, 32.4344, -112.2582, 37.64041, new esri.SpatialReference({ wkid : 4326 })); // Set up the popup window var popup = new esri.dijit.Popup({ fillSymbol : new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25])) }, dojo.create("div")); var map = new esri.Map("map", { extent : esri.geometry.geographicToWebMercator(initialExtent), infoWindow : popup, slider : true, nav : true }); dojo.connect(map, "onLoad", initSelectToolbar); // Set the basemap var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"); map.addLayer(baseMapLayer); // Set the selection symbols var fieldsSelectionSymbol = new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255, 255, 0, 0.5])); fieldsSelectionSymbol.setOutline(new esri.symbol.SimpleLineSymbol("dashdot", new dojo.Color([255, 0, 0]), 2)); // Establish the feature layer to be populated - the Zip Codes Layer zipCodeLayer = new esri.layers.FeatureLayer("http://arcgis.focusproject.org:8399/arcgis/rest/services/2012APR11_WhereAreTheVeterans_ZipCod/MapServer/0", { mode : esri.layers.FeatureLayer.MODE_ONDEMAND, opacity : .9, outFields : ["*"], }); zipCodeLayer.setSelectionSymbol(fieldsSelectionSymbol); // Set the Feature Layer's symbol map.addLayers([zipCodeLayer]); dojo.connect(zipCodeLayer, "onSelectionComplete", sumVeterans); // When you're done selecting, perform the summation total of the veterans dojo.connect(zipCodeLayer, "onSelectionClear", function(features) { dojo.byId('messages').innerHTML = "<i>No Selected Fields</i>"; }); dojo.connect(map, 'onLoad', function(theMap) { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map, map.resize); }); } // ToolBar Function function initSelectToolbar(map) { selectionToolbar = new esri.toolbars.Draw(map); var selectQuery = new esri.tasks.Query(); dojo.connect(selectionToolbar, "onDrawEnd", function(geometry) { selectionToolbar.deactivate(); selectQuery.geometry = geometry; zipCodeLayer.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_NEW); }); } // Sum Veterans Function function sumVeterans(features) { var imputedSum = 0; //summarize the cummulative gas production to display dojo.forEach(features, function(feature) { imputedSum = imputedSum + feature.attributes.ImputedVeteran; }); //dojo.byId('messages').innerHTML = "Total Veterans: " + imputedSum + ""; var formattedImputedSum = dojo.number.format(imputedSum) dojo.byId('messages').innerHTML = "Total Veterans: " + formattedImputedSum + ""; } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div id="header" dojotype="dijit.layout.ContentPane" region="top" style="overflow:hidden;"> <b>Veteran Population by Zip Codes in California</b><br> Use the Selection Tool to calculate the total number of veterans within a certain area. </div> <div id="map" dojotype="dijit.layout.ContentPane" region="top" style="overflow:hidden;"></div> <div id="footer" dojotype="dijit.layout.ContentPane" region="bottom" style="overflow:hidden;"> <button dojoType="dijit.form.Button" onClick="selectionToolbar.activate(esri.toolbars.Draw.EXTENT);"> Select Zip Code Polygons </button> <button dojoType="dijit.form.Button" onClick="zipCodeLayer.clearSelection();"> Clear Selection </button> <br> </div> <div id="legendDiv" dojotype="dijit.layout.ContentPane" region="bottom" style="overflow:hidden;"></div> <div id="footer2" dojotype="dijit.layout.ContentPane" region="bottom" style="overflow:hidden;"> <span id="messages"></span> </div> <div id="footer3" dojotype="dijit.layout.ContentPane" region="bottom" style="overflow:hidden;"> </div> <div id="footer4" dojotype="dijit.layout.ContentPane" region="bottom" style="overflow:hidden;"> <img src="https://lh5.googleusercontent.com/-SmFdguzq84o/T5Fqf6acazI/AAAAAAAACnA/vYfGcbRbmCY/s49/blue-1.png" align="middle"> 0 - 896 <img src="https://lh4.googleusercontent.com/-Ns3epG-BoZM/T5Fqf2CruiI/AAAAAAAACm0/2NgNDuzoDT8/s49/blue-2.png" align="middle"> 897 - 2296 <img src="https://lh4.googleusercontent.com/-m8vMvN0uFtg/T5Fqf5_rjPI/AAAAAAAACmw/3r3DFtIz00U/s49/blue-3.png" align="middle"> 2297 - 3973 <img src="https://lh3.googleusercontent.com/-OhM1oitx1HQ/T5FqgQ6UBLI/AAAAAAAACnQ/D8Se4OenyUw/s49/blue-4.png" align="middle"> 3974 - 6574 <img src="https://lh4.googleusercontent.com/-RZ62_uGLCec/T5FqgYeFySI/AAAAAAAACnE/gf6Wr4HMu2Q/s49/blue-5.png" align="middle"> 6575 - 13,263 </body> </html> Thanks everyone! Rachel
... View more
04-25-2012
06:30 AM
|
0
|
3
|
383
|
POST
|
Hey everyone, I'm trying to incorporate this TOC example with this Basemap example - using buttons. I got the TOC working (you won't be able to see the layer because its on my server, but I can see it from my end). I can't seem to get the basemaps to work at all. I can't seem to figure out what I'm missing here? I'm starting towards the bottom since my code is really long. </script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4"></script> <script type="text/javascript"> dojo.require("dijit.dijit"); dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); // uncomment if want dojo widget style checkbox //dojo.require('dijit.form.CheckBox'); dojo.require("esri.map"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("agsjs.dijit.TOC"); dojo.require("esri.dijit.BasemapGallery"); dojo.require("dijit.Tooltip"); dojo.require("dijit.form.Button"); dojo.require("dijit.Menu"); </script> <script type="text/javascript"> var map, basemapGallery; var bingKey = 'Enter your Bing Maps Key'; function init() { var initialExtent = new esri.geometry.Extent({ "xmin" : -123.5328, "ymin" : 32.4344, "xmax" : -112.2582, "ymax" : 37.64041, "spatialReference" : { "wkid" : 102100 } }); map = new esri.Map("map", { extent : esri.geometry.geographicToWebMercator(initialExtent), }); //Add the terrain service to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service //var grayBasemapLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"); //map.addLayer(grayBasemapLayer); var census = new esri.layers.ArcGISDynamicMapServiceLayer("http://arcgis.focusproject.org:8399/arcgis/rest/services/2012APR11_California_Partnerships_Colleges_HealthCare_VA.gdb/MapServer", { id : 'census', opacity : 0.8 }); //var safety = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/PublicSafety/PublicSafetyOperationalLayers/MapServer", { // id : 'publicsafety', // opacity : 0.8 //}); dojo.connect(map, 'onLayersAddResult', function(results) { var toc = new agsjs.dijit.TOC({ map : map, layerInfos : [{ //layer: safety, //title: "Safety Operations" //},{ layer : census, title : "Partnerships" }] }, 'tocDiv'); toc.startup(); }); //map.addLayers([census, safety]); map.addLayers([census]); //resize the map when the browser resizes - view the 'Resizing and repositioning the map' section in //the following help topic for more details http://help.esri.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_guidelines.htm var resizeTimer; createBasemapGallery(); dojo.connect(map, 'onLoad', function(theMap) { dojo.connect(dijit.byId('map'), 'resize', function() {//resize the map if the div is resized clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { map.resize(); map.reposition(); }, 500); }); }); } function createBasemapGallery() { //Manually create a list of basemaps to display var basemaps = []; var basemapRoad = new esri.dijit.Basemap({ layers : [new esri.dijit.BasemapLayer({ type : "BingMapsRoad" })], id : "bmRoad", title : "Road" }); basemaps.push(basemapRoad); var basemapAerial = new esri.dijit.Basemap({ layers : [new esri.dijit.BasemapLayer({ type : "BingMapsAerial" })], id : "bmAerial", title : "Aerial" }); basemaps.push(basemapAerial); var basemapHybrid = new esri.dijit.Basemap({ layers : [new esri.dijit.BasemapLayer({ type : "BingMapsHybrid" })], id : "bmHybrid", title : "Aerial with labels" }); basemaps.push(basemapHybrid); basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps : false, basemaps : basemaps, bingMapsKey : bingKey, map : map }); //BasemapGallery.startup isn't needed because we aren't using the default basemap, instead //we are going to create a custom user interface to display the basemaps, in this case a menu. dojo.forEach(basemapGallery.basemaps, function(basemap) { //Add a menu item for each basemap, when the menu items are selected dijit.byId("bingMenu").addChild(new dijit.MenuItem({ label : basemap.title, onClick : dojo.hitch(this, function() { this.basemapGallery.select(basemap.id); }) })); }); } dojo.addOnLoad(init); </script> </head> <body class="claro"> <div id="content" dojotype="dijit.layout.BorderContainer" design="headline" gutters="true" style="width: 100%; height: 100%; margin: 0;"> <div id="header" dojotype="dijit.layout.ContentPane" region="top"> <div> <b>Table Of Content (TOC/Legend) Widget</b><a style="right:20px;position: absolute" href="../docs/toc/examples.html">Documentation</a> </div> <ul style="margin:2px"> <li> Click check box to turn on/off layers. When click on groups, all sublayers will be turned on/off. </li> </ul> </div> <div dojotype="dijit.layout.ContentPane" id="leftPane" region="left" splitter="true"> <div id="tocDiv"></div> </div> <div id="map" dojotype="dijit.layout.ContentPane" region="center"> <div style="position:absolute; right:50px; top:10px; z-Index:99;"> <button id="dropdownButton" iconClass="bingIcon" label="Basemaps" dojoType="dijit.form.DropDownButton"> <div dojoType="dijit.Menu" id="bingMenu"> <!--The menu items are dynamically created using the basemap gallery layers--> </div> </button> </div> </div> </div> </body> </html> Thanks for your help... R
... View more
04-25-2012
06:17 AM
|
0
|
3
|
653
|
POST
|
Hopefully this is another easy question for you all ... I have a number variable, and I want it to be formatted with commas (like 3,000 instead of 3000). My API lets the user select a bunch of polygons and it calculates a population total in the background. The number comes back correct, I just can't seem to figure out how to format it .... function sumVeterans(features) { var imputedSum = 0; //summarize the cummulative gas production to display dojo.forEach(features, function(feature) { imputedSum = imputedSum + feature.attributes.ImputedVeteran; }); //dojo.byId('messages').innerHTML = "Total Veterans: " + imputedSum + ""; var formattedImputedSum = imputedSum dojo.byId('messages').innerHTML = "Total Veterans: " + imputedSum + ""; }
... View more
04-19-2012
02:14 PM
|
0
|
3
|
636
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|