|
POST
|
Hi all- So I'm trying to render groups of values based on the blog at: Data Visualization with ArcGIS API for JavaScript: Show Data by Unique Value | ArcGIS Blog The problem is that while the renderer portion works great, I can't seem to get around the fact that the TOC wants to list the "if else if" statement text within Nianwei Liu's table of contents. Here is some code of what I've done so far, I just can't seem to around the fact that the TOC wants to list the attribute field values on which I am rendering, but is listing the function text instead:
var defSym = new SimpleFillSymbol().setStyle(SimpleFillSymbol.STYLE_SOLID);
defSym.outline.setStyle(SimpleLineSymbol.STYLE_SOLID);
var cszRenderer = new UniqueValueRenderer(defSym, function(graphic) {
if (graphic.attributes['CODE'].indexOf("DTB") !== -1 || graphic.attributes['CODE'].indexOf("DTC") !== -1 ||
graphic.attributes['CODE'].indexOf("DTE") !== -1 || graphic.attributes['CODE'].indexOf("DTN") !== -1){
return "Downtown Overlays";
} else if (graphic.attributes['CODE'].indexOf("G") !== -1 || graphic.attributes['CODE'].indexOf("GU") !== -1){
return "Government Use";
} else {
return "Other Uses";
};
});
var dtSym = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color("#808000"), 2),new Color("#FF8C00"));
cszRenderer.addValue("Downtown Overlays", dtSym);
var gSym = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color("#808080"), 2),new Color("#A4F9FE"));
cszRenderer.addValue("Government Use", gSym);
lyrCsZoning.setRenderer(cszRenderer);
Result: Any help is appreciated. If I can just somehow reverse how the renderer is set up so I can return the attribute and not the function. Some sort of nested function I think would work but I just can't see it-- Thanks- David
... View more
09-23-2014
03:16 PM
|
0
|
4
|
3165
|
|
POST
|
Hi Vikram, as you know the label layer must be drawn from the same feature layer that you wish to label. The label layer visibility is controlled by the feature layer visibility. If the feature layer is not visible, then neither is the label layer. If you want to be able to turn the label layer on/off, then you have to set up some kind of control to do so. What we did was to use Nianwei Liu's Table of Contents dijit. Here's some code, hope this helps:
/*create the layer*/
var hghColor = new Color("#004DA8");
var hghLabel = new TextSymbol().setColor(hghColor);
hghLabel.font.setSize("12").setFamily("arial").setWeight(Font.WEIGHT_BOLD);
var hghRenderer = new SimpleRenderer(hghLabel);
var hLabelLayer = new LabelLayer();
hLabelLayer.addFeatureLayer(lyrHighZones, hghRenderer, "{SCHOOL_NAME}", {howManyLabels: "ManyLabels"});
hLabelLayer.id = "HighLabels";
hLabelLayer.minScale = 72223;
hLabelLayer.setVisibility(true);
/*add to toc*/
/* Table Of Contents */
mapMain.on("layers-add-result", function(evt) {
toc = new TOC({
map: mapMain,
layerInfos: [{
layer: hLabelLayer,
title: "High School Labels"
}]
}, "tocDiv");
toc.startup();
/*add the layers*/
mapMain.addLayers([hLabelLayer, lyrHighZones]);
... View more
09-19-2014
01:04 PM
|
0
|
4
|
2580
|
|
POST
|
Yes, that will give you a quick idea on how the data is distributed. Kriging requires that the data be normally distributed or close to normal. For example, rainfall time-series data is a continuous measure but never falls below zero becauce you can't have less than no rainfall right? So in the past I would apply a natural log-tranformation to the data that forces some data values to fall below zero and thus making it pass normalizaiton tests like t and z scores. I could then take say 10 or 15 rainfall stations, log transform the data, then make a surface using kriging. Negative values are then ignored or discarded....
... View more
09-19-2014
12:49 PM
|
0
|
0
|
3223
|
|
POST
|
Hi Daniel, as Dan says the grid structure producing the stair-step will never 'disappear'. It is part of the raster structure. Natural Neighbor, bi-linear, etc will not make a difference. If you are looking into making a smooth surface of any type, I would look into the exact interpolaters such as an IDW or one of the local of global polynomial tools available in the geostatistical analyst tools. Kriging may be appropriate if your data meet normalization criteria. Keep in mind all work on grids, so you will have to export to vector and smooth where (as Dan says) possible and/or appropriate--
... View more
09-11-2014
11:31 AM
|
0
|
2
|
3223
|
|
POST
|
If you are at 10.1 or later you have to overwrite your map service to see changes to layers, such as a color change, label change, or visibility or scale changes
... View more
09-09-2014
09:04 AM
|
0
|
0
|
1987
|
|
POST
|
Hi Daniel, you are going to have to run one of the genearalizaion tools after creating your linework. Once you have an acceptable result your labelling should be fine. As far as your grid cell sizes are concerned, you need to consider things such as your minimum mapping unit and extent.
... View more
09-09-2014
09:00 AM
|
0
|
0
|
3223
|
|
POST
|
Thanks Kelly et al- I ended up borrowing the home_locate.png from arcgis online at http://cdn.arcgis.com/cdn/4922/js/esri/arcgisonline/map/css/images/home_locate.png Then, I just created a simple on load function and added Robert's code:
//on function for home button slider
mapMain.on("load", addHomeSlider);
function addHomeSlider() {
//let's add the home button slider as a created class, requrires dom-Attr
dojo.create("div", {
className: "esriSimpleSliderHomeButton",
title: 'Zoom to Full Extent',
onclick: function () {
if (extentInitial === undefined) {
extentInitial = mapMain.extent;
}
mapMain.setExtent(extentInitial);
}
}, dojo.query(".esriSimpleSliderIncrementButton")[0], "after");
}
Since I'm not utilizing a progress bar for this app, I excluded the code for displaying the status bar message. I then modified the css:
.esriSimpleSliderHomeButton {
border-bottom: 1px solid #666666;
background: url(../css/home_locate.png);
background-repeat: no-repeat;
}
.esriSimpleSliderHomeButton:hover {
background-color: rgb(102, 102, 102);
background-color: rgba(102, 102, 102, 0.9);
}
Which produced this nice clean look:
... View more
09-03-2014
02:38 PM
|
2
|
0
|
3730
|
|
POST
|
Right, thanks Ken. I thought I could pull it out of my downloaded api somewhere, but this will work too. Thanks for the data URI tip...
... View more
09-03-2014
12:52 PM
|
0
|
2
|
3730
|
|
POST
|
Hi Robert- Can you tell me where in the api you are pulling the home slider png?
background-image: url(../images/zoomExtent.png);
... View more
09-03-2014
12:39 PM
|
0
|
4
|
3730
|
|
POST
|
Hi Peter- If you want to apply something like a Fast Fourier Transformation you will probably have to set up and run the appropritate Spatail Analyst Math tools to create an FFT algorithim, a difficult task in ArcGIS but easily performed in ERDAS. In looking at your example though, I don't think you are dealing with an image anamoly, but rather a processsing anaomly created during a merge as you suggest, as such an FFT wouldn't necessarily be appropriate. I would try using the Majority Filter tool (essentially a high-pass filter) first, changing the input paramters for neighbors and definition unitl you produce a reasonable surface.
... View more
09-02-2014
08:02 AM
|
1
|
0
|
1049
|
|
POST
|
Good one Robert, I'd been looking for this one for some time myself- Thank!
... View more
08-26-2014
02:20 PM
|
0
|
0
|
3730
|
|
POST
|
There's something going on with the algorithm. I'm getting the same thing. A very simple case below shows a label layer applied to a half-township section grid. I am also at 3.10 and still get missing labels, regardless of various parameter changes I've applied
... View more
08-25-2014
12:10 PM
|
0
|
0
|
2026
|
|
POST
|
Well, there's not much to tell. Prior to our move to SQL Geometry at 10.1, I found that for certain utilities feature classes like hydrants, there would be from time to time more rows in the business table than in the feature (f) table. I discovered that nugget as I was transforming data into Intergraph format via FME. I didn't even think it was possible to create or otherwise load rows into a feature class using standard ArcGIS front-end methods and not create geometry, but it happened. So it's not a primary key error per say, it's more of a key-constraint violation I would guess. What I suspect had happened is that hydrants data, coming in from an xy event table created from a spreadsheet perhaps had inverted x,y's or were perhaps in a differenent coordinate system, or had differenent units. But because we use well-defined x,y domains, resolution and tolerances I think the information was added to the A and F table but upon, reconcile, post and/or compress, the invalid values in the F table were dropped, but the business rows remained. That's my theory.
... View more
08-25-2014
09:51 AM
|
0
|
0
|
2065
|
|
POST
|
Hey Dave, I had something like this awhile back before we moved over to sql geometry, only in reverse to what you describe, i.e. more business records than geometry. It was happening because certain editors were copying and pasting records from spreadsheets in a way that was violating the key constraints. Basically I set up sql scripts to remove the dups and clean any and all dependencies in both directions. I've got some scripts somewhere, I'll see if I can round them up if you don't have this solved-
... View more
08-21-2014
09:05 AM
|
0
|
2
|
2065
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 2 | a month ago | |
| 1 | 03-27-2026 01:27 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|