POST
|
Compare the XY of the vehicle to the current map extent. If it falls outside of the current map extent zoom to the XY vehicle location.
... View more
09-30-2014
09:12 AM
|
0
|
2
|
213
|
POST
|
This is what I use: System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("HelpDoc.pdf", UriKind.RelativeOrAbsolute), "_blank");
... View more
06-27-2014
08:20 AM
|
0
|
0
|
253
|
POST
|
Bangel, Are you talking about while publishing the service? At what level (in what folder) am I publishing the service? I have one sub-folder in the root level. My services are published to that sub-folder. Is that the problem?? I explained it incorrectly. I am referring to how you add the service to your viewer. You add the service at the group level (not positive of the technical name). See attachment. When you look at the url of the service you've added to the map does it end in a ...mapserver or mapserver/0? It should end in ...mapserver for the labels to show up. http://blahblah/arcgis/rest/services//Topo/contours/MapServer
... View more
04-17-2014
06:14 AM
|
0
|
0
|
356
|
POST
|
What level are you defining the services? They have to be the mapserver level, i.e. ...topo/maperserver, for the labels to show. From the browse menu add at the root folder level.
... View more
04-16-2014
03:18 PM
|
0
|
0
|
356
|
POST
|
Are you sure that is an ArcGIS API for Silverlight property? ESRI.ArcGIS.Client.Extensibility
... View more
04-16-2014
12:00 PM
|
0
|
0
|
305
|
POST
|
MapApplication.Current.SelectedLayer will get you there.
... View more
04-16-2014
10:58 AM
|
0
|
0
|
305
|
POST
|
A simple no code necessary method we implemented uses a virtual directory and http link in the feature.
... View more
03-31-2014
10:04 AM
|
0
|
0
|
1126
|
POST
|
For Internet Explorer it is Tools->Internet Options->General Tab-Browsing History-Settings->Temporary Internet Files-View Files->Select all files and delete.
... View more
02-19-2014
09:15 AM
|
0
|
0
|
454
|
POST
|
Create your toolbar in Glass.xml <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="1" >
<ContentControl x:Name="MyCustomToolbar" Margin="0,0,0,0"/>
</StackPanel> Then add it to the Tools.xml <ToolPanel Name="My Custom Toolbar" ContainerName="MyCustomToolbar" Orientation="Horizontal">
<Tools>
</Tools>
</ToolPanel>
As long as your toolbars are listed in the Tools.xml file you will be able to modify the contents with the viewer. All you're doing is creating another stack panel the viewer will use to add/remove content. You can modify the icon styles in the Shared_Resources.xml file, i.e. my icons are height of 25.
... View more
02-10-2014
01:25 PM
|
0
|
0
|
489
|
POST
|
Something like this should work. public List<string> fields = new List<string>();
foreach (var element in ((FeatureLayer)MapApplication.Current.SelectedLayer).LayerInfo.Fields)
{
fields.Add(element.FieldName.ToString());
}
Listbox.ItemsSource = fields;
... View more
02-06-2014
05:55 AM
|
0
|
0
|
127
|
POST
|
No problem. I utilize one bookmark for users and one for predefined areas. [ATTACH=CONFIG]31150[/ATTACH]
public partial class CustomBookmark : UserControl, ICommand
{
public int _SelectedIndex = -1;
public string _SelectedName = null;
private CustomBookmark mywindow = null;
private CustomBookmark myBookmark = null;
Bookmark.MapBookmark bookmark = new Bookmark.MapBookmark();
public CustomBookmark()
{
InitializeComponent();
MapApplication.Current.Initialized += Layers_LayersInitialized;
}
void Layers_LayersInitialized(object sender, EventArgs args)
{
myBookmark = myBookmark ?? new CustomBookmark();
Envelope myExtent = new Envelope(-13544922.588580575, 6058265.2502668081, -13621063.588580577, 6025801.7182497317);
TestBookmarks.AddBookmark("District All", myExtent);
}
private void BookmarkList_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
// This function obtains the index location of the last cell a user clicked in the DataGrid
// sub-component in the Bookmark Control. It stores that value in the Global variable _SelectedIndex.
// Note: There is a bug in the Bookmark.SelectionChanged Event where it always fires twice when a
// DataGrid cell is selected. The first time the Bookmark.SelectionChanged Event fires the correct
// DataGrid.SelectedIndex value is obtained but then the Event fires a second time and always
// set the DataGrid.SelectedIndex value to -1. So this code is a workaround.
// Get the DataGrid sub-component of the Bookmark Control.
DataGrid myDataGrid = (DataGrid)sender;
// Get the ObservableCollection<MapBookmark> objects (aka. the named Map.Extent values).
System.Collections.ObjectModel.ObservableCollection<ESRI.ArcGIS.Client.Toolkit.Bookmark.MapBookmark> theBookmarks = null;
theBookmarks = MyBookmarks.Bookmarks;
//theBookmarks = myDataGrid.ItemsSource; // This would work too!
// Only perform this operation if there at least one named Map.Extent (aka. a bookmark) value.
if (theBookmarks.Count > 0)
{
// Screen out the second firing of this Event.
if (myDataGrid.SelectedIndex != -1)
{
// Set the Member variable to the currently selected cell in the DataGrid sub-component of the BookMark
// Control. NOTE: the DataGrid.SelectionMode was set to 'Single' in XAML so that only one bookmark could
// be selected at a time for the ClearSelectedBookmark Button to work appropriately.
_SelectedIndex = myDataGrid.SelectedIndex;
_SelectedName = myDataGrid.SelectedItem.ToString();
}
}
}
private void ClearSelectedBookmark_Click(object sender, System.Windows.RoutedEventArgs e)
{
// This function deletes a named Map.Extent (aka. a bookmark) from the DataGrid portion of the
// Bookmark Control via its index location. The _SelectedIndex object is a global (aka. Member)
// variable and hold the current value of the DataGrid.SelectedItem.
// Only process _SelectedIndex values not equal to -1.
if (_SelectedIndex != -1)
{
// Delete the specific named Map.Extent (aka. a bookmark) at the specified _SelectedIndex value.
MyBookmarks.DeleteBookmarkAt(_SelectedIndex);
}
}
private void AddBookmarkNEW_Click(object sender, System.Windows.RoutedEventArgs e)
{
// This function obtains the sub-component TextBox that of the Bookmark Control where the user
// enters a name for the Map.Extent from the XAML hierarchy defined in the ControlTemplate. In
// the case of the XAML code you need to go up two levels (i.e. Parent) in order to use the
// .FindName() function to obtain the desired TextBox by its name. Then add a named Map.Extent
// (aka. a bookmark) to the DataGrid sub-components of the Bookmark Control. Finally, clear out
// the text of the TextBox after the newly added Bookmark was added.
// Traverse through the ControlTemplate hierarchy of controls to find the desired TextBox.
Button myButton = (Button)sender;
Grid myGrid1 = (Grid)myButton.Parent;
Grid mygrid2 = (Grid)myGrid1.Parent;
TextBox myTextBox = (TextBox)mygrid2.FindName("AddBookmarkName");
// Add a bookmark for the current Map.Extent using the name in the TextBox provided by the user.
MyBookmarks.AddBookmark(myTextBox.Text, MapApplication.Current.Map.Extent);
// Clear out the text in the TextBox for the next round.
myTextBox.Text = "";
}
private void CopyBookmarkLink_Click(object sender, RoutedEventArgs e)
{
// Get the ObservableCollection<MapBookmark> objects (aka. the named Map.Extent values).
System.Collections.ObjectModel.ObservableCollection<ESRI.ArcGIS.Client.Toolkit.Bookmark.MapBookmark> theBookmarks = null;
theBookmarks = MyBookmarks.Bookmarks;
// Only perform this operation if there at least one named Map.Extent (aka. a bookmark) value.
if (theBookmarks.Count > 0)
{
foreach (ESRI.ArcGIS.Client.Toolkit.Bookmark.MapBookmark bookmark in theBookmarks)
{
if (bookmark.Name == _SelectedName)
{
string link = HtmlPage.Document.DocumentUri.ToString() + "/index.htm?extent=" + bookmark.Extent.XMin + "," + bookmark.Extent.YMin + "," + bookmark.Extent.XMax + "," + bookmark.Extent.YMax;
MessageBox.Show(bookmark.Name + " link copied to clipboard.", bookmark.Name + " Copied", MessageBoxButton.OK);
Clipboard.SetText(HtmlPage.Document.DocumentUri.ToString() + "/index.htm?extent=" + MapApplication.Current.Map.Extent.XMin + "," + MapApplication.Current.Map.Extent.YMin + "," + MapApplication.Current.Map.Extent.XMax + "," + MapApplication.Current.Map.Extent.YMax);
}
}
}
}
public void Execute(object parameter)
{
mywindow = mywindow ?? new CustomBookmark();
MapApplication.Current.ShowWindow("", mywindow);
}
public bool CanExecute(object parameter)
{
return true;
}
public event EventHandler CanExecuteChanged;
}
}
... View more
02-05-2014
07:42 AM
|
0
|
0
|
216
|
POST
|
You can edit the xaml in the layout and move/change the MainToolBar within the default layout. I added the following 2 toolbars. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="1" > <ContentControl x:Name="MainToolbarContainer" Margin="0,0,0,0"/> </StackPanel> <StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,40,5,5"> <ContentControl x:Name="NavigationToolbarContainer" Margin="0,0,0,0"/> </StackPanel> and they look like this. [ATTACH=CONFIG]31149[/ATTACH] For me this was the simplest solution and without a having to develop a custom toolbar.
... View more
02-05-2014
07:33 AM
|
0
|
0
|
489
|
POST
|
I would like to create a custom browse window that utilizes a keyword search on our web services and adds to the map similar to the one in the viewer. Has anybody created something like this before? Just looking for creative ideas.
... View more
01-31-2014
08:42 AM
|
0
|
0
|
707
|
POST
|
I believe in a previous post it was said that you can't create a custom addin that mimics the behavior of the bookmark sample in the API samples. The one in the viewer allows you to set the bookmarks in the builder, but the API one allows the user to set and save bookmarks. It was said that the bookmarks wouldn't persist in the viewer, once the browser was closed. Is this still the case? Has anyone had any luck creating an addin (I assume it would use isolated storage?) that would save user created bookmarks, or have any advice on where I might look to start creating one? Or is it impossible? Thanks! I used the example from https://developers.arcgis.com/silverlight/api-reference/#ESRI.ArcGIS.Client.Toolkit~ESRI.ArcGIS.Client.Toolkit.Bookmark~DeleteBookmarkAt.html to create a custom bookmark with a "Copy Bookmark Link" button. I believe isolated storage is defaulted to always on with bookmarks. The xaml was pretty easy to modify. Hope this helps.
... View more
01-28-2014
12:27 PM
|
0
|
0
|
216
|
POST
|
Having the same issue here I was able to correct the issue by deleting all temporary internet files. I thought I'd already done this, but obviously didn't. I'm guessing 3.2 was trying to reference the old Bookmark or another custom add-in I was using in 3.1. Hope this helps.
... View more
01-23-2014
06:28 AM
|
0
|
0
|
454
|
Title | Kudos | Posted |
---|---|---|
1 | 06-01-2016 11:58 AM | |
1 | 03-30-2016 09:05 AM | |
1 | 06-23-2016 08:50 AM | |
1 | 10-10-2017 01:45 PM | |
1 | 11-21-2013 11:07 AM |
Online Status |
Offline
|
Date Last Visited |
03-14-2024
05:17 PM
|