Tag Archives: javascript

JavaScript Debugging Tips Part III – Advanced Google Chrome Developer Tools

This blog post is the third in a series of JavaScript debugging tips and tricks to help you on your way. See JavaScript Debugging Tips Part I  and also JavaScript Debugging Tips Part II for our previous segments.

In the past two JavaScript Debugging Tips posts on the Esri Support blog, we looked at the Network Tab and the Console Tab as part of the Google Chrome Developer Tools. While most modern browsers have some form of developer tools, here we use Chrome for our examples.

Our goal for this third blog post in the series is to introduce more advanced tips and tricks to enable you to more effectively debug and troubleshoot your JavaScript code. Specifically, we will focus on three areas: enhanced messaging to the console, better ways to set breakpoints using conditions specified at runtime, and a more efficient way of stepping through breakpoints in the Sources tab with a method called blackboxing. Continue reading

Posted in ArcGIS Online, export, SDK | Tagged , , , , , , , , , | 1 Comment

JavaScript Debugging Tips Part II – Google Chrome and the Console Tab

This blog post is the 2nd in a series of JavaScript debugging tips and tricks to help you on your way. See JavaScript Debugging Tips Part I – Google Chrome and the Network Tab for our first segment.

The most enjoyable part of any programming assignment is right near the beginning when you sit down with a pile of tools and resources and start hammering away at raw clumps of code. The more difficult part comes when you attempt to launch the application, only to watch that tightly-written code unravel into multiple late nights staring at a computer screen. However, all is not lost, as we have an excellent recommendation for you, which is the subject of this blog: the Console tab inside your favorite browser’s Developer Tools. Continue reading

Posted in export, SDK, Support.Esri.com | Tagged , , , , , | Leave a comment

Getting Comfortable with JavaScript API 4.0

Now that the ArcGIS API for JavaScript 4.0 has been released for a couple of weeks, this is an excellent opportunity to take a walk through some of the new syntax and functionality. This blog will go through a sample 3D application focusing on the Search widget. You can follow along with the sample code from the Esri Developer Support GitHub repository, and run the hosted sample here: View it Live.

Functionality-wise, the app displays a 3D map with four widgets: Search, Zoom, Compass, and Attribution. By default, the View includes the latter three widgets, as described in the documentation. If you’re not familiar with the 4.x changes, all mapping apps contain a map and a view. The map holds the data, and the view contains the visualization information for that data. In other words, the map is the subject, and the view is the camera; complete with filters, modes, and settings. All 2D apps will have MapViews, and 3D apps will have SceneViews (note: the term ‘scene’ indicates three dimensions across ArcGIS). The same applies for maps from ArcGIS Online and Portal for ArcGIS: a WebMap is 2D, and a WebScene is 3D.

2D map + 3D scene

2D map + 3D scene

Continue reading

Posted in export, SDK, Support.Esri.com | Tagged , , , , | 2 Comments

Final Release and Support Plan for the ArcGIS APIs / Viewers for Flex and Silverlight

Esri logo

The next release of each ArcGIS API and Viewer (for Flex and Silverlight) will be significant in that they are the last planned releases of two once-popular technologies. While technical support will be available for both APIs and viewers through June … Continue reading

Posted in export, SDK, Support.Esri.com | Tagged , , , , , , , , , , , , , | 4 Comments

JavaScript Events – Advocating for On Style Event Programming

Have you ever created a web application with the ArcGIS API for JavaScript? You may have noticed there are a variety of approaches to event-driven programming: the newer On Style events, the legacy Connect Style events, and events that are plugged directly into the body of an HTML page. Unless you are faced with adopting a legacy application that mixes patterns, it is a good idea to implement one event programming style: On Style.

The On Style events follow the Dojo framework’s most recent programming pattern, which I recommend to anyone using JavaScript API version 3.6 or higher. Here is a handy place to read more about working with events in the JavaScript API.

Continue reading

Posted in export, SDK, Support.Esri.com | Tagged , , , , | Leave a comment

Can I stay updated on the latest revisions to online templates?


Staying updated on the latest revisions to online templates can sometimes prevent problems from appearing further down the road, and is one way a user can avoid being in a situation where they would need to start customizing their template from scratch. Users … Continue reading

Posted in ArcGIS Online, export, Support.Esri.com | Tagged , , , , , , , , , , , , | Leave a comment

Troubleshooting Tips – Local Map Services Not Working

Have you ever come to the ArcGIS Resource Center and checked out or tried the samples built using one of the Web APIs? If you haven’t, these samples can be found at the following links:

For those of you who have tried some of these samples, I want to provide some quick troubleshooting tips to help you when your local map services are not working with the samples.

Let’s look at the following scenario: You check out the samples online, they work well. You copy the code over to your local machine and run them there, they work great. Now, you want to use your local ArcGIS Server map services. So, you publish a map service using ArcCatalog or Server Manager, and you are able to preview it. You then make changes to the REST service endpoint in the code and run your Web API-based application, but the map doesn’t appear in the Web browser. In this situation, here are a few things that you could test:

  1. Check if you can view the map in the REST Services Directory.

    showing the location of the REST directory within the URL

    If you cannot view the map, it could potentially be an issue with the installation, and the first thing I would suggest is adding a new instance of ArcGIS Server Manager. Please see the following knowledge base article for more information: HowTo: User the AddInstance utility to create a new instance of ArcGIS Server Manager.

  2. Check if a cross-domain access policy file exists.
    If you are working with either the Silverlight API or the Flex API, you will need to check for a cross-domain access policy file. To access data from a different server than the one hosting your Flex or Silverlight application, the remote server needs to have a cross-domain policy file in the root directory. This can be done by using a clientaccesspolicy.xml or crossdomain.xml. In most cases, you just need to place the .xml file at the root of your Web site (e.g., for IIS, c:inetpubwwwroot). Please see the following ArcGIS Web Help article for more information: Deploying your application.

  3. Check if the cross-domain access policy file has proper permissions. If you have placed the cross-domain access policy file but the application still doesn’t display the map, make sure you can access the cross-domain access policy file in a Web browser. If you can’t, check for permissions on the file. Make sure ‘Internet Guest Account’ has the permission set to ‘read (and execute)’ this file.

Other potential issues:

  1. Make sure the extent that you are setting is using the correct values, i.e., the values are in-line with the spatial reference of the map service.

  2. Make sure you are using the right layer class, for example, for a cached map service, use ArcGISTiledMapServiceLayer class.

I hope these troubleshooting tips help you to get your local map services working with the samples from the ArcGIS Resource Center.

- Kripa J., Esri Support Analyst – SDK group, Esri Support Services

Posted in export, Uncategorized | Tagged , , , , | Leave a comment

Obtaining the Aptana Studio IDE Plug-in to help in developing ArcGIS Server JavaScript API applications


Hi, my name is Jamie P., and I am an SDK Analyst with ESRI Support Services. Having worked in both Development and Support Services has provided me with in-depth skills in the world of GIS. I hope you enjoy my blog postings and find the information useful.

Aptana Studio is a great IDE for developing ArcGIS Server JavaScript API applications. Aptana Studio is built off of the Eclipse platform. Aptana Studio may be downloaded as a standalone all-in-one IDE installation, or as an Eclipse based plug-in. For current ArcGIS Server Java ADF developers who want to start developing using the ArcGIS Server JavaScript API, the Aptana Studio IDE plug-in is a great option for adding the Aptana JavaScript options to your current Eclipse IDE. For those of you who are not familiar with Eclipse, there is an explanation via this link: http://wiki.eclipse.org/Main_Page.


Downloading the Aptana Studio IDE Plug-in


Browse to the Aptana Studio download site to download the plug-in. Under “Step 1”, choose Eclipse Plugin from the Installation Type drop-down list. Choose the version of your current Eclipse IDE from the Eclipse Version drop-down list. Click the “Download Now” button to begin the download process.


Installing the Aptana Studio IDE Plug-in


Notice the “Thanks for Downloading Aptana Studio 1.2.7” text area on the download page. Scroll down to the section where it states “Install Aptana Studio as a Plugin”. Notice the plug-in sections for the supported Eclipse versions listed. For Eclipse 3.4, a URL is provided as an update site that can be referenced from your Eclipse “Software Add ons and Updates” dialog box.


Using the ArcGIS JavaScript API within Aptana


You can now develop ArcGIS Server JavaScript API applications from within your existing Eclipse IDE instance. Reference the ArcGIS Server JavaScript API from within your application page: <script type=”text/javascript”> document.write(“http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.1″)</script>.

Editing ArcGIS Server JavaScript application in Aptana

Previewing ArcGIS Server JavaScript application in Aptana

-Jamie P., Support Analyst, SDK Group, ESRI Support Services


Posted in export, Uncategorized | Tagged , , , , | Leave a comment