Posted:

In the first release of MapIconMaker, we gave developers the ability to create dynamically resized and colored marker-shaped icons. Now with the second version, we're adding two entirely new types of customizable icons. The table below (stolen blatantly from the documentation) compares the three available functions. To get more of a feel for everything that's possible with all the icons, play around with the updated wizard.


createFlatIcon The icons can be dynamically sized and colored, can be either circular or rectangular in shape, and can have text overlaid on them. They will appear to lie 'flat' on the map because of their shape.
View example (createflaticon-simple.html).
createLabeledMarkerIcon The icons can be dynamically colored and can have text overlaid on them, but can only be one shape and size (marker-shape, 32*32). They can optionally have a dynamically colored star attached to the corner.
View example (createlabeledmarkericon-simple.html).
createMarkerIcon The icons can be dynamically sized and colored, but cannot have any text overlaid on them.
View example (createmarkericon-simple.html).

As a demo of what kind of maps are possible with the new icons, I've created a gadget that uses the Visualization API to pull rows of U.S. address data from a Google Spreadsheet, clusters the rows based on what state code I find in the address (yay for RegEx!), and then creates icons for each state cluster that are dynamically sized and labeled according to the size of the cluster. As an added touch, I overlay a transparent state polygon on marker mouseover, and I change the color of the marker and polygon on marker click. Much thanks to the 2008 Election Trends map for inspiring the UI and making its code and states data available.

Check out the demo map below, and if you're inspired yourself, read through the MapIconMaker reference and documentation (or code - it's open source!).


Posted:

A lot of map mashups out there have country-wide or world-wide content. That's awesome because it means there's something for everyone. What's not so awesome is that it means that when I get to the map, I often have to spend some time panning and zooming until I'm in my hometown and seeing the local content I'm most interested in. And as you know from previous posts, I'm inherently lazy and get bored whenever I'm forced to engage in unnecessary mouse movement. Wouldn't it be better if the map could automatically center to my location without me lifting one of my precious fingers? The answer is yes, and now it's easier to do than ever with the introduction of IP-based location information in the AJAX APIs framework.

To add user-based centering to your map mashup, follow the steps below.

  1. If not using it already, include a <script> tag for the AJAX APIs common loader. Call google.load("maps", "2").
  2. Once the Maps API has loaded, check if the google.loader.ClientLocation object has been defined. If so, you can use the latitude/longitude and city/state/country information from it to center the map and display the sensed location to the user.
  3. If the ClientLocation object is null, just center your map as always. Not all IPs can be located, so you'll want a good fallback behavior.

Check out the example implementation below, but feel free to make your own implementation snazzier (perhaps by adding a GControl to let the user easily jump to their location):

For more information, read the docs on using the AJAX Loader and using ClientLocation, or post in the AJAX APIs group with questions. If you're developing a mobile website and want a more precise location for your users, check out the GeoLocation module in Gears.

Posted:

Before we release a new version of the Maps API, we always run it through a huge bank of tests to make sure standard functionality is working. But one thing we've realized since releasing the Maps API and watching its adoption is that it can be used in ways that we never imagined - and subsequently, ways we never thought to test.

So we figured the best solution would just be to let you, the creative developers, tell us exactly what functionality you want tested - by adding your own tests. We've open sourced our integration tests and are now ready to accept contributions. Our infrastructure allows us to run these tests on the stable, current, and bleeding edge versions of the API, so that potential problems can be discovered long before they are out in the wild.

The tests we have released use Selenium. Selenium is an open source tool for automating tests of human-browser interaction. It runs in a range of browsers, so by its very nature it takes into account browser discrepancies. As an added benefit, developers can run tests by simply going to a url and clicking a 'run' button!

The screenshot below shows our basic test running (and passing, whee!):

Note that we have hundreds of non-Selenium unit tests for expected functionality, but we're not releasing those just yet as they're more tightly coupled with Google infrastructure.

For information on running and contributing tests, read the project wiki. Thanks for reading, and we look forward to your contributions.

Posted:

Good arvo from Sydney, Australia, where it's beautiful even in the dead of winter and the people use contrived abbreviations for literally everything. I kid, I kid. Australia is great, and the vegemite is even greater. I've spent my winter internship (also called a "summer internship" for my compatriots above the Equator) working on the Google Maps API for Flash, which was released back in May. If you're like me, you might think that Flash is a tool for creating amateur cartoons of questionable legality after school. Friends, I assure you -- it's so much more.

JavaScript developers have reaped the benefits of driving directions in the Google Maps API for over a year now, but without them Flash developers have endured three long months of repeatedly getting lost. As someone who accidentally drove into Oklahoma for well over an hour before realizing that his roadtrip only involved Texas, I feel your pain, Flash folk. But worry no longer, for I bring good news. It has been my pleasure to rectify this disorientation dilemma and bring the enormous utility of driving directions to our Maps API for Flash, starting with version 1.6.

The interface for the Flash API's Directions class closely resembles that of the JS API's GDirections class. You still create a Directions object, optionally listen for load/fail events on it, and then call the load() method with a directions query. The Directions object contains all the response information as Route and Step objects, also like the JS API. The awesome thing about Flash is that you can then include all sorts of animations and movie clips to complement the directions in your application. Consider the following application which uses a penguin to show you how to get from the Alamo Drafthouse movie theater to Waterloo Records in Austin:




Sure you could probably whip that up in a JavaScript application, but envision this scenario: an animated car traverses the route of your roadtrip; your videos are overlaid onto the map at their original shooting locations; and your meticulously selected playlist of driving music plays chronologically in the background. And that, my friends, is the power of Flash.

Posted:

Hi, I’m Sterling Quinn and I work on the development team for server-based GIS technologies at ESRI in Redlands, California. We’re happy to report that ESRI software users can now expose their GIS in Google Maps through the recently-released ArcGIS JavaScript Extension for the Google Maps API. The extension is built on the Google Maps API and is designed to communicate with ArcGIS Server, ESRI’s product for serving GIS functionality on the Web.

The ArcGIS JavaScript Extension for the Google Maps API allows you to maintain the user-friendly front end of Google Maps while tapping into an advanced GIS on the back end. You can use the extension to display your own maps on top of Google’s, query features in your database and display them on the map, or expose tasks that run GIS analysis models on the server. You can display your results using the Google Maps API’s native graphics engine and info windows.

To learn how to use the ArcGIS JavaScript Extension for the Google Maps API, use the online SDK, which contains basic concepts, an API reference, and examples of how to create custom maps and Mapplets. The examples contain detailed descriptions on how to do things like adding an ArcGIS Server map type button, displaying query results as KML, or running a task on the server to return a route and elevation profile.

Following are some quick links to example Mapplets built with the ArcGIS JavaScript Extension for the Google Maps API. For those of you who don't know, Mapplets are mini applications that you can add to Google Maps in the “My Maps” tab and are nifty because a user can enable multiple Mapplets at a time.


Cached Map Service

Displays an ArcGIS tiled map service over the Google base map.

Census Block Query

Retrieves US Census data from an ArcGIS map service at a point you click and displays it in a series of charts created with the Google Chart API.

Message in a Bottle

Uses an ArcGIS geoprocessing service to tell you where a bottle would drift if you dropped it in the ocean.

Service Area Analysis

Uses an ArcGIS geoprocessing service to display drive time polygons from a point you click.

Posted:

This has been a busy week! We've released four new resources to help you with the Google Earth API.

  • We've updated the Google Earth API reference. While there haven't been substantive changes to the API, the new reference is much more complete, and, I must say, more attractively laid out.
  • We also released a Google Code project with sample code from the Google Earth API. So far, we have the driving simulation that Roman blogged about, Earthpad, a sample application running on top of Google App Engine, GWT Earth, which uses the Google Web Toolkit to produce an Earth API application, and Stereo, which allows you to view the Earth in stereoscopic 3D.

    We also released a number of samples which demonstrate small examples of code for the Earth API. Everything in the project is under Apache 2.0 license, so feel free to borrow it for your own.

  • We've created a new page to help you track changes for every release of the Earth API. On this page, you can find the latest bug fixes and API changes. We plan a new release about once a month, though there's no rigid time table.
  • We've created a list of Frequently Asked Questions about the Earth API.
We're pretty excited, on the Geo APIs team. I hope you find these resources helpful. As always, if you have any questions, or want any help, check out the Earth API developer forum.

Posted:

Howdy, y'all. My name is Roman Nurik and I'm a newly minted member of the Google Geo APIs team. Some of you may already know me from the Earth Browser Plug-in Google Group. I recently started at Google's headquarters after 4 years at Boston University studying Computer Science and Marketing. My task here at Google is to help you all become experts with the Earth API and KML. In about 5 minutes, you'll realize how psyched I am about it, too.


First Impressions of the Earth API

Back in May before I joined the team, I remember reading one day that Google had released an Earth browser plugin. It really felt like a great moment; finally, immersive and lifelike exploration of geographic content was available to end users on the web, for free. Web developers were also given a cutting-edge tool to marry their existing geo-aware web apps with Google Earth, in all its spherical 3D glory (Maps/Earth integration mode ala G_SATELLITE_3D_MAP).

A few days after I started at Google on the Earth API team, I found a video of Paul Rademacher's Google I/O talk introducing the plugin. It got me thinking—if we can do fun stuff like drive a milk truck around a city crowded with 3D models of real buildings, and fly said milk truck off of our favorite local mountains, can we take this first-person-driver (FPD) concept and apply it to a more real-world problem? The problem of, say, familiarizing yourself with a new driving route before embarking on it in real life? The answer was clear: of course we can! And in that moment, the idea of an Earth plugin driving directions simulator was born!


The Google Earth Plug-in Driving Simulator

After a surprisingly short time fiddling with the Earth and Maps APIs, the first version of the simulator was up and running. Pamela Fox and Mano Marks contributed some ideas and suggestions and the app grew rapidly! Today, I'd like to share the final result with all of you: the Google Earth Plug-in Driving Simulator. Please give the app a spin! Since the plugin currently only supports Windows, users who prefer Mac and Linux will need to borrow a Windows machine. Also, special thanks to the talented artist who contributed the Smart car model used in the app to 3D Warehouse.

Some screenshots (because 3 pictures are worth three thousand words):

Drive Simulator Screenshot 1 Drive Simulator Screenshot 2 Drive Simulator Screenshot 3

The driving directions backend is powered by the GDirections API, which IMHO is a rock star. I also used jQuery, one of my favorite JavaScript libraries, to take the brunt of the work out of Firefox and IE compatible DOM manipulation.

If you have questions on how everything comes together, definitely post them to the previously mentioned Earth plug-in group and I'll be sure to clear things up.


Thanks for reading!

I've had a great experience writing this small app and I'm really psyched to help you all get pumped up and ready to code with the awesome new Earth API. For those of you who haven't tried it out yet—what are you waiting for? As with all of our APIs, the developer community is growing and providing free support at the Earth Browser Plug-in Google Group if you run into trouble. We'd also love to see the cool stuff you're working on!

Thanks for reading; have fun with the driving simulator app! Even more so, have fun with the Earth API! And as always, stay tuned to the Geo Developers blog for more Earthy goodness.