|
POST
|
Hi Rupert, Further to my issue. In Firebug I went into debug mode (placed a breakpoint) to see what happens when the story map is loaded (main.js). When using a breakpoint the supporting layer does indeed work. It seems that when running live a timing issue happens whereby the supporting layer may not be loaded before it checks to see if it is available. There may be an issue with the mapdeferred function. Not sure. Maybe you have more insight into this, Regards, Cameron CAMERON BLANDY | GIS ANALYST GIS Section 13450 104 Ave, Surrey, BC, V3T 1V8 T 604.591.4699 | F 604.598.5781 |www.surrey.ca <http://www.surrey.ca/12392.aspx>[Social Media Icons_City Speaks_GREEN]<https://www.cityspeaks.ca/Portal/default.aspx> <https://twitter.com/cityofsurrey> <https://www.facebook.com/TheCityofSurrey> <http://www.youtube.com/TheCityofSurrey> <http://www.linkedin.com/company/city-of-surrey> Connect, Share and Engage with your City
... View more
10-30-2015
11:10 AM
|
0
|
3
|
5815
|
|
POST
|
Feature Layer that I want ot use as a Supporting Layer: https://surrey.maps.arcgis.com/home/item.html?id=0ecbc3e4fe1d4605860dd65b1a7a4b43 Web Map to use in the Shortlist template (hosted). https://surrey.maps.arcgis.com/home/item.html?id=c810caafbd0a4579a3a804ecba815330 CAMERON BLANDY | GIS ANALYST GIS Section 13450 104 Ave, Surrey, BC, V3T 1V8 T 604.591.4699 | F 604.598.5781 |www.surrey.ca <http://www.surrey.ca/12392.aspx>[Social Media Icons_City Speaks_GREEN]<https://www.cityspeaks.ca/Portal/default.aspx> <https://twitter.com/cityofsurrey> <https://www.facebook.com/TheCityofSurrey> <http://www.youtube.com/TheCityofSurrey> <http://www.linkedin.com/company/city-of-surrey> Connect, Share and Engage with your City
... View more
10-30-2015
10:42 AM
|
0
|
0
|
5815
|
|
POST
|
Hi Rupert, I tried the following steps to create a Feature Layer and added it to my Map to use for the Shortlist template. But it does not work. The Supporting Layer is not identifiable. It does show though. 1) I exported the layer in question into a filegdb and zipped it. 2) In ArcGIS online (Organization account) I clicked Add Item then From My Computer. 3) I navigated to the zip file and checked on " Publish this file as a hosted layer (Adds a hosted layer item with the same name.)". 4) A Feature Layer is created and the filegdb is uploaded as well. 5) In may map I add the Feature Layer (the feature layer has name and Description fields) 6) In my index.html (for the hosted shortlist template) I add a reference to SUPPORTING_LAYERS_THAT_ARE_CLICKABLE to the Feature Layer. (which I assume is <Feature Layer> - <layername> (i.e. Story Maps - CulturalCorridor) Are these steps correct. Is there something I have forgotten. Regards, Cameron
... View more
10-28-2015
10:53 AM
|
0
|
6
|
5815
|
|
POST
|
I have a polygon layer within a ArcGIS for Server Map Service that I would like to be used as a Supporting Layer that is clickable. I have added it to the web map (see below, Map service is called Applications, Layer Cultural Corridor) and configured it using the SUPPORTING_LAYERS_THAT_ARE_CLICKABLE (="Applications - Cultural Corridor") variable in index.html. The layer contains both a name and Description field. Any clues why this is not working? I am hosting this app on my own server. Regards, Cameron
... View more
10-26-2015
01:38 PM
|
0
|
9
|
8249
|
|
POST
|
Brad from ESRI gave me the solution so I am posting here for all users. Here it is: Go to the locator style (%ArcgisInstallDirectory%\Locators) and open the General.lot.xml in a text editor (I would suggest Notepadd++). Look for mapping_schema name="SingleField"t used here so t worry about that) in the XML file. If you look in the XML just ” section. If you comment this out, the locator will be built with polygons instead of points. It will make the locator slower but will work better for reverse geocoding. You can comment this out by adding a “<!—“ before the first “<conversions>” tag and “-->” after the“</conversions>” tag like you see below: <!--<conversions> <conversion> <mapping ase_ref="Shape"> <method ref="calc_polygon_centroid"> <parameter> <field_value ref="Shape" /> </parameter> </method> </mapping> </conversion> </conversions>--> After this you will need to re-create your locator (not rebuild).
... View more
10-20-2014
09:22 AM
|
1
|
0
|
2728
|
|
POST
|
We have a cadastre polygon feature class. Some of the features have a Name associated with the lot (i.e. Neighbourhood Park). I would like to be able to reverse geocode using coordinates to find out which Park Name the coordinates fall in. I have tried the using the General – Single Field style but it only geocodes to the centroid of the polygon if I am within the distance specified. I also tried using the Gazetteer style and that was a little better but did not seem to work in a Composite Locator when combined with Street based locators. Maybe I need a custom style. I am using 10.0 SP5. I hope somebody is able to help me or point me in the correct direction. Regards, Cameron
... View more
10-20-2014
09:16 AM
|
0
|
10
|
5996
|
|
POST
|
Thanks Wayne. I did try what you suggested but still got the original names listed. Just to clarify the alias names are not stored in the database they are text changes made on the layer in the mxd (Properties->Fields). My simplified code s:
mxd = arcpy.mapping.MapDocument('CURRENT')
lyr = arcpy.mapping.ListLayers(mxd)
for lyr in arcpy.mapping.ListLayers(mxd):
if not lyr.isGroupLayer:
print lyr.name
fieldList = arcpy.ListFields(lyr)
for field in fieldList:
print(field.name + ": " + field.aliasName + ": " + field.type)
del mxd
So not sure what is happening here, but it is certainly frustrating. Cameron I have 10.0 SP 5 installed on one of my machines and wanted to test that out - it works fine (see the Python 'live' coding within ArcMap below - I did not test stand-alone). I added an alias, testAlias, to a dummy field, testfld, in a fc added to the map, a layer called 'testAlias' (sorry didn't mean to redundantly name it the same as my field alias - so don't be confused about that).
>>> mxd = arcpy.mapping.MapDocument('CURRENT')
>>> lyr = arcpy.mapping.ListLayers(mxd, 'testAlias')
>>> len(lyr)
1
>>> fields = arcpy.ListFields(lyr[0])
>>> len(fields)
5
>>> for field in fields:
... print('Field: {0}'.format(field.name))
... print('Alias: {0}\n'.format(field.aliasName))
...
Field: OBJECTID
Alias: OBJECTID
Field: SHAPE
Alias: SHAPE
Field: testfld
Alias: testAlias
Field: SHAPE_Length
Alias: SHAPE_Length
Field: SHAPE_Area
Alias: SHAPE_Area
>>>
So feeding in a layer obj from the map to ListFields works (ignore my warning in the last post). Also, it appears you'll get an original field name as the field alias where no alias has been set.
... View more
12-18-2013
11:30 AM
|
0
|
0
|
1328
|
|
POST
|
I am trying get the field aliases for each of the layers in an mxd document. I have the following snippet that should do the trick.
import arcpy
from arcpy import env
import os, zipfile, zlib, shutil
mxd = arcpy.mapping.MapDocument(r"C:\\temp\OpenData\OpenData_test.mxd")
for lyr in arcpy.mapping.ListLayers(mxd):
desc = arcpy.Describe(lyr)
for field in desc.fields:
print field.name, ":", field.aliasName, ":", field.type, ":", field.length, ":", field.domain
del mxd
When this code is run in stand-alone mode the describe gives an error (this is bug at 10.0 SPx apparently). When I run it through python in ArcMap using: mxd = arcpy.mapping.MapDocument("CURRENT") the program runs but the alias field names are not listed. I have spent a lot time trying to figure it out but based on my searches it seems that the issue lies with 10.0 SPx. Can anybody confirm this or, alternatively, give some suggestions on ways I can get the alias field names for each layer in an mxd?
... View more
12-09-2013
02:00 PM
|
0
|
4
|
4688
|
|
POST
|
I have a Map Service (ArcGIS Server 10.0 SP 5) that has 3 Layers and one Table. I am trying to access all of the Layers and Tables in code using the LayerInfos property. To my shock the Table is not listed in the LayerInfos. I need to search the Map Service for the Layer Name (table name) and get the Layer id (table id). What do I need to do to get LayerInfos to list Tables as well as the Layers. Regards, Cameron.
... View more
09-16-2013
02:22 PM
|
0
|
1
|
876
|
|
POST
|
I wanted to know it is possible to replace the cluster symbol (both flare and large circles) with an image. The Flare Graphic seems to be a Marker symbol which would need to be customized to accept a PictureMarkerSymbol (which inherits a MarkerSymbol). So I assume it is possible. Does anybody have an example to illustrate how? Cameron
... View more
01-31-2013
08:06 AM
|
0
|
1
|
2205
|
|
POST
|
I have created a user control (template) to use for a MapTip that I am adding to a GraphicsLayer. The Graphics Layer and Map Tips are defined in code. <Border x:Name="MapTipBorder" esri:GraphicsLayer.MapTipHideDelay="00:00:01" CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" Margin="0,0,15,15"> <Border.Background> <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188"> <GradientStop Color="#FFD1DFF2"/> <GradientStop Color="#FF092959" Offset="0.946"/> </LinearGradientBrush> </Border.Background> <Border.Effect> <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" /> </Border.Effect> <StackPanel Orientation="Vertical" Margin="20,15,20,15"> <StackPanel Orientation="Horizontal" Margin="0,0,0,0"> <TextBlock Text="Beacon ID: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" /> <TextBlock Text="{Binding [BEACONID]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" /> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="Vehicle Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" /> <TextBlock Text="{Binding [VEHICLENAME]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" /> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="Date and Time: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" /> <TextBlock Text="{Binding [TIMESTAMP]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" /> </StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="Speed: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" /> <TextBlock Text="{Binding [SPEED]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" /> </StackPanel> </StackPanel> </Border> I want to use the XAML above in code to show the MapTips. When I do the following in code the application crashes when I hover over the graphic because the MapTips are null (I think). The errror in the immediate wiondow in VS is: A first chance exception of type 'System.ArgumentException' occurred in System.Windows.dll Graphic graphic = new Graphic(); graphic.Geometry = UnitLocation; //defined elsewhere _activeSymbol = (ESRI.ArcGIS.Client.Symbols.Symbol)LayoutRoot.Resources["GreenDotMarkerSymbol"]; graphic.Symbol = _activeSymbol; graphic.Attributes.Add("BEACONID", obj.beaconId); graphic.Attributes.Add("VEHICLENAME", obj.unitName); DateTime timestamp = obj.timestamp; graphic.Attributes.Add("TIMESTAMP", timestamp.AddHours(1)); //to correct for DST graphic.Attributes.Add("SPEED", obj.speed); graphic.MapTip = (FrameworkElement)LayoutRoot.Resources["MapTipBorder"]; graphic.MapTip.DataContext = graphic.Attributes; // have tried with and without this line. _serviceCrewLayer.Graphics.Add(graphic); Does anybody have any idea why this would not work? Thanks, Cameron
... View more
10-16-2012
10:49 AM
|
0
|
1
|
2524
|
|
POST
|
So I created a function to get the MinScale and MaxScale using json (as found in a previous post). private void DynamicLayer_Initialized(object sender, EventArgs e)
{
ArcGISDynamicMapServiceLayer mapLayer = sender as ArcGISDynamicMapServiceLayer;
foreach (LayerInfo li in mapLayer.Layers)
{
if (li.SubLayerIds == null)
{
Uri layerUri = new Uri(mapLayer.Url + "/" + li.ID + "?f=json", UriKind.RelativeOrAbsolute);
WebClient webClient = new WebClient();
webClient.DownloadStringCompleted += webClient_DownloadStringCompleted;
}
}
} public void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string[] properties = e.Result.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
string minScale = properties.FirstOrDefault(p => p.Contains("minScale"));
string maxScale = properties.FirstOrDefault(p => p.Contains("maxScale"));
if (minScale != null)
minScale = minScale.Substring(minScale.IndexOf(':') + 1, minScale.Length - (minScale.IndexOf(':') + 1));
if (maxScale != null)
maxScale = maxScale.Substring(maxScale.IndexOf(':') + 1, maxScale.Length - (maxScale.IndexOf(':') + 1));
} The problem I now have is that while it is doing all of the Async calls the Initialized property of the MapService is true which triggers a Map.Layers.LayersInitialized call. I do not want to trigger this event until all of the Aysnc calls have been completed. Is there a way to achieve this? Regards, Cameron
... View more
05-12-2011
11:16 AM
|
0
|
0
|
629
|
|
POST
|
Thanks for the quick explanation. In the API documentation it doesn't say that those properties are only for 10.1 map services. It would have saved me a lot time if I had know this. 😞
... View more
05-11-2011
02:08 PM
|
0
|
0
|
629
|
|
POST
|
hello, I am using the following function to read all layers in a Dynamic map service and grab the MinScale and MaxScale properties. The function is very straightforward but doesn't give the desired result. All values for the MinScale and MaxScale are zero. This is a read only property which is fine as I only want to get the values, not set them. Does anybody know why this doesn't work. private void DynamicLayer_Initialized(object sender, EventArgs e)
{
ArcGISDynamicMapServiceLayer mapLayer = sender as ArcGISDynamicMapServiceLayer;
foreach (LayerInfo li in mapLayer.Layers)
{
MessageBox.Show((li.Name + " :" + li.MinScale + " " + li.MaxScale).ToString());
}
} Regards, Cameron
... View more
05-11-2011
12:14 PM
|
0
|
4
|
767
|
|
POST
|
Is there a way to add a Title or label to info window? I'm looking to make it the layer name. If you use the MapTip widget (the Toolkit) you can easily assign the layer name to the Title property.
void featureLayer_Initialized(object sender, System.EventArgs e)
{
FeatureLayer featureLayer = sender as FeatureLayer;
Map.Layers.Add(featureLayer);
string layerName = featureLayer.LayerInfo.Name.ToString();
MapTip maptip= new MapTip();
maptip.Title = layerName;
maptip.GraphicsLayer = featureLayer;
}
... View more
03-29-2011
12:43 PM
|
0
|
0
|
800
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 02-27-2024 12:00 PM | |
| 2 | 04-12-2021 01:38 PM | |
| 1 | 10-20-2014 09:22 AM | |
| 1 | 08-14-2016 11:24 PM | |
| 1 | 02-26-2016 10:15 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|