POST
|
Robert, Thanks so much for your response. This actually was one of the errors that was in my script. I added this change to the script, and subsequently got this error after trying to run it again: 'init.js:199 TypeError: b.toJson is not a function(…) "TypeError: b.toJson is not a function'. Could this have something to do with the drawRestaurants() function? Thanks so much for your help.
... View more
04-22-2016
09:06 AM
|
0
|
1
|
929
|
POST
|
Hello, I am currently in the process of creating a web application, in which I would like for the user to be able to type in their address, and have this location appear on the map. I have already accomplished this task. Next, I have created a geoprocessing model in ArcMap which should create a buffer around this point, and will find restaurants which intersect this buffer, and display them on the map. The model has 2 parameters, one distance parameter (linear unit), and one input parameter(feature set), which I have set as 'map.graphics' in my script. When I try to run the operation in a browser, i get a generic error: 'init.js:182 Error: Unable to complete operation'. I was wondering if anyone could tell me what they think I am doing wrong. Any help at all would be appreciated. Thanks so much in advance. Here is myJavaScript code: require([ "dojo/parser", "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/InfoTemplate", "esri/dijit/Search", "esri/dijit/LayerList", "esri/dijit/Scalebar", "esri/symbols/SimpleMarkerSymbol", "esri/Color", "esri/graphic", "esri/tasks/Geoprocessor", "esri/tasks/LinearUnit", "esri/tasks/locator", "esri/tasks/FeatureSet", "dojo/on", "dojo/_base/array", "dojo/dom", "dijit/registry", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "dijit/layout/AccordionPane", "dijit/layout/TabContainer", "dijit/form/Button", "dijit/form/Select", "dijit/form/HorizontalSlider", "dijit/form/HorizontalRule", "dijit/form/HorizontalRuleLabels", "dojo/domReady!" ], function (parser, Map, ArcGISDynamicMapServiceLayer, InfoTemplate, Search, LayerList, Scalebar, SimpleMarkerSymbol, Color, Graphic, Geoprocessor, LinearUnit, Locator, FeatureSet, on, arrayUtils, dom, registry){ parser.parse(); var map = new Map("map", { //Create the basemap basemap: "streets", center: [-77.6559716660883, 38.1850243980318], zoom: 11 }); var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("http://gis.spotsylvania.va.us/arcgis/rest/services/SoccerTournamentWebApp/SoccerTournamentMap_Initial/MapServer"); //Request Congressional Districts dynamic map service layer from ArcGIS Server. map.addLayer(dynamicMapServiceLayer); layers = [ //Create layers for insertion into LayerList constructor { layer:dynamicMapServiceLayer, showSubLayers: true, showLegend: true, showOpacitySlider: true, visibility: true, id: "Click arrow to the right to expand the layer list and map legend" } ] var onMapLoad = function() { var layerList = new LayerList({ map: map, layers: layers },"layerlist"); layerList.startup(); }; onMapLoad(); var scaleBar = new Scalebar({ map: map, attachTo: "bottom-left", scalebarStyle: "ruler", scalebarUnit: "english" }); var locator = new Locator("http://gis.spotsylvania.va.us/arcgis/rest/services/SoccerTournamentWebApp/AddressLocator/GeocodeServer"); var s = new Search({ map: map, }, "search"); s.startup(); registry.byId("locate").on("click", locate); function locate() { if(dom.byId("Street").value == "") { alert("Make sure that you have filled in all of the text boxes to find your location. Restaurants near you cannot be found unless your current location is known.") } else if(dom.byId("City").value == "") { alert("Make sure that you have filled in all of the text boxes to find your location. Restaurants near you cannot be found unless your current location is known.") } else if(dom.byId("State").value == "") { alert("Make sure that you have filled in all of the text boxes to find your location. Restaurants near you cannot be found unless your current location is known.") } else if(dom.byId("ZIP").value == "") { alert("Make sure that you have filled in all of the text boxes to find your location. Restaurants near you cannot be found unless your current location is known.") } else { map.graphics.clear(); var address = {"Single Line Input" : dom.byId("Street").value.toString() + "," + " " + dom.byId("City").value.toString() + "," + " " + dom.byId("State").value.toString() + "," + " " + dom.byId("ZIP").value.toString()}; console.log(address) locator.outSpatialReference = map.spatialReference; var options = { address: address, outFields: ["*"] } } locator.addressToLocations(options, showResults); } function showResults(results) { var candidate; var symbol = new SimpleMarkerSymbol(); var infoTemplate = new InfoTemplate( "Your Current Location", "Address: ${address}" ); symbol.setStyle(SimpleMarkerSymbol.STYLE_SQUARE); symbol.setColor(new Color([255,0,0,0.75])); var geom; arrayUtils.every(results, function(candidate) { console.log(candidate.score); if (candidate.score > 80){ var attributes = { address: candidate.address, score: candidate.score }; geom = candidate.location; var graphic = new Graphic(geom, symbol,attributes,infoTemplate); map.graphics.add(graphic); return false; } else { return true; } }); if ( geom !== undefined ) { map.centerAndZoom(geom, 12); } }; registry.byId("findRestaurants").on("click", findRestaurants); function findRestaurants() { var gp = new Geoprocessor("http://gis.spotsylvania.va.us/arcgis/rest/services/SoccerTournamentWebApp/FindRestaurantsNearMe/GPServer/Find%20Restaraunts%20Close%20to%20Me"); gp.setOutputSpatialReference({wkid:102100}); var distance = dom.byId("distance").value; var distUnit = new LinearUnit(); distUnit.distance = distance; distUnit.units = "esriMiles"; var inputFeatures = new FeatureSet(); var features = []; features.push(map.graphics); console.log(features); inputFeatures.features = features; var params = { "Distance": distUnit, "Feature_Set": features }; console.log(gp); console.log(params); gp.execute(params, drawRestaurants); }; function drawRestaurants(results) { var symbol1 = new SimpleMarkerSymbol(); var infoTemplate1 = new InfoTemplate( "${Name of Facility}", "Address: ${address}" ); symbol1.setStyle(SimpleMarkerSymbol.STYLE_SQUARE); symbol1.setColor(new Color([0,0,255])); var features = results[0].value.features; for (var f=0; f<features.length; f++) { var feature = features ; feature.setSymbol(symbol1); map.graphics.add(feature); } }; });
... View more
04-22-2016
07:46 AM
|
0
|
9
|
3902
|
POST
|
Hello, I am currently thinking of creating an application using the ArcGIS API for JavaScript, which utilizes ESRI's World Traffic Map, as well as a routing service, which together would provide users with directions based on the latest traffic patterns. I was wondering if this is even possible to do. I understand that something like Google Maps can just do this for you without having to create anything, but I am creating an application in which this is one of several features. If anyone could give me more information, or more ideas about how I could try to do this, that would be wonderful. Thanks so much for your time. -Jacob Snyder
... View more
03-22-2016
06:17 AM
|
0
|
1
|
1358
|
POST
|
This did exactly what I needed it to do. Thanks so much for your help.
... View more
03-14-2016
08:24 AM
|
0
|
1
|
679
|
POST
|
Hello, I am currently attempting to send an MXD file which contains two data layers: one is a vectir polygon feature class which exists on an ArcSDE, while the other is a raster image that is located on an external ArcGIS Server. I would like to know how to send the MXD to someone else in a way that would maintain the data sources, and make it so that the person that I am sending this to will not have to fix broken data sources. Any help would be appreciated. Thanks. -Jacob Snyder
... View more
03-14-2016
07:39 AM
|
0
|
3
|
1960
|
POST
|
Hello, Could someone direct me to a resource that gives instruction on how to migrate content (feature services, web applications) that currently exists under 'My Content' in ArcGIS Online to an ArcGIS Server? I would like to migrate as much of the content that is currently under 'My Content' in my ArcGIS Online account to an ArcGIS Server because I do not want to use my organizations ArcGIS Online credits to store much of the data. Any help at all would be greatly appreciated. Thanks so much. -Jacob
... View more
10-21-2015
07:22 AM
|
0
|
1
|
2250
|
POST
|
Hello, I am currently trying to create a web map using layers that are located on an ArcGIS Server. Wehn attempting to add layers from the ArcGIS Server to the web map, I get the following error: "Unable to establish a secure connection to the layer...". Can anyone explain this error to me? Is there a workaround? Any sort of help would be appreciated. Thanks so much. -Jacob Snyder
... View more
10-15-2015
07:14 AM
|
0
|
2
|
3668
|
POST
|
Robert, That is actually something that I had to do in order to get this to work.
... View more
09-24-2015
06:41 AM
|
0
|
0
|
1086
|
POST
|
Figured out the issue. Feature layer was simply not editable. I had to edit the properties of the feature layer in ArcGIS Online to enable editing. Thanks so much for all of the help.
... View more
09-24-2015
06:04 AM
|
0
|
0
|
1086
|
POST
|
Xiaodang, This is the message that I get when I try to add the 'Edit' widget. I get this message despite the fact that I have made all of my layers editable in the web map.
... View more
09-24-2015
05:26 AM
|
0
|
2
|
1086
|
POST
|
I appreciate all of the time that everyone has taken to help me with this issue. I honestly am not sure which edition I am working off of. When I first went to create the web application, I was on the My Content page of my ArcGIS Online account, selected the 'Create' option, then 'App', and from the drop down list, 'Using the Web AppBuilder'. Could this problem have something to do with the fact that I am working off of ArcGIS 10.1? And that the data that I am trying to edit was created as a shapefile in ArcMap 10.1? Also, if I share this service, will that make it so that I cannot continue to make edits? Sorry for all of the questions, but I have never worked with this technology before. Thanks so much. -Jacob
... View more
09-24-2015
05:24 AM
|
0
|
0
|
1086
|
POST
|
Rickey, Yes I can edit the layer in an ArcGIS online web map. However, I cannot use the editing widget in Web AppBuilder, and I need to use Web AppBuilder for what I am trying to accomplish. -Jacob
... View more
09-23-2015
11:57 AM
|
0
|
2
|
1086
|
POST
|
Hello, I am currently trying to add the 'Edit' widget to my application and when I try to add it, it says that there are no editable layers in the web map that is servicing the application. However, I have enabled editing for all of the layers in the web map. If anyone can informa me on something that I am not doing or that I am doing wrong, that would be great. Thanks -Jacob
... View more
09-23-2015
10:08 AM
|
0
|
9
|
4168
|
POST
|
Blake, ArcREST seemed promising but I am working off of ArcGIS 10.1. I noticed that ArcREST requires at least 10.2
... View more
09-21-2015
11:57 AM
|
0
|
0
|
857
|
POST
|
If it helps, I work off of ArcGIS 10.1. ArcREST seemed promising but it requires that you have at least 10.2
... View more
09-21-2015
11:56 AM
|
0
|
0
|
857
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|