POST
|
Awesome. Thanks, Rich! Your suggestion finally makes it work. Marked as answered. Thanks again! Steve
... View more
08-30-2012
07:40 AM
|
0
|
0
|
840
|
POST
|
Hi Rich, I tried adding another dojo connect on the mapPanel but it did not solve the issue: dojo.connect(dijit.byId('mapPanel'), 'resize', function(map) {
map.resize;
});
... View more
08-30-2012
07:20 AM
|
0
|
0
|
840
|
POST
|
I've pieced together a webpage template with a small header, a collapsible left panel (using the dojo ExpandoPane) and the rest of the screen is devoted to the map area. If the browser window's width is changed, the map will resize accordingly. If the ExpandoPane is minimized using the button, the map simply moves left and does not resize to fit the enlarged screen space. It's probably something simple but I can't figure out where I've gone wrong. Anyone out there see my mistake? Here's my stripped down page: <!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" /> <!--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>Template</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/dojox/layout/resources/ResizeHandle.css"/> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dojox/layout/resources/ExpandoPane.css"/> <style type="text/css"> html, body { width: 100%; height: 100%; margin: 0; background-color:#DEDEDE; overflow:hidden; font-family: Arial, Helvetica, sans-serif; } #borderContainer { width: 100%; height: 100%; padding:3px } #mapPanel { background: #CFCFCF; height: 100%; width: 100% } #map { width:100%; height: 100% } #leftPanel { background: #F8F8F8; margin: 0px; height: 100%; width: 35% } #headerPanel { background: #FFFFFF; padding: 3px; height:6%; padding-bottom: 5px; border-bottom: solid 3px black } #contentPanel { height: 94%; width: 100% } .claro .dijitAccordionTitle { color: #5B5B5B; } .claro .dijitAccordionTitleHover { color: #000000; } .claro .dijitAccordionInnerContainerSelected .dijitAccordionTitle { color: #000000; font-weight: bold } .dojoxExpandoTitleNode { color: #8A8A8A; font-size: 85%; font-weight: normal; font-style: italic } .claro .dijitTooltipContainer { font-weight:bold; } </style> <script type="text/javascript">var 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("dijit.dijit"); // optimize: load dijit layer dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("dojox.layout.ExpandoPane"); dojo.require("dojo.parser"); dojo.require("esri.dijit.Popup"); dojo.require("dijit.layout.AccordionContainer"); dojo.require("dijit.Tooltip"); dojo.require("dijit.Dialog"); var map; var dialogBox; function init() { var initialExtent = new esri.geometry.Extent({ "xmin": -13592500,"ymin": 6060280,"xmax": -13506825,"ymax": 6166129,"spatialReference": {"wkid": 3857} }); var popup = new esri.dijit.Popup(null, dojo.create("div")); map = new esri.Map("map", { extent: initialExtent }); dojo.connect(map, 'onLoad', function(theMap) { dojo.connect(window, 'resize', map, map.resize); }); var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); map.addLayer(basemap); //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', function(map) { map.resize; }); //resize the map when the ExpandoPane resizes dojo.connect(dijit.byId('leftPanel'), 'onHide', function(map) { map.resize; }); } // resize the map window when the browser window is resized function resizeMap() { map.resize(); map.reposition(); } dojo.ready(function(){ // create a new Tooltip and connect it to the panes within the accordion widget new dijit.Tooltip({ connectId: ["closureSection_button", "dataLayerSection_button","mapLegendSection_button","disclaimerSection_button"], label: "Click to view this section" }); }); dojo.addOnLoad(init); </script> </head> <body class="claro" onresize="resizeMap();"> <div id="headerPanel" dojotype="dijit.layout.BorderContainer" class="dijitContentPane"> <div style="width:100%;height:100%"> <SPAN style="width:100%"><SPAN style = "font-size:185%;font-weight:900;padding-left:5px;text-shadow: 1px 1px #CFCFCF">A Page Title</SPAN> </div> </div> <div id="contentPanel" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainer"> <div id="leftPanel" data-dojo-type="dojox.layout.ExpandoPane" title="Click the Arrow to Minimize this Panel" data-dojo-props="title: 'To Minimize this Panel, Click the Arrow', splitter:true, region:'leading'" style="width: 400px;"> <div dojoType="dijit.layout.AccordionContainer"> <div id="closureSection" dojoType="dijit.layout.ContentPane" title="Content Section 01" data-dojo-props="label:'Click to Expand'" selected="true"> </div> <div id="dataLayerSection" dojoType="dijit.layout.ContentPane" title="Content Section 02" data-dojo-props="label:'Click to Expand'"> </div> <div id="mapLegendSection" dojoType="dijit.layout.ContentPane" title="Content Section 03" data-dojo-props="label:'Click to Expand'"> </div> <div id="disclaimerSection" dojoType="dijit.layout.ContentPane" title="Content Section 04"> </div> </div> </div> <div id="mapPanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="splitter:true, region:'center'" style="border-style:solid, border-width:1px;border-color:black;padding:0px !important"> <div id="map" ></div> </div> </div> </body> </html>
... View more
08-30-2012
07:03 AM
|
0
|
5
|
3790
|
POST
|
There was some code I was looking at this week about infoWindows and keeping them within the visible screen. Maybe this thread can help you. Otherwise, you could try something like this where you base the dimensions on a percentage of the map's overall dimensions: map.infoWindow.resize(map.width * 0.75,map.height * 0.6); Steve
... View more
08-24-2012
02:45 PM
|
0
|
0
|
316
|
POST
|
Thanks, John. I marked your response with "answered" since that's an ESRI sample (albeit buried in the hidden corners of ESRIdom). I did not try a comma specifically but I did add the "fieldDelimiter" parameter like in that example and it wasn't honoring it. I had close to 30 unique values I wanted to symbolize and that was A LOT of formatted code in my function. I ended up dumping all of that in favor of using the renderer.AddValue() method which cleaned things up quite a bit and works for me. So, during the JSON import, I just apply a simple marker symbol to the data and then once the FeatureLayer is created, I overwrite the original renderer with the unique values renderer. Everyone's happy! 😄 Steve
... View more
08-22-2012
07:07 AM
|
0
|
0
|
1158
|
POST
|
I am working on the code to add a FeatureLayer based on a JSON feed. I'm currently using a unique value renderer based on one field in the data and I'm using the style shown in the API documentation for esri.renderer.uniqueValueRenderer(json). Let's say the field I'm currently using categorizes damage (Wind, Flood, Fire, etc) but there is an additional field which indicates severity (Low, Medium, High). I want to now incorporate that second field into my renderer. My current renderer code would look something like this: "drawingInfo": { "renderer": { "type": "uniqueValue", "field1": "Category", "defaultSymbol": { "type": "esriPMS", "url": "a/url/default.gif", "contentType": "image/gif", "width": 18, "height": 18 }, "uniqueValueInfos": [{ "value": "Flood", "symbol": { "type": "esriPMS", "url": "a/url/flood.gif", "contentType": "image/gif", "width": 18, "height": 18 } }, To now incorporate the second field, would I just do the following? "drawingInfo": { "renderer": { "type": "uniqueValue", "field1": "Category", "field2": "severity", "defaultSymbol": { "type": "esriPMS", "url": "a/url/default.gif", "contentType": "image/gif", "width": 18, "height": 18 }, "uniqueValueInfos": [{ "value": "Flood:Low", "symbol": { "type": "esriPMS", "url": "a/url/floodLow.gif", "contentType": "image/gif", "width": 18, "height": 18 } },{ "value": "Flood:Medium", "symbol": { "type": "esriPMS", "url": "a/url/floodMedium.gif", "contentType": "image/gif", "width": 18, "height": 18 } } Thanks again! Steve
... View more
08-21-2012
09:58 AM
|
0
|
3
|
3707
|
POST
|
Well HALLELUJAH! I have solved the mystery of date formatting! Your suggestion, Rene, still didn't work for me so I kept playing with it. If I manually typed things in within the javascript console, it would work. If I used the same thing within my javascript function, it would not. This got me thinking that perhaps the date returned via the query was a string instead of a number. To test it, I tried adding the "parseInt" function: alert(new Date(parseInt(rowdata.dateCl))); Lo and behold- it now works in Chrome and STILL works in Firefox. Thank god! That was maddening. Thanks again, Rene for helping me out!
... View more
08-20-2012
09:09 AM
|
0
|
0
|
591
|
POST
|
Thanks Rene for the the link to moment. I'm feeling a bit dense but I can't seem to get it to work with the dates from my data. The dates are being returned through a query so the "format" of the information coming back is a series of numbers such as "1300406400000". I tried using moment like this but it doesn't work: var temp = moment(new date(theClosureDate));
alert(temp.format('M/DD/YYYY'));
... View more
08-17-2012
03:09 PM
|
0
|
0
|
591
|
POST
|
You could try hosting the datagrid CSS styling file on your network and then modify the appropriate tag. This is what I'm doing for my datagrid implementation. The CSS file used for styling the datagrids is named "grid.CSS" Use the Firebug add-in for Firefox to make your local copy of the CSS file as well as determine which entity provides the styling for the cell color (with my version it appears to be ".dojoxGrid td"). Modify the color reference in the CSS file and you should be good to go. (I'm still using v2.8 btw)..
... View more
08-17-2012
12:46 PM
|
0
|
0
|
332
|
POST
|
On the page I've been developing, I've been populating a datagrid with attributes from a feature layer. A few of the attributes are date fields. I found out the hard way about the the format of date values returned through the API so I looked for a function to properly format my dates and times back into xx/xx/xxxx and xx:xx ampm formats. I settled on the following functions which use dojo: function formatDate(value){
var inputDate = new Date(value);
return dojo.date.locale.format(inputDate, {
selector: 'date',
datePattern: 'MM/dd/yyyy'
});
}
function formatTime(value){
var inputTime = new Date(value);
return dojo.date.locale.format(inputTime, {
selector: 'date',
datePattern: 'K:mm a'
});
} The routines are used in a formatter() function for one of my columns in the datagrid like this: var rowdata = this.grid.getItem(rowIndex);
var theClosureDate = rowdata.dateCl;
alert(formatDate(theClosureDate)); Here's where it gets weird- I've been doing my development and debugging with Firefox and the dates displayed are correct. I just loaded the page in Chrome and IE-8 and the dates displayed are "NaN". Does anyone have a conversion function they can share which works across all browsers? It would be especially great if it also handled the UTC/local time difference. I realized that these routines don't. Thank you! Steve
... View more
08-17-2012
10:28 AM
|
0
|
4
|
1780
|
POST
|
Hi Anthony, I hadn't thought of trying that but I just did and the results are the same. I'm using Version 10 SP-5 for my desktop environment..
... View more
08-08-2012
02:59 PM
|
0
|
0
|
433
|
POST
|
I originally posted this in the ArcGIS Server 10.0 forum but I haven't received any responses. Trying my luck in this forum- We're developing basemaps (in ArcGIS Server 10.0) and I'm now working on road annotation for one of the services. I used Maplex to create the initial labels, and then did some additional clean up. The annotation layer is currently in a File Geodatabase and included in a MXD which has (for the time being) been served up as a dynamic map service based on an MSD file. In the screenshot I've attached, the MXD view is displayed on the left, and the javascript viewer of the map service is on the right side. What I've noticed is that my anno text is getting "condensed" in the map service (right side) but displays fine in Arcmap (left side). For example, the label for "Paradise Lake Rd" in the right center of each display. The "e" and "L" have collapsed on top of each other. What would cause this and what can I do about it? Thank you! Steve
... View more
08-08-2012
01:49 PM
|
0
|
2
|
571
|
POST
|
FYI- I just came across my notes from the ESRI UC workshop I mentioned in my original post. Their slide says to look at Knowledge Base 30494 for the US Streets example. I just searched on that number and nothing was returned..
... View more
08-08-2012
01:28 PM
|
0
|
0
|
1419
|
POST
|
Awesome! Thanks, Elliott. Your file imported just fine..
... View more
08-03-2012
01:51 PM
|
0
|
0
|
1419
|
POST
|
At the conference in the workshop about using Maplex, the presenters mentioned that there was a USPS abbreviation dictionary available but I can't seem to find it on any of the ESRI pages (or desktop help). Am I just missing the link?
... View more
07-31-2012
08:16 AM
|
0
|
7
|
6553
|
Title | Kudos | Posted |
---|---|---|
2 | Tuesday | |
1 | 10-31-2024 02:51 PM | |
1 | a week ago | |
1 | 2 weeks ago | |
1 | 01-25-2024 08:29 AM |