POST
|
Hi, I'm Creating a "thematics map tool", and i'm having trouble to set a property to change the opacity on the Layer I present with them. <ListBox x:Name="nomeTematico" Grid.Row="1" Margin="0,0,0,217" Background="#FFFEFEFE"
BorderBrush="{x:Null}" Foreground="#FF245489">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Margin="2"
IsChecked="{Binding DefaultVisibility}"
Tag="{Binding ID}"
ClickMode="Press"
Checked="AtivaVisualizacaoDeTematico"
Unchecked="DesativaVisualizacaoDeTematico"/>
<Slider Maximum="1" Value="{Binding Opacity??, Mode=TwoWay}" Width="40" Margin="0,0,8,0" />
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox x:Name="legendaTematico" BorderBrush="{x:Null}" Margin="20,43,0,5" Grid.Row="1"/> This is the code to my thematics window, and the following code shows the moment I select a theme: private void AtivaVisualizacaoDeTematico(object sender, RoutedEventArgs e)
{
if (sender is CheckBox)
{
this.tematicoExibido = sender as CheckBox;
}
if (this.tematicoExibido != null)
{
string serviceName = this.comboTematico.SelectedItem as string;
int indiceDaCamada = (int)tematicoExibido.Tag;
ArcGISDynamicMapServiceLayer camadaDeTematicos = mapaEmExecucao.Layers["Mapa Tematicos"] as ArcGISDynamicMapServiceLayer;
List<int> subCamadasVisiveis;
if (camadaDeTematicos.VisibleLayers != null)
{
subCamadasVisiveis = camadaDeTematicos.VisibleLayers.ToList();
}
else
{
subCamadasVisiveis = new List<int>();
}
if (!subCamadasVisiveis.Contains(indiceDaCamada))
{
subCamadasVisiveis.Add(indiceDaCamada);
}
camadaDeTematicos.VisibleLayers = subCamadasVisiveis.ToArray();
}
}
private void DesativaVisualizacaoDeTematico(object sender, RoutedEventArgs e)
{
if (sender is CheckBox)
{
this.tematicoExibido = sender as CheckBox;
}
if (this.tematicoExibido != null)
{
string serviceName = this.comboTematico.SelectedItem as string;
int indiceDaCamada = (int)tematicoExibido.Tag;
ArcGISDynamicMapServiceLayer camadaDeTematicos = mapaEmExecucao.Layers["Mapa Tematicos"] as ArcGISDynamicMapServiceLayer;
List<int> subCamadasVisiveis;
if (camadaDeTematicos.VisibleLayers != null)
{
subCamadasVisiveis = camadaDeTematicos.VisibleLayers.ToList();
}
else
{
subCamadasVisiveis = new List<int>();
}
if (subCamadasVisiveis.Contains(indiceDaCamada))
{
subCamadasVisiveis.Remove(indiceDaCamada);
}
camadaDeTematicos.VisibleLayers = subCamadasVisiveis.ToArray();
}
}
... View more
03-19-2012
11:13 AM
|
0
|
1
|
283
|
POST
|
Hi again, I'm still trying to make it work, but now I'm trying a different approach: I made now two graphics: one with the image, another with the text. The image symbol is working well, but I now have the same problem I had on the text Field. Here is the template I tried to build: <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<esri:TextSymbol x:Key="MarcadorTextualDaFerramentaCoordenadas">
<esri:TextSymbol.ControlTemplate>
<ControlTemplate>
<TextBlock Text="What Goes here?"
FontFamily="Portable User Interface"
FontWeight="Bold"
FontSize="10"
Foreground="Red"/>
</ControlTemplate>
</esri:TextSymbol.ControlTemplate>
</esri:TextSymbol>
</ResourceDictionary>
The problem in it is that I don't know what to bind the textblock to...
... View more
03-08-2012
09:27 AM
|
0
|
0
|
137
|
POST
|
Hi, I'm build a coordinate search to my appication. To do so, I'm using the following MarkerSymbol, to show the coordinates and a image that represents the point. <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<esri:MarkerSymbol x:Key="MarcadorCustomizadoFerramentaCoordenadas" OffsetX="8" OffsetY="31">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="/ViewModel;component/RecursosGraficos/Imagens/marcadorCoordenadas.png"/>
<Border BorderBrush="Green" Background="White" BorderThickness="1">
<TextBlock Text="{Binding [Coordenadas]}" TextAlignment="Left" VerticalAlignment="Center"
FontFamily="Portable User Interface"/>
</Border>
</StackPanel>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>
</ResourceDictionary> The problem in this code is that the Binding get no value. This Binding was originaly on a MapTip code on the GraphicsLayer, and there it works fine. Does Anyone knows how to make it work as a Graphic Symbol? This is how I set the Marker as Symbol of the Graphic: private void AdicionaPontoNoGraficsLayer(MapPoint ponto)
{
mapaEmExecucao.PanTo(ponto);
Graphic bandeiraBuscaPorCoordenadas = new Graphic();
bandeiraBuscaPorCoordenadas.Attributes.Add("Coordenadas",
string.Format("X: {0}\nY: {1}",
Math.Round(ponto.X, 4),
Math.Round(ponto.Y, 4)));
bandeiraBuscaPorCoordenadas.Geometry = ponto;
bandeiraBuscaPorCoordenadas.Symbol = RecursosGraficos.RecursosGraficos.ObtemImagem(RecursosGraficos.RecursosGraficos.Imagens.MarcadorCustomizadoFerramentaCoordenadas);
GraphicsLayer resultadoBuscaCoordenada = mapaEmExecucao.Layers["ExibePontosFerramentaCoordenadas"] as GraphicsLayer;
resultadoBuscaCoordenada.Graphics.Add(bandeiraBuscaPorCoordenadas);
}
... View more
03-08-2012
03:50 AM
|
0
|
2
|
741
|
POST
|
Have you tried running the code inside Dispatcher.BeginInvoke()? I don't know if that will make a difference but I think you can also use either LayoutUpdated or SizeChanged event. http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.layoutupdated%28v=vs.95%29.aspx. You can subscribe to this event only if Map.ExtentChanged. Hi, None of the above worked. I've made some progress since I posted my question. It still need improvement, but using the Map.Progress event managed to get the final view of the map in 80 to 85% of the time, like this: MyMap.Progress += (s, e) =>
{
if (e.Progress == 100)
{
WriteableBitmap imagem = new WriteableBitmap(paginaImressaoRetratoA4, null);
this.visualizacaoDaPagina.Source = imagem;
}
}; It still bugs some times, showing the map incomplete.
... View more
01-26-2012
06:46 AM
|
0
|
0
|
134
|
POST
|
Hi, In my application I need to get a new image of the my map every time it is updated (zoom or pan funcionalities). I'm using the Map.ExtentChanged Event, but Sometimes the Image is shot before the Whole map is Shown. Is there any event or property that could show me the exact moment that the map finishes rendering? MyMap.ExtentChanged += (s, e) =>
{
WriteableBitmap imagem = new WriteableBitmap(MyMap, null);
mapImagePreview.Source = imagem;
mapImagePreview.HorizontalAlignment = HorizontalAlignment.Center;
mapImagePreview.VerticalAlignment = VerticalAlignment.Center;
mapImagePreview.Stretch = Stretch.Uniform;
imagem.Render(MyMap, null);
};
... View more
01-25-2012
08:22 AM
|
0
|
2
|
595
|
POST
|
What do you mean? I just tested and I am able to view the live application and I am able to download the code and get the ScrollableMap.cs file. Hi, I managed to get the code (the proxy on my workplace was blocking the page), but I couldn't use the "hack" to assign the mouseLeftButtonDown/Up to the map. The path to my map is something like this: I have my ScrollViwer, and inside of it a Grid. The Grid gets through code the UserControl I use to define the ScrollViwer's content. It has another Grid that holds a StackPanel, that has Border countaining a Grid that has the Map, and a Navigator. <ScrollViewer Margin="0,8,8,8"
BorderBrush="{x:Null}"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<Grid x:Name="GridThatHoldsTheContent"/>
</ScrollViewer> <!-- ... -->
<StackPanel Grid.Row="0"
MaxHeight="1454"
VerticalAlignment="Top"
Margin="25,25,28,0">
<Border BorderThickness="1"
BorderBrush="Black">
<Grid>
<esri:Map x:Name="Mapa"
VerticalAlignment="Top"
WrapAround="True"
Background="#FFC3D2E5"
IsLogoVisible="False"
Height="1187">
<i:Interaction.Triggers>
<i:EventTrigger EventName="ExtentChanged">
<i:InvokeCommandAction Command="{Binding AcaoExtentChanged}"
CommandParameter="{Binding ElementName=Mapa}"/>
<ei:CallMethodAction MethodName="InvocaOMetodoDeHistoricosDoMapaNaViewModel"
TargetObject="{Binding ElementName=PaginaRetratoA3}"/>
<ei:CallMethodAction MethodName="ConfiguraExibicaoDeLegenda"
TargetObject="{Binding ElementName=PaginaRetratoA3}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</esri:Map>
<esri:Navigation VerticalAlignment="Bottom"
Margin="10,0,0,10" Background="#FF336397"
Style="{StaticResource EstiloNavegadorImpressao}"
Map="{Binding ElementName=Mapa}"/>
</Grid>
</Border>
<!-- ... -->
</StackPanel> What should I do?
... View more
01-17-2012
09:45 AM
|
0
|
0
|
264
|
POST
|
Look at this sample. There is a hack at the end of ScrollableMap.cs (without any guarantee though) The sample didn't open...
... View more
01-16-2012
07:12 AM
|
0
|
0
|
264
|
POST
|
Hi, In my project, I have a map that needs to be inside a ScrollBar. My problem is that when I do so, I lose the Pan functionality of the map. I really must find some way to make the pan work, and i also must give the user the possibility to scrolling possibility on the window (a ChildWindow) so it can see the whole content of the page.
... View more
01-16-2012
02:45 AM
|
0
|
6
|
727
|
POST
|
If, for any reason, you need to get the list of legend infos out of the legend control, you can use the QueryLegendInfos method that exist on all layer supporting the legend. That being said, for your sample, you should be able to use the legend control and to retemplate it to get the expected result (for example with a WrapPanel, there is a sample here : http://www.arcgis.com/home/item.html?id=c673bf3e983b418495eeb0f45bb44c68) Hi, The QueryLegendInfos method do work, but it brings every legend, without the scale filter. This problem i'm already working on, but even with my code to control it, different layers may have, in my case, the same the same info, like Ocean and state limits, and that info is been shown many times in the wrappanel. Is there any way to work that around?
... View more
12-26-2011
01:25 AM
|
0
|
0
|
265
|
POST
|
Are you talking about this Print sample? http://help.arcgis.com/en/webapi/silverlight/3.0/samples/start.htm#ExportWebMap. I hadn't seen this sample. Also, I couldn't make it work, when i click at the button nothing happens... This sample use our Legend control http://help.arcgis.com/en/webapi/silverlight/3.0/samples/start.htm#LegendWithTemplates. The legend displays symbols from layer renderer. If you modify this sample to apply a different renderer to the FeatureLayer, this will be used by Legend control. If you want to get to the service-defined renderer, when the layer is initialized, you can check LayerInfo.Renderer. About the Legend, I need this information, to show on the page. Something like this:
... View more
12-14-2011
08:44 AM
|
0
|
0
|
265
|
POST
|
Hi, I'm doing a Silvelight application, and in it I need to get the info about the legend of the map, so I can add it on a printing funtionality. I know that the esri legend class gets it from the rest service (something like http://server/ArcGIS/rest/services/Folder/Service/MapServer/legend) but i don't know how to get this list myself, and i need to get a specific list of items from it (the ones been used - the info about what's shown on the map - at the moment the user clicks the print button). Does anyone know how to do it?
... View more
12-14-2011
06:49 AM
|
0
|
5
|
1897
|
POST
|
hi again, It actually worked, I was my mistake... I was cleaning the value of the "InfoObject" just before trying to get it... when i discovered it, I almost had a heart attack... Well, thanks a lot for the help!
... View more
11-21-2011
07:43 AM
|
0
|
0
|
158
|
POST
|
Hi, I tried to implement your sugestion, but it didn't save. Here's the current code I'm working on: private void InsertByCoordinates(object parameter)
{
Map map = parameter as Map;
if (map != null)
{
FeatureLayer editableLayer = map.Layers["Editable Layer"] as FeatureLayer;
Graphic graphic = new Graphic()
{
Geometry = new MapPoint(double.Parse(X), double.Parse(Y), map.SpatialReference)
};
var atributes = editableLayer.LayerInfo.Templates.FirstOrDefault().Value.PrototypeAttributes;
foreach (var atribute in atributes)
{
graphic.Attributes[atribute.Key] = atribute.Value;
}
graphic.Attributes.Remove("CODItemIMustPlace");
graphic.Attributes.Add("CODItemIMustPlace", InfoObject.CodItemIMustPlace);
editableLayer.Graphics.Add(graphic);
editableLayer.SaveEdits();
}
} It executes and place the graphic on the right place, but it doesn't save...
... View more
11-21-2011
02:53 AM
|
0
|
0
|
158
|
POST
|
Hi, I'm making a silverlight application with the ArcGIS API for Silverlight, and in it i need to do online edition to mark constructions, and i'm having a lot of trouble with a specific case. I need to insert a mark by receiving the X,Y coordinates. I tryed adding at the graphics list on the feature layer, with it auto and manual saving, and didn't work. My second attempt was with the Editor class, but the add command requires that the user click on the map, and I can't bypass it, no matter what i try. I need to know if there's any other way to add map points at the feature layers and save it.
... View more
11-18-2011
09:41 AM
|
0
|
3
|
481
|
Title | Kudos | Posted |
---|---|---|
1 | 04-03-2019 06:39 AM | |
2 | 06-11-2019 10:07 AM | |
2 | 06-10-2019 01:17 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|