|
POST
|
I'm looking to build a new application that allows staff to edit a service/layer. They will be inputting new survey benchmark data based on lat/long. All of the current samples I have seen on the ESRI site show the editing done by clicking a point on a map and then populating the fields in the popup. My goal would be to input the fields first and then have the app recognize the x,y and draw new point. This would eliminate the error of the spot being clicked not actually being the correct coordinates. Also, they will be doing the input at the office, so enabling GPS or similar in the app won't be helpful. Does anybody know of a sample or way to do this?
... View more
04-10-2013
11:53 AM
|
0
|
2
|
859
|
|
POST
|
I'm getting a very generic error when trying to customize the Popup Widget code. So far all I've done is try to insert my service in place of the sample service and adjusted the extent. Here is a link My service doesn't load and I get an "unable to complete operation" error any help appreciated. also, the Popup Widget sample doesn't seem to actually load any features that generate a popup. Is this a bug?
... View more
04-10-2013
07:02 AM
|
0
|
0
|
626
|
|
POST
|
I am current working on display different kind of maps in a single map. For example, have ESRI map as the base map, and click a button within map, the layer changes to street map. It very like to change imagery to street in google earth.. Thanks for any suggestion on my problem. Sounds like you are looking for the Basemap Gallery widget. Give that a look and see if it meets your needs.
... View more
04-02-2013
04:14 AM
|
0
|
0
|
501
|
|
POST
|
I am creating an application that will be editable by select internal users but publically accessible to everybody. Is the best practice to serve up identical services (one publically viewable and one privately viewable)? Or is there a way to only use 1 service and have the the editor widget only viewable by those with the proper credentials? I am using windows authentication to control the users, so hopefully this can be done without an additional sign on in the app, similar to the Identity Manager, but if thats the best way, we will go with it.
... View more
04-01-2013
05:41 AM
|
0
|
1
|
838
|
|
POST
|
I'm trying to disable popups while I am performing a buffer task, but can't seem to get it right. Reading the documentation I would think that using something like popup.hide(); would work, but that isn't hiding anything. Any ideas where I'm going wrong?
... View more
03-19-2013
09:20 AM
|
0
|
0
|
617
|
|
POST
|
A few print related questions: 1. Is it possible to show the legend on a printout if I'm using the AGSJS TOC widget? Setting legendLayers doesn't seem to work, which I assume is because I'm not using it anywhere else in my app. 2. Is it possible to remove the credits from the printout? I'm using v3.2. The template mxd doesn't reference them. 3. Finally, How do I capture the same extent of my map in my printout? It looks like the map is displaying at the same extent, but the print area is smaller than my screen, so that may be the issue. How can I get the print to look exactly like the screen? I've tried preserveScale at both true and false and the result is the same. Code: dojo.require("esri.dijit.Print");
function initPrinter() {
var printTemplates = [{
label: "Map Only",
format: "png32",
layout: "MAP_ONLY",
exportOptions: {
width: map.width,
height: map.height,
dpi: 96
}
}, {
label: "Portrait",
format: "PDF",
layout: "Letter ANSI A Portrait",
layoutOptions: {
titleText: "my layout",
authorText: "GIS Team",
copyrightText: "Copyright 2013",
scalebarUnit: "Miles"
}
}, {
label: "Landscape",
format: "PDF",
layout: "Letter ANSI A Landscape",
layoutOptions: {
titleText: "my layout",
authorText: GIS Team",
copyrightText: "Copyright 2013",
scalebarUnit: "Miles"
}
}];
// print dijit
var printer = new esri.dijit.Print({
map: map,
templates: printTemplates,
url: "path/to/my/Export%20Web%20Map%20Task"
}, dojo.byId("printButtonDiv"));
printer.startup();
}
... View more
03-15-2013
06:35 AM
|
0
|
1
|
840
|
|
POST
|
This probably should have been split into a new thread... but. This is what I do: I use a popup to set a title so my code is something like this... var feature = result.feature;
feature.attributes.layerName = result.layerName;
if (result.layerName === 'Zoning Classifications') {
console.log(feature.attributes.NAME);
var template = new esri.dijit.PopupTemplate({
title: "Zoning",
description: "<b>Zoning:</b> {Zoning Classification} <br/> <b>Description:</b> {Zoning Description}"
});
feature.setInfoTemplate(template);
return feature;
});
if (results.length === 0) {
map.infoWindow.clearFeatures();
} else {
map.infoWindow.setFeatures(results);
}
map.infoWindow.show(idParams.geometry);
return results;
}
You'll need to set up your popup with code similar to: var popup = new esri.dijit.Popup({
fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25]))
}, dojo.create("div"));
map = new esri.Map("map", {
infoWindow: popup,
extent: startExtent,
logo: false
});
making sure to call: dojo.require("esri.dijit.Popup");
... View more
03-12-2013
09:52 AM
|
0
|
0
|
979
|
|
POST
|
My web map includes one dymanamic mapservice with 13 layers, all listed in the TOC and most used in the identify. I want to do the same thing...only identify on layers that are visible, or checked in the TOC. I think this reply would work for me, but I don't quite follow it (still learning). If someone could explain a little more I think I can get there. I don't understand what nliu meant with "using layer.visible" or "using ArcGISDynamicMapServiceLayer.visibleLayers". Would this be a parameter with the identify function? Any clarification would be greatly appreciated! Thanks. Here is a fiddle done by another user that was very helpful in figuring out how to combine the TOC widget and identify from multiple services/layers when visible.
... View more
03-12-2013
07:23 AM
|
0
|
0
|
979
|
|
POST
|
The home page of the ArcGIS API for Javascript website used to have a sample that showed all the ultra-marathons in the USA, when clicked a photo would show in the infowindow/popup that showed the finishers medal. I'm not sure how that photo was being pushed there, whether it was in the data or a hyperlink from somewhere, but nevertheless, it would probably give a good idea of how to proceed. You know, if it could be found... I'll search around, since the website update, it takes a few minutes to find things, but I'm sure its still a live link somewhere. EDIT: Found It. Sort of. This one is housed on arcgisonline. Looks like they are hyperlinks to the image source on the races external webpage. http://www.arcgis.com/home/webmap/viewer.html?webmap=5b9675ca7ca9426a99ced88f66b42331 Are you able to create hyperlinks for your attachments? I created a previous app that hyperlinked pdf document attachments to the infowindow/popup. Not sure if that would be helpful to you or not.
... View more
02-28-2013
08:48 AM
|
0
|
1
|
3240
|
|
POST
|
Is there a way to turn off popups for only certain layers? My app loops through the visible layers and returns a popup for each. Some of the layers only show boundaries, so I don't need anything to be created for it. the loop: function initIdentifies(map) {
idParams = new esri.tasks.IdentifyParameters();
idParams.tolerance = 5;
idParams.returnGeometry = true;
idParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;
dojo.connect(map, "onClick", runIdentifies);
}
function runIdentifies(evt) {
var layers = dojo.map(map.layerIds, function(layerId) {
return map.getLayer(layerId);
}); //Create an array of all layers in the map
layers = dojo.filter(layers, function(layer) {
return layer.getImageUrl && layer.visible;
}); //Only dynamic layers have the getImageUrl function. Filter so you only query visible dynamic layers
var tasks = dojo.map(layers, function(layer) {
return new esri.tasks.IdentifyTask(layer.url);
}); //map each visible dynamic layer to a new identify task, using the layer url
var defTasks = dojo.map(tasks, function (task) {
return new dojo.Deferred();
}); //map each identify task to a new dojo.Deferred
var dlTasks = new dojo.DeferredList(defTasks); //And use all of these Deferreds in a DeferredList
dlTasks.then(IDResults); //chain IDResults onto your DeferredList
idParams.width = map.width;
idParams.height = map.height;
idParams.geometry = evt.mapPoint;
idParams.mapExtent = map.extent;
for (i=0;i<tasks.length;i++) { //Use 'for' instead of 'for...in' so you can sync tasks with defTasks
try {
tasks.execute(idParams, defTasks.callback, defTasks.errback); //Execute each task
} catch (e) {
console.log("Error caught");
console.log(e);
defTasks.errback(e); //If you get an error for any task, execute the errback
}
}
}
How I built my popups: function IDResults(r) {
var results = [];
r = dojo.filter(r, function (result) {
return r[0];
}); //filter out any failed tasks
for (i=0;i<r.length;i++) {
results = results.concat(r[1]);
}
results = dojo.map(results, function(result) {
var feature = result.feature;
feature.attributes.layerName = result.layerName;
if(result.layerName === 'Zoning Classifications'){
console.log(feature.attributes.NAME);
var template = new esri.dijit.PopupTemplate({
title:"Zoning",
description:"<b>Zoning:</b> {Zoning Classification} <br/> <b>Description:</b> {Zoning Description}"
});
feature.setInfoTemplate(template);
}
else if (result.layerName === 'Assisted Living Facilities'){
var template = new esri.dijit.PopupTemplate({
title:"Assisted Living Facilities",
description:"<b>Parcel ID:</b> {Parcel} <br/> <b>Applicant:</b> {BusinessApplicantName} <br/> <b>No. of Residents</b> {NbrResidents}"
});
feature.setInfoTemplate(template);
}
else if (result.layerName === 'Family Divisions'){
var template = new esri.dijit.PopupTemplate({
title:"Family Divisions",
description:"<b>Parcel ID:</b> {Parcel} <br/> <b>Project Number:</b> {project_nbr} </br> <b>Status:</b> {Status}"
});
feature.setInfoTemplate(template);
}
return feature;
if(results.length === 0) {
map.infoWindow.clearFeatures();
} else {
map.infoWindow.setFeatures(results);
}
map.infoWindow.show(idParams.geometry);
return results;
}
... View more
02-27-2013
05:29 AM
|
0
|
1
|
679
|
|
POST
|
If you want to see the result of scripts run in the Python Window in ArcMap reflected in the current map, reference the map document like this: mxd = arcpy.mapping.MapDocument('current') That should do what you want. Thanks. Helped point me in the right direction. I wound up with:
import arcpy
... mxd = arcpy.mapping.MapDocument("CURRENT")
... layer = arcpy.mapping.ListLayers(mxd, "")[0]
... if layer.supports("LABELCLASSES"):
... for lblclass in layer.labelClasses:
... lblclass.showClassLabels = True
... lblclass.expression = " [PARCELID]"
... layer.showLabels = True
... arcpy.RefreshActiveView()
... View more
02-20-2013
03:28 AM
|
0
|
0
|
543
|
|
POST
|
I'm attempting to use a small script within my mxd (will later attach to a model) that will turn the labels on for a layer. My code is essentially straight from the Resource Center: import arcpy mxd = arcpy.mapping.MapDocument(r"C:\path\to\my.mxd") for lyr in arcpy.mapping.ListLayers(mxd): if lyr.description == "Layer Name": lyr.showLabels = True del mxd arcpy.RefreshTOC() arcpy.RefreshActiveView() I am running it with the mxd open from the python window. It looks like it is working because the map does refresh but the labels are not turning on.
... View more
02-19-2013
09:25 AM
|
0
|
2
|
716
|
|
POST
|
I made the following change to the code and it is working now: Replaced: with arcpy.da.SearchCursor(tempTable, [keyField, valField]) as cursor:
with: with arcpy.da.SearchCursor(table, [keyField, valField]) as cursor:
Thanks for all your help! Now I just need to figure out how to create the field long enough so that all results are populated.
... View more
02-08-2013
06:52 AM
|
0
|
0
|
990
|
|
POST
|
The NAME field doesn't need to fit that many characters, The Pg_Number field needs to be long, I've adjusted it to its maximum size (which is apparently only 254 characters?) However, one of the NAME fields has 74 different page numbers plus the ", " so its maximum size should be set to 370 The code results in the same error, the full code I'm running is:
import os
import arcpy
table = r"c:\users\craig.mcdade\GridforPython.dbf" # source_table
new_table = r"table.dbf" # new table name + extension only
tempTable = r"\\in_memory\temp_table"
outPath = r"c:\users\craig.mcdade" # path to output location on disk
keyField = 'NAME'
valField = 'Pg_Number'
tableDict = {}
arcpy.MakeTableView_management(table, tempTable)
with arcpy.da.SearchCursor(tempTable, [keyField, valField]) as cursor:
for row in cursor:
tableDict.setdefault(row[0], []).append(row[1])
insertCursor = arcpy.da.InsertCursor(os.path.join(outPath, new_table), [keyField, valField])
for key, val in tableDict.iteritems():
insertCursor.insertRow((key, ', '.join(str(item) for item in val)))
... View more
02-08-2013
03:12 AM
|
0
|
0
|
990
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-16-2014 09:52 AM | |
| 6 | 06-12-2013 08:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|