Select to view content in your preferred language

upgrading from 2.4 to 3 is a big problem please help

967
8
04-03-2012 02:01 PM
ForamParikh
Regular Contributor
Hello everyone,

I downloaded 3.0 api and started lots of problem.

In 3.0 they removed lots of classes and members (http://resourcesbeta.arcgis.com/en/webapis/silverlight-api/concepts/#/What_s_new_in_3_0/0166000000m9... refer remove items )which i was using and now i am not sure what to do?
I want to use sceleunitbar,scalebar,uniquevaluerender.attribute,feature symbol for feature layer ,tool bar

In api 3.0 I am not even able to write even simple marker symbol
    <esri:MarkerSymbol x:Key="ongoing" OffsetX="6.5" OffsetY="6.5">
                <esri:MarkerSymbol.ControlTemplate>
                    <ControlTemplate  xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
                        <Grid RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Ellipse Width="13" Height="13" Stroke="White" StrokeThickness="2" Fill="#F6921E" HorizontalAlignment="Center"
                                     VerticalAlignment="Center" x:Name="Element" />
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Uid="SelectionStates" x:Name="SelectionStates">
                                    <VisualState x:Uid="unselectedVs" x:Name="Unselected" >
                                        <Storyboard x:Uid="unselectedSb">

                                            <ColorAnimation x:Uid="unselectColor" Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
To="#F6921E" Duration="00:00:00.25"/>
                                            <ColorAnimation x:Uid="unselectColor1" Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)"
To="White" Duration="00:00:00.25"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Uid="selectedVs" x:Name="Selected">
                                        <Storyboard x:Uid="selectedSb">
                                            <ColorAnimation x:Uid="selectedColor" Storyboard.TargetName="Element" 
Storyboard.TargetProperty="(Ellipse.Stroke).(SolidColorBrush.Color)"
            To="#FF1717" Duration="00:00:00.25"/>
                                            <ColorAnimation x:Uid="selectedColor1" Storyboard.TargetName="Element" 
Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)"
            To="#FFFF00" Duration="00:00:00.25"/>

                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                        </Grid>

                    </ControlTemplate>
                </esri:MarkerSymbol.ControlTemplate>
            </esri:MarkerSymbol>

Please help

Thanks
Foram
0 Kudos
8 Replies
DominiqueBroux
Esri Frequent Contributor
In 3.0 they removed lots of classes and members

In 3.0, objects that were already deprecated since a few versions have been removed.
Nevertheless the migration in V3.0 should be relatively straightforward (for example, the ScaleBar class is replaced by the ScaleLine in the Toolkit).
Sorry for the inconvenience, let me know if you run into specific problems.

In api 3.0 I am not even able to write even simple marker symbol

Simple marker symbol should work. What is exactly your issue?
0 Kudos
ForamParikh
Regular Contributor
Thanks Dominique BROUX

everything is working now..I changed

scalebar to scaleline
uniquevaluerender.attribute to field
featuresymbol to render
toolbar to button

and it seems everything is working fine only one thing is not working i will appropriate if you can help me,

I am using esri.prototypelab.shy (http://www.arcgis.com/home/item.html?id=d02189515c6a447da51d308fde43cd3c)
for setting effect in base map and i noticed it supports silverlight 3 and silverlight 4 but it doesn't support silverlight 5.

I created new application and i get the effect in map but i want effect in layer only.means i want gray style effect in base map only not in other feature layers and graphical layer.

this one is working fine in SL5
  ESRI.PrototypeLab.ShyBasemap.MonochromeEffect eff = new ESRI.PrototypeLab.ShyBasemap.MonochromeEffect();
  MyMap.Effect = eff;

and if i write mymap.zoomtoresolution(9)

it is working but if i write

  ESRI.PrototypeLab.ShyBasemap.MonochromeEffect eff = new ESRI.PrototypeLab.ShyBasemap.MonochromeEffect();
            ArcGISTiledMapServiceLayer tl = MyMap.Layers["StreetMapLayer"] as ArcGISTiledMapServiceLayer;
            tl.Effect = eff;

and if i write mymap.zoomtoresolution(9)
this code is working in Silverlight 4 but not working in silverlight 5.

it gives me error  Error in Silverlight Application
Code: 1001   
Category: RuntimeError      
Message: AG_E_UNKNOWN_ERROR    
MethodName:     

or do you know is there any better solution for effect?I want to make attractive base map.

Please help,
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I am using esri.prototypelab.shy (http://www.arcgis.com/home/item.html...1d308fde43cd3c)
for setting effect in base map and i noticed it supports silverlight 3 and silverlight 4 but it doesn't support silverlight 5.


I reproduced your issue with the ZoomToResolution method.
We can also reproduce that issue just by zooming in and out quickly.

From my tests, I noticed that:

  • it's not related to the Silverlight version. I reproduced the same issue with Silverlight 4 and ArcGIS SL 2.0 or 2.4.

  • it's not related to the PrototypeLab library. We can run into the same issue just by setting a SL build-in ShaderEffect such as DropShadowEffect to a TiledLayer.

  • as you noticed, it only happens when setting the effect to a layer. It's working well with maps.

That being said I failed to figure out how to solve that. I can't give you any workaroud.:confused: Sorry about that.
0 Kudos
ForamParikh
Regular Contributor
Thank you so much AMdbroux for replying me.

But if i apply effect in layer in silverlight 4 it was working for sure but it is just in silverlight 5.

Anyways do you know any other solution of this problem?I want to make attractive base map?I just want to apply style sheet I don't want to make any service on my server.

Please help,

Thanks
Foram
0 Kudos
HattieIrvin
Emerging Contributor
In 3.0, objects that were already deprecated since a few versions have been removed.
0 Kudos
ForamParikh
Regular Contributor
Thanks AMElsie93,

I changed everywhere and everything is working now in 3.0 only one problem i am getting is in applying effect to the base layer not to the whole map.I am referring http://www.arcgis.com/home/item.html?id=d02189515c6a447da51d308fde43cd3c for making my map attractive and it was working fine in silverlight 4 but now it stops working in silverlight 5.

do you know any better way to apply style sheet or effect in base map to change its color or to make it attractive because with my back ground color and all the base map looks ugly so i want to change it color.

Please help,

Thanks
Foram
0 Kudos
ForamParikh
Regular Contributor
I follow http://www.arcgis.com/home/item.html?id=baad59c4c3d64e0ea635e31d492db076 code and change little bit and i found my solution.

Thanks
Foram
0 Kudos
dotMorten_esri
Esri Notable Contributor
Just an FYI that applying pixels shaders to the layers can be very CPU intensive and expensive. If you need a gray basemap, I suggest you check out these two services:
http://services.arcgisonline.com/ArcGIS/rest/services/Canvas
0 Kudos