POST
|
Haha, I'm falling in love with AGS too. The end point offers so much that we take for granted and typically go unused. I have full control over all of the layers/services so everything can be modified. But I don't want to modify the layers in places. Plus, I want to make this easy for interns to modify with new field information as it becomes available. I figured setting up a separate table would be the easiest, but I will give your method a go and see what it churns out! Really appreciate your help!
... View more
02-27-2014
09:44 AM
|
0
|
0
|
1284
|
POST
|
Thanks for this! This would still require me having the field LABEL (the label that actually appears on the popup) in the actual service, layer right? Rather than have it be in a separate table itself.
... View more
02-27-2014
04:09 AM
|
0
|
0
|
1284
|
POST
|
I want to create a certain function to streamline some of my customization work. I work with a web app that's built using ArcGIS JavaScript API which contains a few layers. Each layer is configured to an identity task that uses a popup template to display attribute information from the layer. Now, there are lots of attributes PER layer that I manually configure up in the popup template declaration. Ex.
var popupContent = {
title: "Business ID#: {UNIQUEID_1}",
fieldInfos: [
{fieldName: "BUSNAME_1", visible: true, label:"Business Name: "},
{fieldName: "Standard_Name", visible: true, label:"Standard Name: "},
{fieldName: "LATITUDE_1", visible: true, label:"Latitude: "},
{fieldName: "LONGITUDE_1", visible: true, label:"Longitude: "},
{fieldName: "INFO_EMP_1", visible: true, label:"Employment Info: "},
{fieldName: "Est_Employment", visible: true, label:"Estimated Employment: "},
{fieldName: "INFO_SAL_1", visible: true, label:"Salary Info: "},
{fieldName: "Est_Revenue", visible: true, label:"Estimated Revenue: "},
{fieldName: "PRMSIC4_1", visible: true, label:"Primary SIC: "},
{fieldName: "NAICS_1", visible: true, label:"NAICS: "},
{fieldName: "NAICS4_1", visible: true, label:"NAICS 4 Code: "},
{fieldName: "NAICS4DESC_1", visible: true, label:"NAICS 4 Desc.: "},
{fieldName: "NAICS2_1", visible: true, label:"NAICS 2 Code: "},
{fieldName: "NAICS2DESC_1", visible: true, label:"NAICS 2 Desc.: "},
{fieldName: "Use_Type", visible: true, label:"Use Type: "},
{fieldName: "UseSubcategory", visible: true, label:"Use Subcategory: "},
{fieldName: "UseCategory", visible: true, label:"Use Category: "}
]
};
This is one of the shorter templates that i use, but as you can see, it gets pretty tedious to set these manually. Once in a while is okay, but the layers are constantly getting fields added/removed. I was wondering if any of you had any clever ideas as to how I could automate this. One possible way I was thinking is to have a table in my ArcGIS server that acts as a lookup table for the fields. Table structure: 1. The column field names in this table will be the "Layername_fieldname" and "LayerName_label" of the layers in my web app (from the layers' corresponding attribute tables). Ex. || Layer1_fieldname || Layer1_label || Layer2_fieldname || Layer2_label ||
--------------------------------------------------------------------------
|| BusinessLoc || Biz Location:|| CountyBoundary || County Name: ||
|| || || || || 2. Rows can be added or deleted as needed to each column as my web app layers grow or shrink in attribute size. Basically, I want to know if this is a viable option or if there are other methods out there to perform this task. If this is a good solution, is it possible to query the field lookup table and use those values in my popup template constructor. Any help or ideas would be greatly appreciated. Thanks!
... View more
02-26-2014
12:55 PM
|
0
|
4
|
5188
|
POST
|
Hi, As the title suggests, I'm trying to add labels to a dynamic map service layer. I found something here: https://developers.arcgis.com/javascript/jsapi/labelclass.html My DMSL has 5 layers in it so am I able to specify the layer that I want labelled? I've been at it for a while and just not getting it. Any help would be much appreciated! Thanks, Ruch
... View more
02-24-2014
03:48 PM
|
0
|
0
|
646
|
POST
|
You have to call resize method of the borderContainer object when any of the child elements resized. Add the below line to the end of the function. dijit.byId("borderContainerID").resize(); Wow, I can't believe I missed that! Thanks so much, Jason.
... View more
08-30-2013
09:41 AM
|
1
|
0
|
1001
|
POST
|
Been at this for hours and I can't seem to figure it out. I'm using AG-JSAPI 3.6 I have a map layout with a bordercontainer and two contentpanes, One is the map div and the other is the left div (which holds the legend, and basemaps and such as child elements). Anyway, I have a checkbox element on the footer that when clicked, fires off a function that (should ideally) make the left div disappear and the map div expand to the width of the browser. The left div disappears as it should without any issue. However, the map div stays put. function toggleDiv() { // If statement to check if the checkbox is checked. if (dijit.byId("ToggleLeft").checked) { //Sets the left div's display CSS property to inline and then setting the //width property dojo.setStyle(dijit.byId("leftDiv").domNode, 'display', 'inline'); dojo.byId("leftDiv").style.width = '285px'; } else { // Sets the display css property to "none" which makes the element disappear dojo.setStyle(dijit.byId("leftDiv").domNode, 'display', 'none'); }; } The thing is, when I resize the browser, the map automatically resizes to the width of the browser. However, I want to do this as soon as the leftDiv element disappears. What js code would I have to use to get this to happen? Any help would be appreciated. Thanks
... View more
08-30-2013
08:52 AM
|
0
|
2
|
7352
|
POST
|
since you are relying on the 'onLayersAddResult' event to create your layerInfos object to pass in the legend widget constructor it would be helpful to know which specific layers in your application you are loading with map.addLayer() and which you are loading using map.addLayers([]) also, id be curious to know what the layerInfo you are passing to the legend widget contains. can you set a breakpoint and take a look? Thanks for your reply, John. There's only one instance in the entirety of my code where I add layers to the map. It's within a function I that also declares the infotemplate, a feature layer, and a dynamic map service. Then I use: myMap.addLayers([featureLayer1, DMSL_StudyArea]); to add the feature layer and the dynamic map service to the map. The symbology classes in the feature layer are the ones being duplicated.
... View more
07-15-2013
01:24 PM
|
1
|
0
|
521
|
POST
|
Hi All, I have recently created a web map that uses the legend snippet from the ESRI JavaScript API website. https://developers.arcgis.com/en/javascript/jssamples/widget_legend.html It works great for the most part, but has one issue, there are duplicate entries in the legend. (Refer to this image: [ATTACH=CONFIG]25925[/ATTACH])The rest services that I am using are all symbolized properly without duplicates. The method I'm using to add the services to the map is through a feature layer. This is the exact code in my .js file. dojo.connect(myMap, 'onLayersAddResult', function (results) {
var layerInfo = dojo.map(results, function (layer, index) {
return { layer: layer.layer, title: layer.layer.name };
});
if (layerInfo.length > 0) {
var legendDijit = new esri.dijit.Legend({
map: myMap,
layerInfos: layerInfo},
"legendDiv");
legendDijit.startup();
}
}); Any information would help. Thanks
... View more
07-15-2013
06:21 AM
|
0
|
2
|
1061
|
POST
|
One way to do service areas from parks/polygons is to put points where the park entrances are. Then do service area from these points with the merge option. Alternatively you can intersect the parks polygons with the street network and use the intersection points as the starting points for the service area. Jay Sandhu Thanks, Jay. Also, I meant to say "service area polygons" in the title. I think your second method is the most suited. The thing is, most of the time, the parks polygons don't intersect the road network. I've applied a rather generous search tolerance, so perhaps I'll try playing around with that variable until I get the intersect points down to a desirable number. Thanks again, Jay. Cheers,
... View more
05-23-2013
10:42 AM
|
0
|
0
|
270
|
POST
|
Hi All, So, this is the issue. I have created a network dataset and have created ample service areas for various things. Things such as libraries, business locations, schools, etc. However, all of these were point files. Now, I have a parks polygon feature class. I want to find the service area for these polygons. Is this possible? I thought of taking the centroid but most of these parks are very irregular shapes and realistically, parks tend to have a lot of accessibility from different areas of the network. So, their reach throughout the network would tend to be much more than something like a library which may only have one point of contact to the network. Hope someone can aid me with this task. Thanks,
... View more
05-23-2013
09:20 AM
|
0
|
2
|
530
|
POST
|
You can't usually download this. I haven't been able to find it. However, the SDK (all of them, .NET, Java, etc.) are all on the ArcGIS Install CD.
... View more
08-16-2011
10:37 AM
|
0
|
0
|
2156
|
POST
|
http://edndoc.esri.com/arcobjects/9.0/samples/tables/create_a_layer_based_on_xy_data.htm Try playing around with that code. I personally think it might be easier to take the user input and write it to a text file and then use that text file as XY data. Cheers
... View more
07-12-2011
01:32 PM
|
0
|
0
|
687
|
POST
|
The OnCreate Sub is right above the OnClick sub (or should be). They are autogenerated in VB.NET when you create the application. I've never used the "My.MyMap..." method before for getting the Document or the application from ArcMap. That's one of the key differences between VBA and .NET. VBA used ThisDocument while .NET uses m_application.
... View more
07-07-2011
07:00 AM
|
0
|
0
|
499
|
POST
|
When you create a command through VB.NET, it sets up the hook for the application automatically. Looks like this at the beginning of your code: NOTE: This is autogenerated code! Should already exist in your base command! Public Overrides Sub OnCreate(ByVal hook As Object)
If Not hook Is Nothing Then
m_application = CType(hook, IApplication)
'Disable if it is not ArcMap
If TypeOf hook Is IMxApplication Then
MyBase.m_enabled = True
Else
MyBase.m_enabled = False
End If
End If
' TODO: Add other initialization code
End Sub So your code should look something like this: Public Function GetLayer(ByVal sLayer) As ILayer
Dim pMxDoc As IMxDocument
Dim i As Integer
Dim players As IEnumLayer
Dim pLayer As ILayer
Dim pL As ILayer
Dim ii As Integer
Dim pCL As ICompositeLayer
pMxDoc = m_application.Document
On Error GoTo GetLayer_Err
players = pMxDoc.FocusMap.Layers(, True)
End If
pLayer = players.Next
Do While Not pLayer Is Nothing
If TypeOf pLayer Is ICompositeLayer Then
pCL = pLayer
For ii = 0 To pCL.Count - 1
pL = pCL.Layer(ii)
If UCase(pL.Name) = UCase(sLayer) Then
GetLayer = pL
Exit Function
End If
Next
Else
If UCase(pLayer.Name) = UCase(sLayer) Then
GetLayer = pLayer
Exit Function
End If
End If
pLayer = players.Next
Loop
Exit Function
GetLayer_Err:
End Function Should work.
... View more
07-07-2011
06:36 AM
|
0
|
0
|
499
|
Title | Kudos | Posted |
---|---|---|
1 | 08-30-2013 09:41 AM | |
4 | 01-09-2018 12:33 PM | |
2 | 10-06-2014 03:14 PM | |
2 | 08-13-2015 09:45 AM | |
1 | 08-14-2015 08:51 AM |
Online Status |
Offline
|
Date Last Visited |
08-12-2023
04:34 AM
|