POST
|
Hi Jake, Thanks for the links. Do you know the difference between using the PHP, .Net, or Java proxies? When would you use a particular one? This is a bit out of my field of expertise. Thanks
... View more
06-17-2015
08:43 AM
|
0
|
4
|
967
|
POST
|
Hi there, We had something working in Silverlight where users on our domain would not have to sign in via a dialog to access secured services. We are transitioning our site to Javascript, and we'd like to have the same. Some of our layers are secured while most are not, and we'd prefer that this is somehow read from the users' windows logins as it was in Silverlight (at least in IE). Is this possible? I can't seem to find any info on authentication that bypasses the sign in dialog altogether. We are using Javascript 3.13, ArcGIS for Server 10.3.1. Thanks
... View more
06-15-2015
11:06 AM
|
0
|
9
|
4598
|
POST
|
Thanks Robert, that did it! So in the ESRI sample, they had set the IdentifyTasks constructor the same way I had - I just switched out my layer for theirs. I'm guessing it is to do with the difference between how they added their layer to the map: var parcelsURL = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer";
map.addLayer(new ArcGISDynamicMapServiceLayer(parcelsURL,
{ opacity: 0.55 })); and how I added mine: var layerCadastral = new ArcGISDynamicMapServiceLayer("http://cop-gis4:6080/arcgis/rest/services/MOR/MOR_Cadastral_WGS1984/MapServer",
{
"imageParameters": imageParameters
});
map.addLayer(layerCadastral); When I came to the line in the sample identifyTask = new IdentifyTask(parcelsURL); I just switched out parcelsURL for my layerCadastral. But in the sample parcelsURL was a variable that held the url string, so I'm guessing that's why it didn't work for me. Thanks both Robert and Chris for your assistance.
... View more
06-12-2015
08:15 AM
|
0
|
0
|
717
|
POST
|
It's not public nor are my services, but I've posted it and switched back to the service in the ESRI demo: JS Bin - Collaborative JavaScript Debugging
... View more
06-11-2015
03:42 PM
|
0
|
2
|
717
|
POST
|
Hi Chris, I am using Chrome, and NetBeans. Using F12 unfortunately is not giving me any more enlightenment. I was able to get this esri sample working with my data but when I try to plop that into my existing map, I'm getting this error. I am fairly new to javascript and I think I've put something in the wrong order or something, but I don't know what.
... View more
06-11-2015
02:33 PM
|
0
|
4
|
717
|
POST
|
Hi All, I've been struggling with this code, everything has been working until I tried to throw in the ability to identify. When I run the code, I get the error that identifyParams is undefined. Specifically, "Uncaught TypeError: Cannot set property 'geometry' of undefined" Can anyone see what I've got wrong? Thanks in advance. var map; require([ "esri/InfoTemplate", "esri/map", "esri/dijit/BasemapToggle", "esri/dijit/Popup", "esri/dijit/Scalebar", "esri/dijit/Search", "esri/Color", "esri/InfoTemplate", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/FeatureLayer", "esri/layers/ImageParameters", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/tasks/IdentifyTask", "esri/tasks/IdentifyParameters", "dojo/_base/array", "dojo/dom", "dojo/on", "dojo/query", "dojo/ready", "dijit/registry", "dojo/dom-construct", "dojo/parser", "dojo/domReady!" ], function( InfoTemplate, Map, BasemapToggle, Popup, Scalebar, Search, Color, InfoTemplate, ArcGISDynamicMapServiceLayer, FeatureLayer, ImageParameters, SimpleFillSymbol, SimpleLineSymbol, IdentifyTask, IdentifyParameters, arrayUtils, dom, on, query, ready, registry, domConstruct, parser ) { var layer, visibleLayerIds = [], identifyTask, identifyParams; var popup = new Popup({ fillSymbol: new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.25])) }, domConstruct.create("div")); map = new Map("map", { basemap: "topo", center: [-123, 49.2], zoom:10, infoWindow: popup }); //Use the ImageParameters to set the visibleLayerIds layers in the map service during ArcGISDynamicMapServiceLayer construction. var imageParameters = new ImageParameters(); //VFPA Boundary line layers (confirmed and non-confirmed) visible on startup imageParameters.layerIds = [0,2]; imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW; //can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE var layerCadastral = new ArcGISDynamicMapServiceLayer("http://cop-gis4:6080/arcgis/rest/services/MOR/MOR_Cadastral_WGS1984/MapServer", { "imageParameters": imageParameters }); map.addLayer(layerCadastral); //every time a layer is clicked, update the layer visibility on(dom.byId("chkVFPABoundary"), "change", updateLayerVisibility); on(dom.byId("chkMunicipalBoundaries"), "change", updateLayerVisibility); on(dom.byId("chkLots"), "change", updateLayerVisibility); function updateLayerVisibility () { var inputs = query(".list_item"); var inputCount = inputs.length; //Dummy layer - is there a workaround? Setting this to an actual layer means that layer can't be turned off visibleLayerIds = [1001]; for (var i = 0; i < inputCount; i++) { if (inputs.checked) { visibleLayerIds.push(inputs.value); } } if (visibleLayerIds.length === 0) { visibleLayerIds.push(-1); } layerCadastral.setVisibleLayers(visibleLayerIds); } //Basemap toggle var toggle = new BasemapToggle({ map: map, basemap: "satellite" }, "BasemapToggle"); toggle.startup(); var scalebar = new Scalebar({ map: map, // "dual" displays both miles and kilmometers // "english" is the default, which displays miles // use "metric" for kilometers scalebarUnit: "dual" }); var s = new Search({ enableButtonMode: false, //this enables the search widget to display as a single button enableLabel: false, enableInfoWindow: true, showInfoWindowOnSelect: true, map: map }, "search"); var sources = s.get("sources"); //Push the sources used to search, by default the ArcGIS Online World geocoder is included. sources.push({ featureLayer: new FeatureLayer("http://cop-gis4:6080/arcgis/rest/services/MOR/MOR_Cadastral_WGS1984/MapServer/7"), searchFields: ["LOT_NO"], exactMatch: false, outFields: ["*"], displayField: "LOT_NO", name: "Lots - Lot Number", placeholder: "Lot Number", maxResults: 6, maxSuggestions: 6, //Create an InfoTemplate and include three fields infoTemplate: new InfoTemplate("Lot Number", "Lot #: ${LOT_NO}</br>Owner: ${OWNER}</br>Title Link: <a href =${TITLE_LINK}>Click to open</a>"), enableSuggestions: true, minCharacters: 0 }); sources.push({ featureLayer: new FeatureLayer("http://cop-gis4:6080/arcgis/rest/services/MOR/MOR_Cadastral_WGS1984/MapServer/7"), searchFields: ["OWNER"], exactMatch: false, outFields: ["*"], displayField: "OWNER", name: "Lots - Owner", placeholder: "Owner", maxResults: 6, maxSuggestions: 6, //Create an InfoTemplate and include three fields infoTemplate: new InfoTemplate("Lot Number", "Lot #: ${LOT_NO}</br>Owner: ${OWNER}</br>Title Link: <a href =${TITLE_LINK}>Click to open</a>"), enableSuggestions: true, minCharacters: 0 }); //Set the sources above to the search widget s.set("sources", sources); s.startup(); map.on("load", mapReady); function mapReady () { map.on("click", executeIdentifyTask); //create identify tasks and setup parameters identifyTask = new IdentifyTask(layerCadastral); identifyParams = new IdentifyParameters(); identifyParams.tolerance = 3; identifyParams.returnGeometry = true; identifyParams.layerIds = [7]; identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_VISIBLE; identifyParams.width = map.width; identifyParams.height = map.height; } function executeIdentifyTask (event) { identifyParams.geometry = event.mapPoint; identifyParams.mapExtent = map.extent; var deferred = identifyTask .execute(identifyParams) .addCallback(function (response) { // response is an array of identify result objects // Let's return an array of features. return arrayUtils.map(response, function (result) { var feature = result.feature; var layerName = result.layerName; feature.attributes.layerName = layerName; if (layerName === 'Lots') { var lotsTemplate = new InfoTemplate("", "Lot #: ${LOT_NO} <br/> Owner: ${OWNER}"); feature.setInfoTemplate(lotsTemplate); } else if (layerName === 'Building Footprints') { console.log(feature.attributes.PARCELID); var buildingFootprintTemplate = new InfoTemplate("", "Parcel ID: ${PARCELID}"); feature.setInfoTemplate(buildingFootprintTemplate); } return feature; }); }); // InfoWindow expects an array of features from each deferred // object that you pass. If the response from the task execution // above is not an array of features, then you need to add a callback // like the one above to post-process the response and return an // array of features. map.infoWindow.setFeatures([deferred]); map.infoWindow.show(event.mapPoint); } });
... View more
06-11-2015
02:19 PM
|
0
|
6
|
4276
|
POST
|
Yes now that I recall, and looking through the rest of the thread, I sort of stopped working on the script without solving this error. The test for the table view actually causes the script to crash when it does encounter a table view (or so the error suggests). I tried modifying things so that it only writes the dataSource if the file extension is not .dbf, but it still crashes with the same tableview error. I inspected the .mxd it crashed halfway through and there aren't actually any tableviews in it. So there is something else within the .mxd that's causing this to happen. Testing for the .dbf extension is not weeding out the problem...I ran the .mxd through MXD Doctor and there seems to be nothing wrong with it. I'm stumped.
... View more
04-22-2015
04:09 PM
|
0
|
2
|
585
|
POST
|
What happened, did it freeze? I just tried running it on one of our main folders and it worked. It stopped when it hit a table view data source, but it was running through subfolders...
... View more
04-22-2015
01:00 PM
|
0
|
4
|
585
|
POST
|
Hi Lela, if I recall it does go through all the subfolders. So just change the path where indicated in the script and it will go through all folders/subfolders etc.
... View more
04-22-2015
12:21 PM
|
0
|
6
|
585
|
POST
|
Hi lela, I haven't looked at this in a long time but I do think it was working. I never made it to actually replacing the broken data sources as other things took priority but this should at least list which items have broken sources. I have two different scripts depending on data source type and never got to combining them but here they are. Should be pretty simple to add the table views one in if it's needed. I think it was hanging up before I put the test in to see if the data type is able to return a dataSource value, after I did that it worked fine. List Broken .mxd and .lyr sources: import arcpy, os
#Update the following path with the folder you want to inspect
path = r"H:\Plans\GIS Plans\2004\G2004-045"
#Update the .csv file name below
f = open('2004_Test.csv', 'w')
f.write("Type, File Path, Layer, Broken Path" + "\n")
for root, dirs, files in os.walk(path):
for fileName in files:
basename, extension = os.path.splitext(fileName)
#Write the information for all .mxd's with broken data sources
if extension == ".mxd":
fullPath = os.path.join(root, fileName)
mxd = arcpy.mapping.MapDocument(fullPath)
brknMXD = arcpy.mapping.ListBrokenDataSources(mxd)
for brknItem in brknMXD:
f.write("MXD, " + fullPath + ", " + brknItem.name)
#Test to see if the data type is able to return a dataSource value
if brknItem.supports("dataSource"):
f.write(", " + brknItem.dataSource + "\n")
else:
f.write("\n")
#Write the information for all .lyr's with broken data sources
elif extension == ".lyr":
fullPath = os.path.join(root, fileName)
lyr = arcpy.mapping.Layer(fullPath)
brknLYR = arcpy.mapping.ListBrokenDataSources(lyr)
for brknItem in brknLYR:
f.write("LYR, " + fullPath + ", " + brknItem.name)
#Test to see if the data type is able to return a dataSource value
if brknItem.supports("dataSource"):
f.write(", " + brknItem.dataSource + "\n")
else:
f.write("\n")
f.close()
print "Script Completed" List broken table views: import arcpy, os
#Update the following path with the folder you want to inspect
path = r"H:\Plans\GIS Plans\2004\G2004-045"
#Update the .csv file name below
f = open('2004_TestTableView.csv', 'w')
f.write("Type, File Path, Layer, Broken Path" + "\n")
for root, dirs, files in os.walk(path):
for fileName in files:
basename, extension = os.path.splitext(fileName)
#Write the information for all .mxd's with broken data sources
if extension == ".mxd":
fullPath = os.path.join(root, fileName)
mxd = arcpy.mapping.MapDocument(fullPath)
brknMXD = arcpy.mapping.ListBrokenDataSources(mxd)
for brknItem in brknMXD:
if extension ==".dbf":
f.write("MXD, " + fullPath + ", " + brknItem.name + ", " + brknItem.dataSource + "\n")
f.close()
print "Script Completed"
... View more
04-22-2015
08:11 AM
|
0
|
8
|
1199
|
POST
|
Hi, I'm VERY new to the ArcGIS javascript API. I'm trying to get two ESRI samples to work together: Toggle layer visibility | ArcGIS API for JavaScript Basemap Toggle | ArcGIS API for JavaScript I've got Toggle layer visibility working fine, but when I try to add in Basemap Toggle things go sideways and I don't know enough about the API to know why. Soon as I add in the reference esri/dijit/BasemapToggle, the map itself disappears. Here's my code: <code> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Maps on Request</title> <link rel="stylesheet" href="http://js.arcgis.com/3.13/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css"> <style> html, body, #map { padding: 0; margin: 0; height: 100%; } #TOC { position: absolute; font-family: verdana, helvetica, arial; margin: 5px; padding: 25px; padding-left: 75px; z-index: 50; } #BasemapToggle { position: absolute; top: 20px; right: 20px; z-index: 50; } </style> <script src="http://js.arcgis.com/3.13/"></script> <script> var map; require([ "esri/dijit/BasemapToggle", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/ImageParameters", "dojo/dom", "dojo/on", "dojo/query", "dojo/domReady!" ], function (Map, ArcGISDynamicMapServiceLayer, ImageParameters, BasemapToggle, dom, on, query) { var layer, visibleLayerIds = []; map = new Map("map", { basemap: "topo" }); //Use the ImageParameters to set the visibleLayerIds layers in the map service during ArcGISDynamicMapServiceLayer construction. var imageParameters = new ImageParameters(); //This layer is visible on startup imageParameters.layerIds = [0]; imageParameters.layerOption = ImageParameters.LAYER_OPTION_SHOW; //can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE layerCadastral = new ArcGISDynamicMapServiceLayer("http://cop-gis4:6080/arcgis/rest/services/MOR/MOR_Cadastral_WGS1984/MapServer", {"imageParameters": imageParameters}); map.addLayer(layerCadastral); on(dom.byId("layer0CheckBox"), "change", updateLayerVisibility); on(dom.byId("layer1CheckBox"), "change", updateLayerVisibility); on(dom.byId("layer2CheckBox"), "change", updateLayerVisibility); function updateLayerVisibility () { var inputs = query(".list_item"); var inputCount = inputs.length; //Dummy layer - is there a workaround? Setting this to an actual layer means it can't be turned off visibleLayerIds = [1001]; for (var i = 0; i < inputCount; i++) { if (inputs.checked) { visibleLayerIds.push(inputs.value); } } if (visibleLayerIds.length === 0) { visibleLayerIds.push(-1); } layerCadastral.setVisibleLayers(visibleLayerIds); } var toggle = new BasemapToggle({ map: map, basemap: "satellite" }, "BasemapToggle"); toggle.startup(); }); </script> </head> <body> <div id="TOC" Layer List:<br> <input type='checkbox' class='list_item' id='layer0CheckBox' checked value=0 />VFPA Boundary<br> <input type='checkbox' class='list_item' id='layer1CheckBox' value=3 />Municipal Boundaries<br> <input type='checkbox' class='list_item' id='layer2CheckBox' value=7 />Lots (zoom in)<br> </div> <div id="map"></div> <div id="BasemapToggle">BasemapToggle</div> </body> </html> </code>
... View more
04-01-2015
03:28 PM
|
0
|
2
|
4116
|
POST
|
We have installed the web adaptor and configured some of our map services to be available only to certain groups, based on a user's windows login info. Everything is working fine in our Silverlight map, users are not able to turn on or do any queries on the restricted layers. However I would like to have a dialog box pop up when the user tries to turn on a restricted layer, to tell them that they do not have permission to view this layer and if they think they should they need to speak to so and so. I'm just not sure where in my code to test whether the user has permission in order to pop up a dialog box. Currently when a restricted user turns the layer on, nothing happens - the checkbox appears checked but the geometry just does not show up. I know this might be vague so please let me know if I should post any code to clarify.
... View more
01-30-2015
09:08 AM
|
0
|
0
|
2836
|
POST
|
I found switching to “Use Classic Snapping” in Editing Options helped with this issue, and in general with editing.
... View more
08-15-2014
03:57 PM
|
0
|
1
|
1116
|
POST
|
Finally discovered that the images must have a path that is relative to the .xap file. So we moved all our images to the same server as the website is on and coded all the paths to be relative to the .xap file, and voila! Works.
... View more
03-28-2014
08:59 AM
|
0
|
0
|
501
|
Title | Kudos | Posted |
---|---|---|
1 | 03-09-2016 10:46 AM | |
1 | 01-21-2016 10:04 AM | |
1 | 06-23-2015 10:58 AM | |
1 | 01-19-2016 11:19 AM | |
1 | 08-10-2016 02:06 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|