|
POST
|
That's ok, this is a good time to learn. Log into ArcGIS for Developers, go to applications, then click on the Authentication tab, and enter the URL to your machine name on your server and click the add button. The URL to your machine name on your server is something like this: http://my.server.com If you don't know your machine name on your server, do you have someone you can ask?
... View more
01-14-2015
04:34 PM
|
1
|
9
|
9532
|
|
POST
|
What did you put as the redirect URI in the application in your ArcGIS for Developers account?
... View more
01-14-2015
04:19 PM
|
0
|
11
|
9532
|
|
POST
|
Also, make sure that the "Current Redirect URIs" are appropriate in the application in your ArcGIS for Developers account. This should be the name of your machine on your network. During Web AppBuilder registration, you may inputhttp://[yourmachinename]:3344/webappbuilder as URL of the app item,http://[yourmachinename]and https://[yourmachinename] as Redirect URIs. Get started—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
... View more
01-14-2015
02:09 PM
|
3
|
13
|
9532
|
|
POST
|
Hi Kyle, It could be an Xcode simulator only issue. I would be curious to know the versions of: Mac OS X Xcode iOS SDK If you are interested in further troubleshooting, you could debug the web traffic when running the simulator, and see if any of the requests throw an error. You can do this with Fiddler running on a PC, or with Charles, which can run on a Mac. Here are some resources: Smart debugging for Android and iOS applications Debugging with Fiddler for Android and iOS applications | Support Services Blog Capture Traffic from iOS Device http://docs.telerik.com/fiddler/configure-fiddler/tasks/configureforios Hope this helps! -Noah
... View more
01-09-2015
10:59 AM
|
0
|
0
|
955
|
|
POST
|
I think this is by design. The REST directory for the GeoEnrichment Services endpoint is disabled for most people (including myself). Most of the pay services have this feature, including Routing, Traffic, Geocode, etc. Hope this helps. -Noah
... View more
12-29-2014
02:27 PM
|
0
|
0
|
2583
|
|
POST
|
Hmm, I do not think that you can add a shapefile to the map as a feature layer. I have seen a JavaScript sample where you can add a shapefile to the map as a feature collection though: Add shapefile sample Also, here is a link to documentation about working with shapefiles in a web application: Shapefiles—ArcGIS Online Help | ArcGIS Hope this helps. Regards, Noah
... View more
12-29-2014
09:06 AM
|
0
|
0
|
3218
|
|
POST
|
Running the above code in Chrome (after fixing the require statement) with the Developer Tools open, yields this error: Uncaught ReferenceError: layer is not defined (GeoNetTest.html:157). Looks like this line of code is causing you trouble, as layer is not a valid FeatureLayer (at around line 157). var featureLayer = new FeatureLayer(layer,{
infoTemplate: infoTemplate,
outFields: ["SOURCE_CAS","SOURCE_SIT","SOURCE_OEM", "SOURCE_MAR", "SOURCE_LEA", "SOURCE_TOT"]
}); Hope this helps. Happy Holidays. Regards, Noah Screenshot:
... View more
12-26-2014
03:18 PM
|
0
|
2
|
3218
|
|
BLOG
|
Note: Click images to enlarge. The modular On Style Events (which means something like à la mode in French) are a bit different than Connect Style Events. Why does this matter? Because On Style Events are the recommended way to listen for and handle events with the ArcGIS JavaScript API. See the screenshot below for snippets of event styles. Since version 3.5 of the JavaScript API, these event handling functions receive a single event object from which all the event object properties can be accessed. Typically, this object is called event or evt in our samples. Instead of juggling multiple objects like with Connect Style, we can now dig into one object to access the information we need. There are two ways to use the On Style Events - with and without Dojo. The syntax for these event styles can be found in the JavaScript API reference. Let’s look at a couple code snippets to compare On Style Events with and without Dojo:on = with Dojo (on is an alias for the dojo/on module) on(map, ’zoom-end’, function(evt) {
console.log(evt.extent.xmin);
console.log(evt.zoomFactor);
console.log(evt.anchor.x);
console.log(evt.level);
});map.on = without Dojo (map.on means we can do this event ourselves)map.on(’zoom-end’, function(evt) {
console.log(evt.extent.xmin);
console.log(evt.zoomFactor);
console.log(evt.anchor.x);
console.log(evt.level);
});By examining the above code snippets, we can see that the main difference when using On Style Events is in what the event listeners return. We can also see similarities among the new styles of event handlers, but there are important differences worth exploring. Not bad, right? For more better understanding, here's a real-world example. You can follow along at home with the JavaScript Events application hosted on jsfiddle.net. Use the following instructions to follow along (I used Google Chrome for this example): 1. Open the application in your browser. 2. Press F12. 3. Navigate to the Console Tab, if not open already. The following screen displays: This application shows the functionality of dynamic layers and our elegant dark gray basemap tiles (you can also try the application live here: JavaScript Events application on GitHub). As you zoom in and out of the map, different layers become visible as indicated in the lower-left information box. There are six event listeners in this application. Let’s go through them one by one and see what they do.1) map.on("load", function() When the map first loads, it immediately runs the unnamed function. This listener will only be called once while the application is running, and the listener does not take any arguments in the function. The purpose is to define the four other event listeners and to call the updateScale() function. This allows the scale to be defined in the information box without panning or zooming.2) map.on("zoom-end", updateScale) After zooming in or out of a map, this event listener will call the updateScale() function. This function updates the map scale in the information box and in the Console tab. This listener does not take any arguments in the function, either. See below for the event handler: function updateScale() {
dojo.byId("map-scale").innerHTML =
dojo.number.format(parseInt(map.getScale()));
console.log("Map scale: "
+ dojo.number.format(parseInt(map.getScale())));
}3) map.on("pan-end", updateExtent)When a user pans around the map, this event listener will call the updateExtent() function, which will update the map extent in the Console tab. This listener takes the generic evt argument in the function.Pro tip: There are many other attributes that you can dig out of the evt object. To see what is available, use the following steps (I used Google Chrome for this example): 1. Press F12 to open the developer's tools. 2. Navigate to the Source tab. 3. Find the section of code with this event handler (around line 170). 4. To set a breakpoint, click the line number to the left of the code. See below for a screenshot of this process. 5. Refresh the application, and when the application pauses on the breakpoint, switch to the Console tab and type “evt” into the prompt. You can now expand the evt object to see what’s there and experiment with how to call it. View the screenshot below to see how the evt appears in the Google Chrome Console tab. See below for the event handler: function updateExtent(evt) {
console.log("Map extent");
console.log(" XMin: " + evt.extent.xmin);
console.log(" YMin: " + evt.extent.ymin);
console.log(" XMax: " + evt.extent.xmax);
console.log(" YMax: " + evt.extent.ymax);
}4) map.on("zoom-start", updateOldLevel)When a user zooms in or out of the map, as soon as the zooming action starts, this event listener will call the updateOldLevel() function. This updates the zoom level of the map in the Console tab. Again, the listener takes the generic evt argument in the function. Please see below for the event handler: function updateOldLevel(evt) {
console.log("Map zoom level was: " + evt.level);
}5) map.on("zoom-end", updateNewLevel)When a user zooms in or out of the map, as soon as the zooming action stops, this event listener will call the updateNewLevel() function. This updates the zoom level of the map in the Console tab. Notice that it again takes the generic evt argument in the function. Please see below for the event handler: function updateNewLevel(evt) {
console.log("Map zoom level is: " + evt.level);
}6) usaLayer.on("load", load)When the application first loads the usaLayer map service, this event listener calls the load() function, which displays the minScale values for each layer in the Console tab. If you open the map service from REST (http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer) and compare the minScale values for each layer, you see that the dynamicLayerInfo class in the code overrides each layer, which is pretty interesting. Notice that it again takes the generic evt argument in the function. Please see below for the event handler: function load (evt) {
console.log("layer 1 minScale: "
+ evt.layer.dynamicLayerInfos[0].minScale);
console.log("layer 2 minScale: "
+ evt.layer.dynamicLayerInfos[1].minScale);
console.log("layer 3 minScale: "
+ evt.layer.dynamicLayerInfos[2].minScale);
console.log("layer 4 minScale: "
+ evt.layer.dynamicLayerInfos[3].minScale);
}For most of you, this is a refresher about working with On Style Events and the JavaScript API. But also for most of you, this will be new and exciting information to take your web apps (and salaries) to the next level. Let’s take a minute to review what we learned here. On Style Events have been around for a while and are slightly different than Connect Style, but are just as easy to use. On Style Events are simple and powerful ways of listening and handling many different event patterns. You can dig into all the arguments in the Console tab by setting a breakpoint and calling the argument object "evt". Please consider reading our Concepts documentation for more information about working with events in the JavaScript API:https://developers.arcgis.com/javascript/jshelp/inside_events.html Stay tuned until next time, when we discuss how to make your map "pop" with the new dojo.redecorate method. Happy eventing! Noah S. - SDK Support Analyst |