POST
|
After talking to Support, we managed to fix this by adding 2 lines to the Hosts file in C:\Windows\System32\Drivers\etc (uncommented) 127.0.0.1 localhost <type IP of host> <type host name> So, are you talking about putting the IP address for the web adapter machine, or for the ArcGIS Server machine? Will this keep a reboot from whiping out my webadapter.config file? The first time this happened to me was this week during IT maintenance, which is weird because I have had web adapter 10.2 running for around a year. My webadapter.config file was blank. What I did to solve this was extract the webadapter.config file from the data1.cad file in the web adapter install folder, copy it to my web adapter folder in wwwroot, and then reconfigured the web adapter again since I did not have a working copy of the config file. This is a strange problem.
... View more
05-08-2014
11:44 AM
|
0
|
0
|
1713
|
POST
|
Can you help please, why this decision doesn't work for myMeasureAction.MeasureMode = MeasureAction.Mode.Radius? Procedure Graphics_CollectionChanged is never started... I am sorry. I have not programmed in Silverlight in over 2 years now and I am afraid that I have forgotten how I solved this issue, I am now working in a 1 man shop so no time to develop any more. Sorry about that. I hope another person who was helped by this can help.
... View more
03-26-2013
06:22 AM
|
0
|
0
|
235
|
POST
|
With ArcCatalog go to your file geodatabase, create a new table and them point to the MsAccess table to import the structure. Right clik and select Load --> Load Data to upload the data from access to your file geodatabase This is the perfect soultion!!! Thanks for posting it, saved me a bunch of time!!
... View more
03-01-2013
11:29 AM
|
0
|
0
|
2733
|
POST
|
This is the best way to create a pdf with a silverlight GIS web application. We have modified this sample to work in our environment with much success. http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de The maps produced, since you print to pdf from the source data, are high quality, not the 96 dpi ones you get from REST.
... View more
08-11-2011
07:42 AM
|
0
|
0
|
597
|
POST
|
Also, this is actually closer to what you are doing: http://weblogs.asp.net/albertpascual/archive/2009/04/06/serializing-json-geometry-objects-between-silverlight-wpf-and-arcobjects.aspx Same rule applies, you must serialize objects to string/json/html or whatever when send through WCF.
... View more
08-04-2011
10:13 AM
|
0
|
0
|
289
|
POST
|
I don't have the code samples to show you, but you will have to serialize those objects. For example, I sent a png image, awhile back for client to server, and I had to convert it to a string (Base64). I have a sample of how to do that to an image. Basically, you need to convert all of those values to int or string to send them through WCF. I know this is not s silver bullet solution, but I hope the logic is helpful.
byte[] byt = System.Text.Encoding.UTF8.GetBytes(strOriginal);
// convert the byte array to a Base64 string
strModified = Convert.ToBase64String(byt);
... View more
08-04-2011
10:07 AM
|
0
|
0
|
289
|
POST
|
I tried your method and I am able to add and remove layers to the legend, so long as they are already included in the xaml side. I am not having the same problem using the same method you display. I did this using ESRI's legend sample and your code:
private void remAddLayers()
{
string[] aerialList = {"Points of Interest", "United States"};
esriLegend.LayerIDs = aerialList;
esriLegend.Refresh();
}
Xaml:
<esri:Map x:Name="MyMap" Extent="-15000000,2000000,-7000000,8000000" MouseLeftButtonDown="MyMap_MouseLeftButtonDown">
<esri:ArcGISTiledMapServiceLayer ID="Street Map"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<esri:ArcGISDynamicMapServiceLayer ID="United States" Opacity="0.6"
Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer"/>
<esri:FeatureLayer ID="Points of Interest"
Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/MapServer/0" />
</esri:Map>
<esri:Legend x:Name="esriLegend" Map="{Binding ElementName=MyMap}"
LayerIDs="Points of Interest"
LayerItemsMode="Tree"
ShowOnlyVisibleLayers="False">
And I was able to add the United States layer.
... View more
05-12-2011
12:44 PM
|
0
|
0
|
172
|
POST
|
Parcels don't identify? I can't recreate that error, they do when I try. Are you getting an error message in your browser? Anyway, back to your problem... Using the legend control, here is what I do (I am going to assume that anyone who takes this suggest will look at ESRI's legend sample and see how to implement the legend). For the identify task I create a function of the type List int[] public List<int> checkVisibility()
{
List<int> visibleLayers = new List<int>();
if (mapLegend.LayerItems != null)
{
//look at layers in group layer "0"
foreach (LayerItemViewModel enabledLyr in mapLegend.LayerItems[0].LayerItems)
{
for (int i = 0; i < enabledLyr.LayerItems.Count; i++)
{
if (enabledLyr.LayerItems.IsVisible)
{
visibleLayers.Add(enabledLyr.LayerItems.SubLayerID);
}
}
return visibleLayers;
}
//then on your identify task parameter
identifyParams.LayerIds.AddRange(checkVisibility());
} This will check the legend each time to see what is visible based on being check on in the legend or visible in the scale range. This is a simplified version of what I did, just to give an idea. If you need more, then yeah, maybe we should do e-mail or phone. It is pretty simple, but complicated at the same time.
... View more
05-10-2011
03:17 PM
|
0
|
0
|
426
|
POST
|
There are a couple of ways to accomplish this. The easiest way is if you use the new legend control ESRI developed for the Silverlight API. You can see my implementation and its behavior with idenitfy at http://gis.modestogov.com If interested in this type of identify layer restriction, I will elaborate further how to achieve this. This method is entirely dynamic. BTW, I am using group layers as well in mine, though you can't really tell on our public facing application. You can also, on layer initialize, create a event void that gets all of the layer names and IDs from your map service. Then you can hard code a list of layers that you want identifiable, but that is very static. You are correct in your previous post that you would cycle through a list (foreach) using this approach. I have my LayerOption set to visible and regardless of me specifying layers or not, it still Identify's a layer that is not in scale range? This is because your REST service is stateless, your service does not know when they become visible in your app. Since they are checked on in your .mxd it calls them visible, regardless of your scale range, since the rest service does not know your apps scale range unless you tell it. You can send in the envelope (map extent) and resolution in to your query to handle this if you want to do it that way. The arguments are available on the identify task. This way the map service knows what your app is doing. I suggest you use the legend control though if you can, it is sooooo simple 🙂
... View more
05-10-2011
02:37 PM
|
0
|
0
|
426
|
POST
|
I suppose you don't have to create a class just for that, but I did. This way I can make a bufferItems type for a list. It was preference, plus creating the class is not a high cost in memory or code. This way I have a type for my report.
... View more
04-25-2011
01:24 PM
|
0
|
0
|
209
|
POST
|
It is kind of alot. 😄 A good part of that code is data manipulation that is unique to our environment. I create the custom class so this I can format each buffer item the way I like, after I get the data form the query. Are the other ways to do it...likely, but I like this way, it is pretty easy and clean. They buffer items class defines what the datagrid looks like, since it is a List<_bufferItems> that I send to the datagrid - "dgReport.ItemSource = _bufferList". Does that answer your question?
public class _bufferItems
{
public string Name { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
}
... View more
04-13-2011
09:50 AM
|
0
|
0
|
209
|
POST
|
You can do what I did and create a custom double click handler...a piece of code that can identify double clicks. Basically what I do is set a time up to time between click 400 ms or less between clicks equals a double click in my app. I checked to see if my double clik logic could be applied to help you, and my testing came out positive. Here is how it would be done to disable double click zoom. Here is the entire user control. I know it is a bit duct tapeish, but that is how most things work...
public partial class MainPage : UserControl
{
bool dblClick = false;
DispatcherTimer TimeDblClick = new DispatcherTimer();
public MainPage()
{
InitializeComponent();
TimeDblClick.Tick += new EventHandler(DblClickTimer);
TimeDblClick.Interval = TimeSpan.FromMilliseconds(400);
}
private void DblClickTimer(object sender, EventArgs args)
{
dblClick = false;
TimeDblClick.Stop();
}
private void Map_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (dblClick)
{
//if it is a double click do this...
e.Handled = true;
dblClick = false;
TimeDblClick.Stop();
}
else //User has not clicked here before (a single click), start double click timer
{
//not a double click so don't handle the mousedown
e.Handled = false;
dblClick = true;
//restart timer to count time between clicks
TimeDblClick.Start();
}
}
}
... View more
04-11-2011
12:27 PM
|
0
|
0
|
825
|
POST
|
Hi Jay, Just saw your question about the line. It is hard to remember some times because I wrote most of this site 1.5 years ago. The line is just a line...it is just placed in by code. If you use expression blend, it should be easier to do in your environment. <!-- This is the Line thats visible between the Identify Results list and the Tab Control-->
<Line X1="178" X2="178" Y1="0" Y2="365" Stroke="Black" StrokeThickness="1" Grid.ColumnSpan="2" />
... View more
04-11-2011
09:07 AM
|
0
|
0
|
625
|
POST
|
I will share my code from this process for logic reasons, know it is custom to my environment. I am hope the logic makes sense at least. I am really happy with the way mine works, it took we a few days to nail it down, but well worth it. First, the QueryTask_ExecuteCompleted that has the parcels that fall within the buffer the users creates in a previous step. Also, in here is where I separate the initial selection that the buffer was generated from (blue parcels), and the ones added to the selection by the buffer (red parcels). _bufferitems is a custom class I made just for this task. It made it much easier for me. private void QueryTask_ExecuteCompleted(object sender, QueryEventArgs args)
{
//Reset Selected (blue) graphics
identifySelect.ClearGraphics();
//Add all blue (Selected) graphics to graphics layer
foreach (DataItem x in _bufferSelectedItems)
{
ESRI.ArcGIS.Client.Graphic graphic = new ESRI.ArcGIS.Client.Graphic()
{
Geometry = x.geodata,
Symbol = GlobalVariables.theMainPage.LayoutRoot.Resources["SelectedFillSymbol"] as FillSymbol
};
identifySelect.Graphics.Add(graphic);
}
//Reset Results (red) graphics
identifyResults.ClearGraphics();
// "_bufferList" will hold all if the results from the parcel query and display them in the child window when called
_bufferList = new List<_bufferItems>();
//Add all red (Results) graphics to graphics layer
//And add each result to the buffer csv list
foreach (Graphic feature in args.FeatureSet)
{
string StreetNum = "";
string StreetDir = "";
string Street = "";
string StreetType = "";
feature.Symbol = GlobalVariables.theMainPage.LayoutRoot.Resources["ResultFillSymbol"] as FillSymbol;
bool uniqueGraphic = true;
//If graphic exists in Selection Graphics Layer (_bufferSelectedItems), do not add to Results Graphics Layer
//This allows the user to see the initial buffer selection versus the parcels returned from the buffer parcel query
foreach (DataItem x in _bufferSelectedItems)
{
if (x.Data[StringID.APN].ToString() == feature.Attributes[StringID.APN].ToString())
{
uniqueGraphic = false;
}
}
if (uniqueGraphic)
{
identifyResults.Graphics.Add(feature);
}
//Create a new buffer item
_bufferItems rptItemsSitus = new _bufferItems();
_bufferItems rptItemsOwner = new _bufferItems();
//Gather individual fields to create full address
//This "if" statement returns true if the user is looking for situs or both addresses
if (GlobalVariables.theBufferChoice.rdoBoth.IsChecked == true || GlobalVariables.theBufferChoice.rdoSitus.IsChecked == true)
{
if (feature.Attributes[StringID.csvStNum] != null)
{
StreetNum = feature.Attributes[StringID.csvStNum].ToString().Trim();
}
if (feature.Attributes[StringID.csvStDir] != null)
{
StreetDir = feature.Attributes[StringID.csvStDir].ToString().Trim();
}
if (feature.Attributes[StringID.csvSt] != null)
{
Street = feature.Attributes[StringID.csvSt].ToString().Trim();
}
if (feature.Attributes[StringID.csvStType] != null)
{
StreetType = feature.Attributes[StringID.csvStType].ToString().Trim();
}
//Use "Occupant" for external users
rptItemsSitus.Name = "Occupant";
//Concatinate address
rptItemsSitus.Address = StreetNum + " " + StreetDir + " " + Street + " " + StreetType;
if (feature.Attributes[StringID.csvCity] != null)
{
rptItemsSitus.City = feature.Attributes[StringID.csvCity].ToString();
}
if (feature.Attributes[StringID.csvState] != null)
{
rptItemsSitus.State = feature.Attributes[StringID.csvState].ToString();
}
if (feature.Attributes[StringID.csvZip] != null)
{
rptItemsSitus.Zip = feature.Attributes[StringID.csvZip].ToString();
}
_bufferList.Add(rptItemsSitus);
}
//This "if" statement returns true if the user is looking for owner or both addresses
if (GlobalVariables.theBufferChoice.rdoBoth.IsChecked == true || GlobalVariables.theBufferChoice.rdoOwner.IsChecked == true)
{
if (feature.Attributes[StringID.csvMailAddress] != null)
{
Street = feature.Attributes[StringID.csvMailAddress].ToString().Trim();
}
if (feature.Attributes[StringID.csvFirstLast] != null)
{
rptItemsOwner.Name = feature.Attributes[StringID.csvFirstLast].ToString().Trim();
}
//Concatinate address
rptItemsOwner.Address = Street;
if (feature.Attributes[StringID.csvMailCity] != null)
{
rptItemsOwner.City = feature.Attributes[StringID.csvMailCity].ToString();
}
if (feature.Attributes[StringID.csvMailState] != null)
{
rptItemsOwner.State = feature.Attributes[StringID.csvMailState].ToString();
}
if (feature.Attributes[StringID.csvMailZip] != null)
{
rptItemsOwner.Zip = feature.Attributes[StringID.csvMailZip].ToString();
}
_bufferList.Add(rptItemsOwner);
}
}
//Fill datagrid with results
dgReport.ItemsSource = _bufferList;
//lets the BufferChoice control know that the report has run
GlobalVariables.theSideMenu.buffercontrol.makeChoiceOpenFalse();
} Then, take the _bufferlist created in the querytask and generate it to a .csv private void SaveButton_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog()
{
DefaultExt = "csv",
Filter = "Comma Separated Values (*.csv)|",
FilterIndex = 1
};
int bufferCount = _bufferList.Count;
sfd.ShowDialog();
System.IO.Stream stream = sfd.OpenFile();
StreamWriter sw = new StreamWriter(stream);
sw.Write("\"Name\",\"Address\",\"City\",\"State\",\"Zip\"\r\n");
for (int i = 0; i <= bufferCount - 1; i++)
{
sw.Write("\"" + _bufferList.Name + "\",\"" + _bufferList.Address + "\",\""
+ _bufferList.City + "\",\"" + _bufferList.State + "\",\"" + _bufferList.Zip + "\" \r\n");
}
sw.Close();
stream.Close();
}
... View more
04-11-2011
08:58 AM
|
0
|
0
|
625
|
POST
|
My site does it. What it does is output address data to .cvs, then the user does the mail merge from that. I though about going right to Word, but decided against that for many reasons. http://gis.modestogov.com The way you access it in our site is through our buffer tool, on the tool bar. Is that what you are looking for?
... View more
04-06-2011
09:18 AM
|
0
|
0
|
625
|
Title | Kudos | Posted |
---|---|---|
2 | 10-11-2010 02:19 PM |
Online Status |
Offline
|
Date Last Visited |
10-13-2021
11:52 AM
|