|
POST
|
There is probably an easy explanation for this but I noticed when I zoom in on ArcGIS online data I only get to a certain point and I can't zoom anymore where as if I have the same service in a web adf app or even ArcMap I can zoom in much farther. Is there some default zoom setting that I can change? Thanks
... View more
07-29-2010
11:45 AM
|
0
|
3
|
759
|
|
POST
|
Nevermind - I figured this out by using this sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#NavigationActions
... View more
07-29-2010
07:25 AM
|
0
|
0
|
296
|
|
POST
|
Once my Silverlight Application opens I would like to have a small box that has a few Project Area Names and upon clicking a Name it zooms to that Project area. Pretty simple huh? I know I have seen a sample on this in Silverlight but for some reason I can't find it. Does someone have some code or a link that can help me out? Thanks in advance.
... View more
07-29-2010
06:54 AM
|
0
|
1
|
670
|
|
POST
|
You haven't added the handler for MouseClick for map in your XAML. <esri:Map x:Name="MyMap" MouseMove="MyMap_MouseMove" Extent="-120, 30, -60, 60" MouseClick="MyMap_MouseClick" > <esri:Map.Layers> <esri:ArcGISTiledMapServiceLayer ID="AGOLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_ShadedRelief_World_2D/MapServer"/> <esri:ArcGISDynamicMapServiceLayer ID="DynamicLayerCalifornia" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer" InitializationFailed="Layer_InitializationFailed" /> <esri:GraphicsLayer ID="MyGraphicsLayer" /> </esri:Map.Layers> </esri:Map> </esri:Map.Layers> </esri:Map> Works great Preeti- Sorry I had forgot the most important thing, the Mouse click event 🙂 haha. Thanks again.
... View more
07-29-2010
04:37 AM
|
0
|
0
|
168
|
|
POST
|
It works fine for me...Can you send the code? Here is my code using the ESRI Rest URL's instead of my dynamicmapservice. Thanks for taking a look at it.. (I included all of it so its attached) The XAML is split into 2 files and the CS is in 2 files. the size limitations..geez
... View more
07-28-2010
01:30 PM
|
0
|
0
|
1296
|
|
POST
|
I think the spatialReference for the Wells layers is different than the basemap layer. The Extent that is going as parameter to identifytask is using the basemap's extent which probably does not match with coordinate system of the Wells layer and that is causing the identifyTask to not return any results. You can put a breakpoint in MyMap_MouseClick to see what is the extent passed to Identifytask parameters and also in IdentifyTask_ExecuteCompleted to see if any results are returned. --Preeti I thought the same thing but when I changed the MouseClick's Identify task to http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer and then I declared my DynamicMapServiceLayer to be that as well, when I debugged the application it still did not work. Shouldn't that URL be the same as the maps? Could I change the WKID of the map to be what my DynamicService is?
... View more
07-28-2010
01:05 PM
|
0
|
0
|
1296
|
|
POST
|
Hi Preeti- I took your suggestions and copied your C# and your XAML and it is nearly exactly the same now in my App. The only difference is that I use a DynamicMapServiceLayer so in the MyMap_MouseClick event I changed the URL to piont to my local map service. Everything else looks nearly the same to me but when I run my application and select the Identify button, it acts like it's active but when I select any layers in my dynamic service (wells) it never does anything. Thoughts?
... View more
07-28-2010
11:39 AM
|
0
|
0
|
1296
|
|
POST
|
Your are welcome. Note also that I kept a 'Button' because you introduce it in your sample. But you could directly use an image as it was in the original sample. In this case you have to use the MouseLeftbuttonDown event instead of Click event. Hey Dominique- You don't happen to have the codebehind for the identify tool do you? In the post I have below another developer tried zipping it to me and the file was corrupt after downloading. I was able to add the tool to my toolbar and add the case to the ToolbarItemClicked event but haven't found the code that actually does the Identify process. Just wondering http://forums.arcgis.com/threads/9124-Identify..?p=28032&posted=1#post28032
... View more
07-28-2010
06:18 AM
|
0
|
0
|
934
|
|
POST
|
The Content of a Button can be any type of UIElement:
<Button Style="{StaticResource MenuItem}" Click="DisableDrawObject" HorizontalAlignment="Right" Foreground="Black" >
<Button.Content>
<Image ........... />
</Button.Content>
........
</Button>
Wow that was easy.. Thanks.
... View more
07-28-2010
05:49 AM
|
0
|
0
|
934
|
|
POST
|
This should work:
<esriToolkit:ToolbarItem Text="Measure">
<esriToolkit:ToolbarItem.Content>
<Button Style="{StaticResource MenuItem}" Click="DisableDrawObject" HorizontalAlignment="Right" Foreground="Black" Content="Measure" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esriBehaviors:MeasureAction
AreaUnit="SquareMiles"
DisplayTotals="True"
DistanceUnit="Miles"
MapUnits="DecimalDegrees"
MeasureMode="Polygon"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="MyMap"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</esriToolkit:ToolbarItem.Content>
</esriToolkit:ToolbarItem Text="Measure">
Hi Dominique- Instead of using Text to say Measure how can I use an Image like the other tools in my Toolbar? Thanks again Dominique
... View more
07-28-2010
05:36 AM
|
0
|
0
|
934
|
|
POST
|
Actually it is pretty simple. All you need to do is add a toolbaritem to toolbar for identify tool. <esri:ToolbarItem Text="Identify"> <esri:ToolbarItem.Content> <Image Source="/Assets/images/i_about.png" Stretch="UniformToFill" Margin="5" /> </esri:ToolbarItem.Content> </esri:ToolbarItem> Create a bool variable and set it true only when "Identify" is clicked. bool identifyclick; private void MyToolbar_ToolbarItemClicked(object sender, ESRI.ArcGIS.Client.Toolkit.SelectedToolbarItemArgs e) { case 7: //Identify identifyclick = true; break; } } In Map Mouseclick event check value for this boolean variable to true before running identify logic private void MyMap_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e) { if (identifyclick) { //execute identify code identifyclick = false // at the end reset the bool variable to deactivate the identify tool. } } Basically it will be combination of ToolbarWidget sample and Identify Sample. Most of the code can be copied from Identify sample and pasted as is to toolbarWidget Sample. Attached is the sample XAML with implementation. Hope that helps Hi Preeti- When I tried to save and open that zip file it said it was corrupt and could not open. Could you just paste the Identify code needed for taht last part of your post? Thanks Preeti
... View more
07-28-2010
04:26 AM
|
0
|
0
|
1296
|
|
POST
|
Hello All- In the samples on the Resource Center I was able to add the Identify sample to my Silverlight (3.0) App and get it to work. I now want to add that as a Tool to my Toolbar. Below is the main section of code in the XAML so does anyone know how I can add it as a ToolbarItem? Many thanks, <!-- Identity-->
<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Center" Grid.Row="0" Grid.Column="2">
<StackPanel Orientation="Vertical" Margin="10" >
<Grid x:Name="IdentifyGrid" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="0,7,7,0" >
<Rectangle Fill="#22000000" RadiusX="10" RadiusY="10" Margin="0,4,0,0" />
<Rectangle Fill="#CC5C90B2" Stroke="Gray" RadiusX="10" RadiusY="10" Margin="0,0,0,5" />
<TextBlock x:Name="DataDisplayTitleTop" Text="Click on map to identify a feature" Foreground="Black" FontSize="10"
Margin="10,5,0,0" />
<TextBlock x:Name="DataDisplayTitleBottom" Text="Click on map to identify a feature" Foreground="White" FontSize="10"
Margin="10,3,0,5" />
<StackPanel Orientation="Vertical" Margin="15" HorizontalAlignment="Right" VerticalAlignment="Center">
<ComboBox x:Name="IdentifyComboBox" MinWidth="150" SelectionChanged="cb_SelectionChanged"
Margin="5,10,5,5" >
</ComboBox>
<ScrollViewer x:Name="DataGridScrollViewer" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
Width="230" MaxHeight="340" Visibility="Collapsed">
<slData:DataGrid x:Name="IdentifyDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="None"
Background="White" >
<slData:DataGrid.Columns>
<slData:DataGridTextColumn Binding="{Binding Path=Key}" FontWeight="Bold"/>
<slData:DataGridTextColumn Binding="{Binding Path=Value}"/>
</slData:DataGrid.Columns>
</slData:DataGrid>
</ScrollViewer>
</StackPanel>
</Grid>
</StackPanel>
</Canvas>
... View more
07-27-2010
01:18 PM
|
0
|
10
|
1830
|
|
POST
|
I have a dynamic layer and I know I can't put Maptips on it but I would like to do something similar so a user could see some attributes when they click a feature or better yet, hover over it. I took some code from the samples and have shown it below but it gives me a "BAD_PARSER_VALUE" error at the OutFields line. I'm not sure this is the sample I need based on what I'm asking for above. Can someone reply and let me know what I need to change? The first layer in my mapservice is an SDE point featureclass that I want to show at least 2 attributes on mouse hover. Thanks, <esri:ArcGISTiledMapServiceLayer ID="AGOLayer"
Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_ShadedRelief_World_2D/MapServer"/>
<esri:FeatureLayer ID="MyPointFeatureLayer"
Url="http://localhost/ArcGIS/rest/services/SilverTest/MapServer/0"
FeatureSymbol="{StaticResource YellowMarkerSymbol}"
OutFields="API,Operator">
<esri:FeatureLayer.Clusterer>
<esri:FlareClusterer
FlareBackground="#BBFF8C00"
MaximumFlareCount="4" />
</esri:FeatureLayer.Clusterer>
<esri:FeatureLayer.MapTip>
<Grid Background="LightYellow">
<StackPanel Margin="5">
<TextBlock Text="{Binding [API]}" FontWeight="Bold" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Web site: " />
<TextBlock Text="{Binding [Operator]}" />
</StackPanel>
</StackPanel>
<Border BorderBrush="Black" BorderThickness="1" />
</Grid>
</esri:FeatureLayer.MapTip>
</esri:FeatureLayer>
</esri:Map.Layers>
... View more
07-27-2010
06:24 AM
|
0
|
4
|
892
|
|
POST
|
This should work:
<esriToolkit:ToolbarItem Text="Measure">
<esriToolkit:ToolbarItem.Content>
<Button Style="{StaticResource MenuItem}" Click="DisableDrawObject" HorizontalAlignment="Right" Foreground="Black" Content="Measure" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esriBehaviors:MeasureAction
AreaUnit="SquareMiles"
DisplayTotals="True"
DistanceUnit="Miles"
MapUnits="DecimalDegrees"
MeasureMode="Polygon"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="MyMap"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</esriToolkit:ToolbarItem.Content>
</esriToolkit:ToolbarItem Text="Measure">
That worked, thanks Dominique
... View more
07-27-2010
04:49 AM
|
0
|
0
|
934
|
|
POST
|
Hi Dominique- Using this code below (which includes your changes from the other post, thanks) how can I simply add it as another ToolBarItem? I tried that and an error gets thrown stating that the property content is set more than once. code for measure tool: <Button Style="{StaticResource MenuItem}" Click="DisableDrawObject" HorizontalAlignment="Right" Foreground="Black"
Content="Measure" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<esriBehaviors:MeasureAction
AreaUnit="SquareMiles"
DisplayTotals="True"
DistanceUnit="Miles"
MapUnits="DecimalDegrees"
MeasureMode="Polygon"
FillSymbol="{StaticResource DefaultFillSymbol}"
TargetName="MyMap"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button> Code example for Toolbar Items: <esriToolkit:ToolbarItem Text="Zoom In">
<esriToolkit:ToolbarItem.Content>
<Image Source="Assets/images/i_zoomin.png" Stretch="UniformToFill" Margin="5" />
</esriToolkit:ToolbarItem.Content>
</esriToolkit:ToolbarItem>
<esriToolkit:ToolbarItem Text="Zoom Out">
<esriToolkit:ToolbarItem.Content>
<Image Source="Assets/images/i_zoomout.png" Stretch="UniformToFill" Margin="5" />
</esriToolkit:ToolbarItem.Content>
</esriToolkit:ToolbarItem>
... View more
07-27-2010
04:17 AM
|
0
|
0
|
934
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-15-2023 01:27 PM | |
| 1 | 05-02-2017 11:40 AM | |
| 1 | 06-16-2010 08:09 AM | |
| 1 | 05-02-2017 10:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-16-2025
02:03 PM
|