Archive for the ‘Tutorials’ Category

What You Don’t Know About Google API’s Can’t Hurt You

Wednesday, May 27th, 2009

Mano Marks lead off on the 1st Google Geo session for Google I/O this year. 

First up were updates, enhancements, and changes for the Google Earth API and Google Earth support for HMTL.  Highlights included

  • The new Tour KML tags for GE 5.0
  • Use of update tags during Tours to create animations during tours
  • Using the GE API to playback tours
  • Limited HTML 5 is operative within GE 5.0 including video and audio tags on the Mac (via webkit 4.5 on PC)
  • Based on an audience question, JavaScript support for JS within KML description windows will be resolved soon

SketchUp API – Mano showed some neat physics simulations which use the SketchUp API.

Pamela Fox presented on Google Maps APIs.  

  • Travelling Salesman in Google Maps www.geweb.net/optimap/
  • StaticMaps API does support directions 
  • Google Maps API can be used for Desktop Applications (Section 7.1c in the Terms of Service)
  • Reverse Geocoding, you can get full jSON on reserve lookups for large areas and the bounding box will be returned as the recommended viewport
  • ClientLocation API to use IP to rough guess user location
  • Monetization: GoogleBar and Maps Ad Unit
  • Recoloring tiles in Flash (mush be approved by Google)
  • 3D Flash Map with GE API like rotation control in Flash 9 and 10 (coming soon)
  • Google Maps “Qualified Developer” program http://code.google.com/qualify

Create a Simple MoveEnd Event Listener for the Google Earth API

Friday, November 21st, 2008

The Google Earth API provides a rich toolset for developers to create custom content and interfaces within Google Earth’s rich 3D world.  For existing Google Maps developers, many of the Earth API’s methods are similar and previous Google Maps mashups can be ported – but not all.

While working on an upcoming project, we discovered that the current Earth API lacks the nice ‘moveend’ event listener found in Google Maps.  With some pointers from the Google Earth team (thanks Mano!), we developed our own simple ‘moveend’ listener based on the ‘frameend’ event which is supported.

What is ‘frameend’?

frameend is an Earth API event which fires anytime the map image frame is re-rendered (ie when the map view changes).  Unlike the Google Maps ‘moveend’ event, the frameend event fires continuously during a move.  This is great for some applications as it gives a nearly continuous event stream, but doesn’t work so well for functions that you might want to rate limit (like creating custom data based on the view center).

Since we needed to extend frameend in any case, we went ahead and added a few extra parameters that can be adjusted to fine-tune the refresh parameters.  In our new function, you can configure the following:

  • Minimum movement requirements in Latitude or Longitude
  • Minimum zoom change independent of a Lat/Lon change
  • Minimum time since last update to rate limit calls to our follow-on function

Try It Out and Get the Sample Code:

Try it out with our Interactive Google Earth API MoveEnd Event Listener Demo .  You can adjust the default movement thresholds to get a feel for how various settings change the event behavior.  View the page source for a look at the sample code implementation.

Have your own example?  Please drop us a line at feedback@maplify.com so we can feature it also.