|
POST
|
Cool, that workaround does the trick for now. Look forward to taking advantage of the cache in the future. Hope it�??s not too hard for you guys to work out. Thanks a bunch Dominique for looking into this issue and providing a workaround!!! It�??s much appreciated!
... View more
11-23-2010
06:01 AM
|
0
|
0
|
1124
|
|
POST
|
Hey Dom (or others), You have any luck testing, reproducing this issue anymore? This is about the last bug I need to work out before we take our WPF XBAPs into production. I have tested this with just a regular WPF application (non-XBAP) too, and it seems to happen all the time there also. Almost happens 100% of the time when turning "off" sub layers. It seems like it is an issue with the Map control not refreshing, but not real sure how to debug the ESRI controls much more than I have. Thanks a lot for helping with this!!! Also, as a side question... Completely understand if you cannot answer this, but might the 2.1 API go final this week or next? Will wait for that to go final before deploying too. Thanks!
... View more
11-22-2010
07:54 AM
|
0
|
0
|
1124
|
|
IDEA
|
-->
In Classified Renderers, when manually setting the "Break Values", you can set a break greater than the maximum statistic, but you can NOT set a break lower than the minimum. It forces you to the value of the minimum statistic. What if you have data that might go lower than this in the future? What if you just want to set nice clean breaks? I don't see why the smallest break must be greater than or equal to the minimum statistic. This can be gotten around by loading values from another data set, but this is a lot of extra work to setup that data as needed.
... View more
11-19-2010
08:05 PM
|
15
|
2
|
15687
|
|
IDEA
|
Raster catalogs do not have a import symbology function like raster datasets. This causes a lot of extra work recreating symbology. It would be nice to not only import from other raster catalog layers, but also from raster dataset layers too. Why are raster catalogs treated any different than a standalone raster dataset? Especially if applying a classified renderer.
... View more
11-19-2010
07:55 PM
|
6
|
1
|
904
|
|
IDEA
|
Raster catalogs do not display legend/symbology information. This is very import for continuous (non-aerial) rasters that might be stored in a catalog. Why are they treated any different than a standalone raster dataset? Especially if applying a classified renderer.
... View more
11-19-2010
07:48 PM
|
26
|
3
|
1884
|
|
POST
|
Ah, very cool, great tip... that should make my code a little more efficent. Thanks Dom! In the hopes to maybe help someone else out, here is what I did: I have a wrapped template control around the ESRI legend control and it has its own LegendRefreshed which can be used by its consuming application. That consuming application can then subsicribe to this event and do as Dom said to get the Service layer and then call this method:
public void SetCustomLegend(LayerItemViewModel serviceLayerItemViewModel, String layerID, ObservableCollection<LegendItemViewModel> legendItems)
{
LayerItemViewModel layerItemViewModel = GetLegendLayer(serviceLayerItemViewModel, layerID);
if (layerItemViewModel != null)
layerItemViewModel.LegendItems = legendItems;
}
GetLegendLayer() is a part recursive, part iterative method to then get a sub-layer of the Map Layer (Service), because "e.LayerItem.Layer.ID" seems to only trigger at the Map Layer level.
protected LayerItemViewModel GetLegendLayer(LayerItemViewModel parentLayer, String layerID)
{
if(parentLayer.LayerItems != null)
{
for (Int32 i = 0; i < parentLayer.LayerItems.Count; i++)
{
//If match, return it
if (parentLayer.LayerItems.Label == layerID)
return parentLayer.LayerItems;
//Check sub layers
LayerItemViewModel layerItemViewModel = GetLegendLayer(parentLayer.LayerItems, layerID);
if (layerItemViewModel != null)
return layerItemViewModel;
//Continue checking other layers
}
}
return null;
}
Maybe there is a better way to do this... but it is working for me currently. Havn't tested it much yet though. Thanks again!
... View more
11-19-2010
07:17 AM
|
0
|
0
|
1792
|
|
POST
|
Bingo, that did it... Thanks a lot!!! Legend.Refreshed is called a bunch of times, so I just check for when Legend.LayerItems.LayerItems != null and then set it at that point. Thanks a again!
... View more
11-19-2010
05:59 AM
|
0
|
0
|
1792
|
|
POST
|
Thanks Jennifer, this gets me closer but still having some issues... If I set: Legend.LayerItems.LegendItems = newLegendItems; It works but the legend is created at the service level and is drawn there, it needs to be at a sub-layer... So I try to go one more level deeper at try: Legend.LayerItems.LayerItems .LegendItems = newLegendItems; but the second LayerItems collection is null... this should be the first row of actual layers in the service right? Legend.LayerItems is the Service (aka, MapLayer) Legend.LayerItems.LayerItems is the first set of Layers right? Also, a bit of a side question, I am using ArcGIS Server 10 SP1, but all the Legend.LayerItems are null... does this mean the legend is going out and using ESRI's legend REST service? All my services were published in 10 before SP1, do I need to publish them again? I tried publishing one from Desktop 10 SP1 and it still is null in the API... Thanks again Jennifer!!!
... View more
11-18-2010
02:25 PM
|
0
|
0
|
1792
|
|
POST
|
- In the Legend.Loaded event, LayerItems is set but inside each of the items, it's LegendItems is always null. - In the LayerItem.PropertyChanged event, e.PropertyName is never equal to "LegendItems" - Even if I pause the application after I have viewed some legend items in tree view, the LegendItems are still null (for all LayerItems layers) Since Raster Catalogs classified renderers do not come through the REST legend, I am trying to load custom images into LegendItems... but since they are always null, I'm not sure when I can do this. Thanks a lot for any help!
... View more
11-18-2010
11:45 AM
|
0
|
10
|
3091
|
|
POST
|
Sorry for all the posts about the Legend control... I really like the control but just need to work a few things out for the requirments I have :). 1) The "Description" for a service is not set but the "Description" for the sub-layers is set to that of the services "Description"... this is in the Legend.LayerItems collection which is being bound to in the XAML control... is this a bug? It seems backward... or am I doing something wrong? *EDIT* Ok, this is wierd, now all of a sudden the "Description" is set for the services that are coming from our gis server, but not from the ESRI services (Aerial, Topo, Etc)... If i use Layer.Description my tooltip is fine even on the ESRI services... *EDIT 2* I must have done something... because I don't have this issue with sublayers having the main services description anymore... not really sure why though. 2) Could you also add the "CopyrightText" to the LayerItemViewModel so I could easily bind to that aswell? *EDIT* I can just get this from "Layer.CopyrightText" in the xaml... I was affraid that might cause issues, but it seems fine... so this question is solved for me, thanks! I like to show the "Description" and "CopyrightText" in the tooltips for the service. Thanks a lot! *EDIT 3* Still not sure why the "Description" is not set on the ESRI services, but I got all my issues worked out... guess I jumped the gun on posting this here.
... View more
11-18-2010
07:54 AM
|
0
|
5
|
1504
|
|
POST
|
Good idea, that was easier... here is what I did then: Setup in controls loaded event:
//Set table of contents to show all services
List<String> layerIDs = new List<String>();
foreach (Layer layer in Maps[0].Layers)
{
layerIDs.Add(layer.ID);
//Set layer changed event to keep multiple maps in sync
if (layer is ArcGISDynamicMapServiceLayer)
{
layer.PropertyChanged += Layer_PropertyChanged;
((ArcGISDynamicMapServiceLayer)layer).VisibilityChanged += Layer_VisibilityChanged;
}
}
layerIDs.Reverse();
Legend.LayerIDs = layerIDs.ToArray();
To support service on/off
protected void Layer_PropertyChanged(Object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "Visible" && MapSplitter != null && MapSplitter.LockMaps)
{
Layer layer = (Layer)sender;
for (Int32 i = 1; i < Maps.Count; i++)
Maps.Layers[layer.ID].Visible = layer.Visible;
}
}
To support sub-layer on/off
protected void Layer_VisibilityChanged(Object sender, EventArgs e)
{
if(MapSplitter != null && MapSplitter.LockMaps)
{
Layer layer = (Layer)sender;
for (Int32 i = 1; i < Maps.Count; i++)
{
if (layer is ArcGISDynamicMapServiceLayer)
((ArcGISDynamicMapServiceLayer)Maps.Layers[layer.ID]).VisibleLayers = ((ArcGISDynamicMapServiceLayer)layer).VisibleLayers;
}
}
}
FYI, MapSplitter is a control I made for hidding and showing more than one map. Hope this maybe helps someone else in the future. Thanks a lot for your help Dominique!
... View more
11-18-2010
07:26 AM
|
0
|
0
|
3084
|
|
POST
|
Thanks Dominique! That helps! Exactly, I have another map that is a clone essentially of the first and just want to keep them in sync. I already have their extents in sync with the ExtentChanged event. I'll see what I can do with the CheckBox Changed events and keeping them in sync with that. Thanks!
... View more
11-18-2010
05:51 AM
|
0
|
0
|
3084
|
|
POST
|
Hmm, it happens to me about 80% of the time and throughout my different WPF XBAP applications... but not sure what else to debug into. I have 8 services in the map. 5 are from our own ArcGIS Server 10.0 SP1 and the other 3 are from ESRI:
<esri:ArcGISTiledMapServiceLayer ID="Imagery" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer" />
<esri:ArcGISTiledMapServiceLayer ID="Street" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" Visible="False" />
<esri:ArcGISTiledMapServiceLayer ID="Topo" Url="http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer" Visible="False" />
Hope that helps a little... thanks a lot for looking into this Dominique!
... View more
11-18-2010
05:42 AM
|
0
|
0
|
1124
|
|
POST
|
The new legend/TOC control is great... but is there any way to bind multiple maps, that contain the exact same services and layers, to the same Legend/TOC? So the same layers are visible in the different maps... I didn't see any useful events that I could use to set one map to the other either, maybe I missed something. Thanks a lot!
... View more
11-17-2010
05:44 PM
|
0
|
7
|
3949
|
|
POST
|
I have a legend toc setup almost just like the ESRI sample using the new legend control in the 2.1 api (which is GREAT btw)... when I check layers on, they seem to pretty much always turn on, but when I check a layer off, a good majority of the time the map does not refresh this data away and the progress bar just hangs at like 80-90%... I can then just do a little pan on the map and the data loads right in then. With 2.0 I built my own TOC control very much like this templated legend control... and it had the same behavior... so that is why I don't know if it is the legend control itself, but if something else is going on. Fiddler never shows an attempt to connect to the ArcGIS REST endpoint either... I was thinking before maybe it was a caching issue and 2.1 would maybe fix this issue, but it didn't. My application is a WPF XBAP by the way. An observation I have made: this issue does not ever seem to happen with the first layer that is turned on in the service, but it does with the layers folowing it... especially with layers in group layers. I can turn the first layer on and off pretty much everytime without this issue. *EDIT* After trying this some more, maybe no so much even the first layer, but if it is the only layer it always works (but a trip to the server map not be needed for that). Hope that made sense... any ideas?
... View more
11-17-2010
01:25 PM
|
0
|
6
|
1534
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-24-2023 10:43 AM | |
| 1 | 10-02-2023 02:23 PM | |
| 1 | 11-16-2016 02:05 PM | |
| 1 | 07-05-2017 09:30 AM | |
| 15 | 11-19-2010 08:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
05-01-2024
08:25 PM
|