Saturday, August 11, 2007

Weekly Google Code Roundup for August 10th

| More

Google Code - Updates: Weekly Google Code Roundup for August 10th


In API and developer-product news...

ExtMapTypeControl 1.1 contains a smarter traffic button. In this week's release of API v2.86, there is a "changed" event for GTrafficOverlay that sends a boolean indicating whether traffic data is available in the current viewport. Using this event, Pamela modified the traffic button in ExtMapTypeControl to behave exactly as the maps.google.com button does. The example below lets you test out the new behavior - pan and zoom out to the other side of the world to see the button disappear.

The Google Mashup Editor has a couple of great new mashups including EarthQuake! which gives detailed information on earthquakes and plots their magnitude on a Google Map. If you are a Sudoku fan, Offline Sudoku will let you play away even when the internet connection isn't there for you, using Google Gears.

Speaking of Gears, Arjun Kalura has created a database sync module that shows the progress of a sync between a remote database, and a local one. The example also uses the worker pool to execute SQL in its own thread and hence keeping the user interface freed up to show the progress report on how the sync process is going.

Also, Uriel Katz announced a new release of GearsORM which adds basic introspection including a model that maps to sqlite_master table.

Around Google

We feel pretty generous with the amount of storage that we give out with our services such as Gmail and Picasa, but we realise that some users would like more so we now offer a way for you to buy more storage if you need it.

Privacy is important to us, and our users. In order to improve transparency we have launched our first experiment to explain basic privacy concepts via video on YouTube.

Joining the Open Invention Network: "You'll often hear members of our open source team say, "Every time you use Google, you're using Linux." It's absolutely true. Check a Google engineer's workstation, and you'll probably find it's running Linux. Do a search on Google.com, and a Linux server will return your results. Ever since Google got its start, Linux has given us the power and flexibility we need to serve millions of users around the world.

In turn, we feel a strong responsibility to the Linux community, and we're always looking for creative ways to put our resources in the hands of Linux developers. That's why today we became a licensee of the Open Invention Network (OIN), an innovative patent-sharing organization founded to create a legally protected environment for anyone who works with Linux."

You will notice that the search results now tell how when fresh content shows up via a small piece of metadata such as "13 hours ago". This is an instant indicator of freshness, which you may, or may not, have weight depending on what you are looking for.

Featured Projects

MapMSG lets you create an electronic note on a map. The note can be in the form of smoke, crop circles, and more.

Walk Score is a mashup that uses the Maps and AJAX Search APIs to show you how friendly your location is for walking.

Google Tech Talks

JSR-305: Java annotations For Defects: This talk describes the current status of JSR-305, Java annotations for software defect detection. This JSR will define several standard Java annotations for properties such as @Nonnegative and @Nonnull that can be used to document your design intentions in a way that be interpreted by multiple software tools.

Open-source-based high-resolution cameras: Andrey Filippov explains the designs and applications of Elphel, Inc. intelligent, network-enabled cameras based on open source hardware and software. Google currently uses Elphel cameras for book scanning and for capturing street imagery in Google Maps.

View more tech talks.

URL: http://google-code-updates.blogspot.com/2007/08/weekly-google-code-roundup-for-august.html

Friday, August 10, 2007

[Gd] You can always go back to where you came from with DragZoomControl v1.1

| More

Official Google Maps API Blog: You can always go back to where you came from with DragZoomControl v1.1


I'd like to thank Pamela for inviting me to post on this blog, and especially for encouraging me to join the Open Source library. I would encourage anyone out there to talk to her if you've written code which may be useful to the Maps API development community.

When Andre Lewis' DragZoomControl was introduced on this blog a few months ago, I was eager to use it in my own Google Maps API app. But I soon thought to myself, "Hey, wouldn't it be nice to able to back out from where the zoom had centered the map?" I looked into DragZoomControl's options and realized that I could implement a back button just by using the many callbacks available. So I did. Then Pamela saw my extension and asked me to put it in the OS library so it'd be available for all developers. So here we are today.

While coding the back button functionality, a few decisions needed to be made. I decided that the function should restore the map context (including map type) to the state prior to the last DragZoom, and that if successive DragZooms are done, then the function should take you back one step at a time (undoing the DragZooms in reverse order).

The simple example below shows the basic function. If you click the magnifying glass button on the map, you will initiate a DragZoom. Click and drag your mouse to create a rectangle and then release the mouse button - the map will zoom in to your rectangle. This is the standard DragZoom functionality. But what you will see on the map now is a new button below the first. This is the back button - click on it to restore the map to its prior state.

Now try several DragZooms in succession, drilling down to a particular area (maybe Central Park). After any number of zoom-ins, you can start clicking the back button and the map will go back in reverse order through all the steps you took.

Simple DragZoom with Back Button Example

Want to add a back button to your drag zoom? You can grab the new code from the 1.1/src folder, or wait two weeks for it to be pushed into the release directory. You can also read through a full set of examples or the class reference. As always, you can post in the developer forum with questions or suggestions.


URL: http://googlemapsapi.blogspot.com/2007/08/you-can-always-go-back-to-where-you.html

Wednesday, August 8, 2007

[Gd] ExtMapTypeControl 1.1: A Smarter Traffic Button

| More

Official Google Maps API Blog: ExtMapTypeControl 1.1: A Smarter Traffic Button

In June, we released ExtMapTypeControl, an open-source map type control that includes an optional "Traffic" button. Some developers were disappointed that the traffic button did not hide and show depending on whether traffic was available in the current viewport, as the button in maps.google.com does.

In this week's release of API v2.86, there is a "changed" event for GTrafficOverlay that sends a boolean indicating whether traffic data is available in the current viewport. Using this event, I've modified the traffic button in ExtMapTypeControl to behave exactly as the maps.google.com button does. The example below lets you test out the new behavior - pan and zoom out to the other side of the world to see the button disappear.

Link to ExtMapTypeControl Example

You can grab the new code from the 1.1/src folder, or wait two weeks for the new code to be pushed into the release directory. This code is also a great starting ground for people looking to make a customized map type control for their sites - here's an example of customizing it for a fake merchant called "The Blue Store". You could also customize it for green, red, or even purple stores. :)


URL: http://googlemapsapi.blogspot.com/2007/08/extmaptypecontrol-11-smarter-traffic.html

Tuesday, August 7, 2007

[Gdev] MapMSG

| More

Google Code - Featured Projects: MapMSG

Screenshot
Author: IntenCT
Google APIs used:
MapMSG lets you create an electronic note on a map. The note can be in the form of smoke, crop circles, and more.

URL: http://google-code-featured.blogspot.com/2007/08/mapmsg.html

Optimisation data for HTML5 parser implementors

| More

Google Code - Updates: Optimisation data for HTML5 parser implementors


Last month, just before I left on vacation, I posted three sets of data to help implementors of the HTML5 parser specification optimise their code. There are several implementations coming along, for example those that are part of the html5lib project and the one behind Validator.nu.

The three sets of data that I posted are all derived from parsing several billion documents from Google's Web search index using a parser I wrote in Sawzall.

The first set of data gives the relative aggregate distribution of invocations of the "in head", "in body", and "in table" insertion modes, for each of the insertion modes. This allows implementors to determine, for instance, that invoking the "in body" code while in a cell must be very efficient, while invoking the "in body" code from the "after frameset" code need not be as efficient, in case the implementor has a strategy that optimises one at the cost of another. See: documentation, data.

The second set of data gives the relative aggregate distribution of tokens for each phase/insertion mode pair. This can help implementors that are using a cascade of if statements decide on the right order for their statements. For instance, the most common token type seen in the "in body" insertion mode is character data, and the second most token is the start tag token for an a element, but the isindex start tag was almost never seen. This tells implementors that they should check for characters and a start tags long before checking for isindex tags. See: documentation, data.

The last set of data examines the number of attributes per element. It allows implementors to decide on the optimum memory allocation strategy for attributes. For example, since most elements have 9 or fewer attributes, the data structure that stores attributes can be optimised for simply having 9 attributes, using little memory, and if an element has more than this number of attributes, the implementation can switch to a separate implementation that is more memory-heaving but is optimised for large numbers of attributes. See: data.

I hope this data is useful!

URL: http://google-code-updates.blogspot.com/2007/08/optimisation-data-for-html5-parser.html