Archive for May, 2009

Website Redesign Complete for Geospatial Training

Posted on May 29, 2009. Filed under: GeoSpatial Training Services |

We’ve wrapped up the redesign of the Geospatial Training Services website so head on over to http://geospatialtraining.com to view the site.

Read Full Post | Make a Comment ( None so far )

Google Maps Version 3

Posted on May 27, 2009. Filed under: GeoSpatial Training Services, Google Maps |

Big news today out of the Google I/O Conference is that Google Maps API v3 was released  in Google Code Labs.  Documentation for the  new release can be found here.

According to the Google Geo Developers blog the primary motivation behind this new version was speed, especially for rendering maps on mobile browsers.

Changes for v3 according to the blog include:

  • Chrome and iPhone Safari mobile added to our supported browsers.
  • Your mashups will also work on Android-based phones with the recent update, but you may notice some issues, like the “View/Save Image” dialog showing unexpectedly. We’re working with the Android team to fix this and improve the end user’s experience in interacting with the map. We could’ve waited until it’s perfect, but we really wanted to get an early release in your hands and start getting feedback while we fix up a few remaining issues.
  • No keys required. You can now copy ‘n paste code easily or embed in RSS readers, for example, without getting key errors.
  • MVC-based architecture. This allowed us to significantly reduce the size of our initial JavaScript download. We found it to be simple and powerful.
  • Default UI is enabled automatically. We’ll provide default UI controls and behavior (and we’ll update them) so your mashup can keep up with the latest and greatest changes we make to Google Maps. Of course, if you’ve got customized controls you’re happy with, you can disable the default UI updates.
  • Namespaces. Everything is always in the google.maps.* namespace and there is no “G” prefixed variables in the global scope.
  • Geocoding API has been overhauled based on the feedback we’ve received with the existing implementation over the past three years

As we have from the inception of the Google Maps API we’ll continue to provide updates to our “Introduction to the Google Maps API” e-learning course and e-book to reflect the changes coming in v3.

Read Full Post | Make a Comment ( None so far )

Fundamentals of Using Dojo with the ArcGIS Server JavaScript API

Posted on May 18, 2009. Filed under: ArcGIS Server, Dojo, ESRI |

As I mentioned in the first post in this series the ArcGIS Server JavaScript API provides easy access to the functionality provided by Dojo since it was built directly on top of the framework.  This means that you can access everything within Dojo base and core as well as the user interface dijits.  In this post we’ll cover some of the most commonly used features of Dojo that you’ll use when writing your ArcGIS Server JavaScript API applications.

As I mentioned in the last post, the ArcGIS Server JavaScript API provides easy access to the functionality provided by Dojo since it was built directly on top of the framework.    This means that you can access everything within Dojo base and core as well as the user interface dijits.  In this post we’ll cover some of the most commonly used features of Dojo that you’ll use when writing your ArcGIS Server JavaScript API applications.
Adding Dojo and the ArcGIS Server JavaScript API to your Application
Before you can begin working with either the ArcGIS Server JavaScript API or Dojo you must provide some boilerplate code in the <head> and <body> tags of your application.  Basically this requires the following  three steps :
1. References in the <head> section to:
o Dojo style sheet you intend to use
o ArcGIS Server JavaScript API which as you know also contains Dojo
2. Set the class for the <body> tag to the Dojo style sheet you have selected
3. Add dojo.require statements for the ArcGIS Server and Dojo resources you intend to use
Step 1: Reference the Dojo Style Sheet and ArcGIS Server JavaScript API
A reference to the style sheet provided by Dojo is provided mainly to control the look and feel of the graphic elements in your map as well as any user interface dijits that you add to your application.  This is accomplished by adding the following line of code in the <head> section of your application.
As I mentioned in the first post in this series the ArcGIS Server JavaScript API provides easy access to the functionality provided by Dojo since it was built directly on top of the framework.    This means that you can access everything within Dojo base and core as well as the user interface dijits.  In this post we’ll cover some of the most commonly used features of Dojo that you’ll use when writing your ArcGIS Server JavaScript API applications.

Adding Dojo and the ArcGIS Server JavaScript API to your Application
Before you can begin working with either the ArcGIS Server JavaScript API or Dojo you must provide some boilerplate code in the <head> and <body> tags of your application.  Basically this requires the following  three steps :

1. References in the <head> section to:

A.  Dojo style sheet you intend to use
B.  ArcGIS Server JavaScript API which as you know also contains Dojo

2. Set the class for the <body> tag to the Dojo style sheet you have selected

3. Add dojo.require statements for the ArcGIS Server and Dojo resources you intend to use

Step 1: Reference the Dojo Style Sheet and ArcGIS Server JavaScript API
A reference to the style sheet provided by Dojo is provided mainly to control the look and feel of the graphic elements in your map as well as any user interface dijits that you add to your application.  This is accomplished by adding the following line of code in the <head> section of your application.

In the code snippet above we are referencing the “tundra” style sheet.  The style sheet is a set of fonts, colors, and sizing settings for your user interface components.   Dojo also provides style sheets for “nihilo” and “soria”, and you can certainly develop your own themes as well.  In addition to providing a reference to a style sheet you will also need to add a <script> tag that references the ArcGIS Server JavaScript API as seen below.  This reference also includes everything included with Dojo since the JavaScript API was built on top of Dojo.

Step 2: Set the Class of the Map <div> Tag
Next, you’ll need to set the class of the map to match the theme of the style sheet that you referenced in Step 1.  Notice in the code example below that we are referencing the “tundra” theme.  If you had referenced the “soria”, “nihilo”, or your own custom style sheet you’d reference this theme here instead of “tundra”.

Step 3: Add dojo.require() Statements
The ArcGIS Server JavaScript API includes a number of “resources” that you can use in your application, the most commonly used of which are identified in the table below.
To use any of these resources in your application you will need to import them into your application with dojo.require() .  For example, the two lines of code that you see below will import functionality related to maps, geometry, graphics and symbols (“esri.map”) as well as geoprocessing functionality (“esri.geoprocessing”).
The dojo.require() method can also be used to import various Dojo dijits and other functionality provided by Dojo core.
Each of these “resources” are really small code modules and act much the same as “include” or “import” statements in other languages.  Each dojo.require( ) statement is placed inside  a <script> tag in the <head> section of your application.
Important Note: You will be applying these three steps to every ArcGIS Server JavaScript application that you develop.  Once you’ve completed these three steps you are ready to begin developing the functionality of your application.
There are a few additional Dojo methods that I’d like to introduce at this time which you will use frequently when developing your ArcGIS Server JavaScript API applications.
dojo.addOnLoad()
This method is similar to the “<body onload()>” event in that it registers a JavaScript initialization function to be run after all the web page components have been loaded.  In the code sample below you will see an example of dojo.addOnLoad( ) in action.
In this case, dojo.addOnLoad calls a JavaScript function called “init”.  The addOnLoad function will ensure that the JavaScript “init” function will run only after all elements of the web page have loaded.  Normally the initialization function is used to set up the initial parameters of your application including loading the map, setting the initial appearance of the user interface components, and referencing various tasks provided by ArcGIS Server.
dojo.connect()
We’ll cover this function in greater detail in a future post so for now I’ll simply provide a high level overview.  Dojo.connect( ) is used to connect events with listener functions that will run in response to those events.  For example, when a user clicks your map this is known as a Map.onClick event.  You can write JavaScript code that runs in response to this event.  Perhaps you’d like to display the map coordinates where the user clicked or perform a reverse geocoding operation.  There are many events that can occur in an application, but you only need to write code that responds to those events your application is interested in.  For example, the code snippet below connects the Map.onClick event to a JavaScript function called “doReverseGeocode” which will perform a reverse geocode based on the point that was created through a map click.
dojo.byId()
This method is used to search for and return an HTML DOM element similar to what you’d find with the JavaScript document.getElementById() method.
Conclusion
In this post you were introduced to some of the more commonly used Dojo methods in an ArcGIS Server JavaScript API.  While this will certainly get you started in your development efforts, the Dojo framework can do so much more.  We’ll continue our exploration of Dojo and its use with ArcGIS Server as well as Google Maps in future posts.
More Information
Want more information on the ArcGIS Server JavaScript API?  View our articles or take the next session of our upcoming “Building Web 2.0 Mapping Applications with ArcGIS Server and Google Maps” Internet course.
Read Full Post | Make a Comment ( None so far )

E-Learning Course Samples

Posted on May 17, 2009. Filed under: Uncategorized |

For the past 4 years at GeoSpatial Training Services we have provided e-learning and instructor led GIS training courses.  We specialize in ESRI, Google Earth, Google Maps, and GPS subject material.  From time to time we like to provide samples of the courses that we develop.  Below you will find a number of samples from several courses that we have developed.

Mastering Python for Geoprocessing in ArcGIS
This course is designed to teach the fundamental programming constructs of the Python language and how it can be integrated with ArcGIS Desktop to automate geoprocessing tasks.

This course is designed to teach the fundamental programming constructs of the Python language and how it can be integrated with ArcGIS Desktop to automate geoprocessing tasks.This course is designed to teach the fundamental programming constructs of the Python language and how it can be integrated with ArcGIS Desktop to automate geoprocessing tasks

  • Lecture Sample – This sample is from Module 8: Cursor Objects and deals with adding, updating, deleting, and selecting records from tables and feature classes.
  • Exercise 8A
  • Exercise 8B

Course Modules

  • Module 1:  Getting Started with Python in ArcGIS
  • Module 2:  Basic Python Language Features
  • Module 3:  The Geoprocessor ArcObject
  • Module 4: Reading the Geoprocessor Object Model Diagram
  • Module 5:  Accessing Geoprocessing Tools
  • Module 6:  Tool Messaging, Results and Error Handling
  • Module 7:  Obtaining Descriptive Information About ArcGIS Data
  • Module 8: Using Cursor Objects to Select, Edit, and Add Records to Tables and Feature Classes
  • Module 9:  Creating Lists of GIS Data
  • Module 10:  Miscellaneous Objects
  • Module 11:  Creating Custom Script Tools
  • Module 12:  Geoprocessing History

What you learn in this course

  • Python language fundamentals
  • How to read and use the Geoprocessor Object Model Diagram in your scripting tasks
  • Use the PythonWin integrated development environment
  • Integrate ArcToolbox and custom tools into your Python geoprocessing scripts
  • Retrieve and create messages from the geoprocessor
  • Gracefully handle errors in your scripts
  • Obtain descriptive information about your GIS data
  • Search for data in your feature classes and tables
  • Insert, update, and delete data from feature classes and tables
  • Read and write feature geometry in feature classes
  • Create lists of data in your script for further geoprocessing
  • Create custom script tools that can be integrated with ArcToolbox and shared with others in your organization
  • Schedule scripts to run after hours
  • Obtain historical geoprocessing informatio

Mastering KML for Google Earth
KML is an XML based file format used to display geographic data in Google Earth, Google Maps, and Google Maps for Mobile.  Data displayed in Google Earth is contained in KML files, and in our  e-learning course you will master the use of KML for creating advanced applications.

Lecture Sample – This sample is from Module 3: Advanced KML Elements

Modules – See full syllabus here

  • Introduction to KML
  • Basic KML Elements
  • Advanced KML Elements
  • Miscellaneous Topics

New skills acquired through this course:

  • Learn how KML is used by Google Earth and other Earth browsers to display geographic data
  • Create Placemarks, Paths, Polgyons
  • Attach descriptive information to Placemarks in the form of Balloons
  • Symbolize your geographic data with Styles
  • Overlay raster images and photos on the Google Earth terrain
  • Add legends and logos
  • Control the Google Earth Camera
  • Create dynamic data feeds with Network Links
  • Use Regions for displaying large data sets
  • Use KML Generation tools
  • Package, distribute and enable Internet searching of your KML files

Introduction to the Google Maps API
This has been our most popular course over the past 3 years.  It is designed to enable you to take advantage of Google Maps for your website. You will learn how to create maps, add map controls for user interactions (zooming, and panning), programmatically alter the map extent, add points of interest to the map, add custom icons, geocode addresses on the fly, read addresses from a database or XML file, and display imagery.

Lecture Sample – This sample is from Module 2: Basic Google Maps API Concepts.

Sample Exercise

Course Modules

  • Module 1:  Introduction to Google Maps
  • Module 2:  Google Maps Basics
  • Module 3:  Geocoding
  • Module 4:  Reading Data from XML Files and Databases
  • Module 5:  Google Maps Utility Classes
  • Module 6:  Driving Directions, Traffic Conditions, and Street View
  • Module 7:  Integration with Google Earth
  • Module 8:  Integrating Local Search with Google Maps

New skills acquired in this course:

  • Create and add dynamic Google Maps to your website
  • Add various map types including aerial imagery, terrrain, hybrid, and default maps
  • Add navigational controls
  • Create markers and info windows for your data and add them to your map
  • Create polylines and polygons
  • Add your own custom imagery to the map
  • Read data from XML, JSON, KML files
  • Geocode your addresses and add to the map
  • Use utility classes such as MarkerManager, ProgressbarControl and others
  • Use Street View, add driving directions and traffic information

Integrating GPS Data with GIS

This course focuses on getting GPS data into a GIS. It will cover what equipment to use, how the equipment dictates the workflows, pros and cons of each workflow, and how to incorporate GPS data collecting in your organization.

Lecture SampleSample from Lesson 4: GPS/GIS Workflows

Course Modules

  • Overview of GPS
  • Overview of GIS
  • Planning for GPS Data
  • The Right Equipment for the Job
  • Toosl and Workflows
  • Best Practices

New skills acquired in this course

  • Recreational vs. Commercial receivers  
  • Differential GPS
  • Database design and storage of GPS data
  • Equipment preparation and maintenance
  • Identifying your needs in terms of accuracy, attributes, photos, and mapping software
  • Post processing of your data
  • ArcPad and Trimble workflows
  • Recreational receiver workflows

Read Full Post | Make a Comment ( None so far )

Using Dojo to Enhance Web Mapping Applications

Posted on May 4, 2009. Filed under: ArcGIS Server, Dojo |

User expectations for web mapping applications have changed dramatically in the past few years thanks largely to Google Maps and Microsoft Virtual Earth technologies which brought “Web 2.0” to the masses and forever changed our expectations of how these applications should look, perform, and access data. With the advent of “Web 2.0” your applications must meet certain expectations including sleek interface controls, a better user experience driven largely by asynchronous data processing and client-side scripting, drag and drop capabilities, and the ability to combine or “mashup” multiple data sources into a single application.  A number of JavaScript toolkits including Dojo, jQuery, Yui, Mochikit, and many others have been developed to enable these capabilities.  ESRI recently released the JavaScript API for ArcGIS Server which was built on top of the Dojo toolkit and enables developers to take advantage of the capabilities provided by this JavaScript toolkit. Dojo is also a highly flexible toolkit that allows you to pick and choose the pieces of the toolkit that best fit your needs. According to Jayant Sai of ESRI, “We like the fact that our users can use the whole Dojo toolkit to build their next generation web 2.0 mapping application, or use just our mapping components, without really getting into the hardcore JavaScript pieces of the toolkit.”

Today we are starting a series of posts concentrating on the use of Dojo for building web mapping applications. We’ll not only examine how Dojo is used with the ArcGIS Server JavaScript API, but you’ll also see how you can use this toolkit with other mapping API’s including Google Maps. We’ll start with a simple overview of Dojo and how it can be used in your web based GIS applications.

What is Dojo?
Dojo is an open source JavaScript toolkit that enables you to write robust, efficient applications without the need for a client-side plugin or server-side component. There are of course many different types of web browsers, and each interprets JavaScript differently. Dojo helps smooth out these differences and resolve any inconsistencies between the different types of browsers. From an application developer perspective, tookits like Dojo result in a simpler development process that does not require browser dependent code. These applications are also easier to test, debug, and deploy in a production environment.

Dojo is a collection of static, client-side JavaScript scripts that does not require a client-side plugin nor does it require the use of a server side component. It is a set of open source tools that helps you build better browser-based applications by resolving inconsistencies between various browsers, expanding the capabilities of the web browser, provides for the integration of user interface controls, and functions primarily through client-side JavaScript.

What does it do?
Dojo is perhaps best known for the HTML user interface components, called Dijits, which you can plug into your application. You can see some examples of these components by reviewing the Dojo Feature Explorer provided by DojoCampus.org. This alone would be good reason to use Dojo, but this toolkit provides so much more. In addition, to the user components Dojo also provides the following:

  • Fixes browser incompatibilities and memory leaks (no more browser dependent code)
  • Normalizes the browser event system across browsers
  • DOM utilities
  • Build system that divides your code into small, manageable chunks for development and a packaging system for optimal download performance
  • Internationalization, localization, and accessibility
  • Support for asynchronous programming
  • Remote scripting with XHR, script, and iframe
  • Drivers for accessing data in JSON, XML, CSV, and other formats including web services such as Flickr and Picasa

Three Projects (Dojo, Dijits, DojoX)
What we call Dojo is actually three projects: Dojo, Dijits, and DojoX.

Dojo core is the foundation for all three projects and handles browser normalization, fixes browser incompatibilities, allows DOM querying, remote scripting, drag and drop, data store API, localization and internationalization, Firebug integration, cookie handling, accessibility, and much more.

Dijit includes the Dojo framework along with roughly 40 HTML user interface widgets including buttons, text boxes, grids, tree views charts, color pickets and many others. Tundra is the default CSS theme for Dijit and is designed to blend into existing color palettes and design. An additional theme, Soria, is available as well and you can certainly build your own if neither the Tundra or Soria themes fit your needs.

DojoX are Dojo extensions and includes projects such as the grid widget, a graphics library, charting, image handling and more. These often include some very sophisticated projects which are not necessarily as stable as what you’ll find in Dojo or Dijit.

ESRI and Dojo
The ArcGIS Server JavaScript API, released with ArcGIS Server 9.3, sits directly on top of Dojo providing developers with access to Dojo user interface widgets and all the other benefits of Dojo core through a simple reference in your web application.

Since Dojo is included with the ArcGIS JavaScript API you do not need to reference the Dojo API to get access to its functionality.  When you include the following references to the ArcGIS Server JavaScript API, you also get access to the full Dojo toolkit.  There is no need to download, host, or even reference the Dojo API.

In fact, the ESRI zoom slider was built with the Vertical Slider Dijit.

In coming posts we’ll take a look at how you can integrate a number of other dijits into your web applications.

Using Dojo with Google Maps API
You can also take advantage of Dojo when creating Google Maps API applications (this applies to other JavaScript mapping API’s as well).  Although the Google Maps API isn’t built on top of Dojo like ESRI’s ArcGIS Server JavaScript API its quite simple to take advantage of its functionality.  In this case you have several options.  The easiest of which is to simply reference the publicly available Dojo hosted on the AOL Content Delivery Network (CDN).  We’ve done just that in the code example you see below.

Your other options for downloading Dojo to your local environment include:

Conclusion
Whether you’re looking to build a great “Web 2.0” interface for your mapping application or simply take advantage of its developer efficiencies, Dojo is a great JavaScript tookit for accomplishing

In the next post in this series we’ll take a closer look at the Dojo toolkit and how it is used in ArcGIS Server JavaScript applications.

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...

Follow

Get every new post delivered to your Inbox.

Join 47 other followers