Google Geo Developers Blog

Syndicate content
Updated: 15 min 10 sec ago

Debugging KML Balloon Content in Google Earth

6 hours 40 min ago

KML Balloons in Google Earth - starting with version 5.0 - support HTML, CSS, and almost full JavaScript. This can be a great tool for developers looking to add rich content and interactivity into their KML files.

However, it’s not always obvious how to debug that KML content. Google Earth doesn’t have a full set of tools like Chrome Developer Tools. However, it does allow you to view console output, so console.log() output, as well as errors that would normally appear in the Chrome console or Firebug will appear in the console instead. Note, Google Earth does not allow the presentation of system dialogs (namely the functions alert, confirm, and prompt).

Here’s some quick tips on how to get it to work:

  • Linux: Launch Google Earth from the terminal window. Console output will then appear in the terminal window.
  • Mac OS X: You can launch it directly from the command line, “/Applications/Google Earth.app/Contents/MacOS/Google Earth” and read the console output in the command line.
  • Windows: Install DebugView, which is from Microsoft, and look for system messages in the output.

Here's a screenshot from Mac OS X:

Balloon content is rendered by WebKit, and Google Earth currently supports the equivalent of Safari 4.0.4 (which is WebKit-based). If you want to know if a particular JavaScript or CSS feature is supported, one option is to search for it on http://caniuse.com/.

Posted by Mano Marks, Maps API Developer Relations Team
Categories: News

Fab Friday: Autocompleting the week

4 Feb 2012

It’s Fab Friday again! I missed last week, felled by a nasty cold. But you can’t keep Fab Friday down. Just back, I decided to roll out this screencast on Autocomplete in the Places Library of the Google Maps API:

As you can see, there’s a lot you can do with autocomplete.

Continuing my attachment to maps of imaginary places, here’s a map of Skyrim, from the video game The Elder Scrolls V: Skyrim.

The map uses the Google Maps API Custom Map Type to display custom tiles.

I also love tools that allow you to create your own maps, like Harvard World Map. World Map allows you to create a map based on datasets that are provided, and allows you to add your own data layers. You can then embed those maps in other sites or link to them on the World Map site. This example shows population density in China:

Have a good weekend!

Posted by Mano Marks, Maps API Developer Relations Team
Categories: News

Fab Friday: A view from the street

20 Jan 2012

It’s Fab Friday again! This is getting fun, I like doing this. This week’s theme is Street View. First up, Andres Ferrate from Maps Developer Relations (or MDR as some of us are calling it these days) produced this screencast on incorporating Street View and Custom Panoramas into your app. Check it out:

Next up, we have Historypin. Historypin is a site that lets you upload and view historic photos in Google Maps. Better, you can actually view them on top of current Street View imagery. Here’s a screenshot from Florence, Italy:

Finally, there’s the fabulous gta4.net fan site that uses the Google Maps API Custom Street View Panorama API to render Liberty City entirely in Street View. Let me be clear, not the Liberty City of Florida, but the fictitious city in the video game Grand Theft Auto IV. Lots of fan hours went into doing screen capture, let me tell you.

Posted by Mano Marks, Maps Developer Relations team
Categories: News

Introducing pyKML - a Python library for manipulating KML

18 Jan 2012

pyKML is an open source Python library for generating, parsing, and modifying KML, the geo-spatial data language used by Google Earth, Google Maps and a number of other GIS platforms.

I was motivated to create pyKML because I frequently need to visualize large, and often complex, environmental datasets. While the KML language has a wide range of options for styling, annotating and interacting with geo-spatial and temporal data, most programs that generate KML don’t take full advantage of these rich features. I created the pyKML library to address this problem by providing easy, programmatic access to all KML elements.

pyKML facilitates working with large and complex KML documents by leveraging the use of basic programming constructs (looping, branching, etc.). In this regard pyKML is similar to libkml, Google’s open source C++ library, but takes advantage of the highly readable syntax of the Python programming language and the processing capabilities of the popular lxml Python library.

As a simple example, check out this Python script that loops through a text string (“Hello World!”) and uses pyKML to create a series of KML Placemarks. You can download the resulting KML document, and below is a screenshot of how it looks in Google Earth.



This is just a teaser of what pyKML can do. For more complex examples, check out the pyKML documentation and the project’s Google Code site that includes sample code for: generating KML from CSV data, creating KML Tours, and visualizing ephermeris data for Stonehenge (e.g., orientation of the sun on different dates). pyKML can even be used to create “slides" for presentations!



To get started, browse the project’s documentation, install the library, try it out, and let us know what you think!



Posted by Tyler Erickson, Senior Research Scientist / Engineer, MTRI
Categories: News

Fab Friday: Feel the Heat

13 Jan 2012

We’ve been talking a lot recently around the Maps Developer Relations Team about heat maps. Heat maps use colors to represent the intensity of occurrence or certain values. Heat maps are a popular way to represent data. People often ask me how to create them themselves. So the other day when I ran across heatmap.js, with it's nifty Google Maps API Heatmap Overlay, I thought it would be perfect to share with you. Heatmap.js uses HTML5 Canvas to render the heatmap on top of the map. Apparently, it’s in early release, so feel free to help the developer, Patrick Wied out with some patches. Here's what it looks like:

On another note, we recently announced that several college campuses are now available in Google Street View, in areas outside roads. That data is now available to you in the Google Maps API. Here’s the Quad at Stanford:

Finally, if any of you are going to be at Strata, Chris Broadfoot and I will be presenting a workshop there March 1st called Beautiful Vectors. Check it out or just find us and say hi.

Posted by Mano Marks, Maps Developer Relations team
Categories: News

Fab Friday: Happy New Year!

6 Jan 2012

Inspired by Scott Knaster over on the Google Code Blog, I’m starting a new tradition of Fab Friday on the Google Geo Developers Blog. On most Fridays I’m going to post about something cool going on in the world of Google Maps. Nothing formal! So please don’t wear a tie to read my posts.

I’ve got a couple of fun things today. The first one comes from a member of my team, Chris Broadfoot, who put together this great screencast on working with the Styled Maps feature of the Google Maps API:

I also found a cool map you might like. The Domesday Book was the result of a survey in England commissioned by William the Conquerer and completed in 1086. It was a survey of all the landholdings in most of England and parts of Wales. Open Domesday maps this survey. And it also has an API in case you want to play with the data yourself.

I originally found it on Google Maps Mania. I also find cool maps on a variety of sites, including Mapperz and the Google Earth Blog.

Posted by Mano Marks, Maps Developer Relations Team
Categories: News

Using Maps to Optimize School Decisions with DiscoverBPS

22 Dec 2011
This is a guest post by Joel Mahoney, a 2011 Fellow at Code for America. Joel worked with the City of Boston on projects related to public education.

Every year in Boston, parents navigate the school selection process in an effort to get their kids into the best possible public schools. The process is complicated, and, depending on the outcome, can leave parents feeling frustrated and confused. DiscoverBPS was designed to make the process more intuitive, and to help parents make better choices for their kids.

Iteration #1 - Geocoded Addresses
In our first iteration, we used a home address and grade level to identify a student's eligible schools, and then displayed the results on a map. In the screenshot below, the green circle represents the student's "walk zone" (in this case, a 1.5 mile radius appropriate to a 7th grade student), the yellow polygon represents the North Assignment Zone, and the markers represent the schools.



With a little help from Google's Geocoding and Maps APIs, we seemed to be well on our way!

On closer inspection, however, we noticed one school that fell just outside of the walk zone boundary, even though – after zooming in and switching to satellite view – the school campus was clearly overlapping with the walk zone:



Obviously, if our goal was to build a tool to make the process more intuitive, we needed to avoid introducing new ambiguities into the system.

Iteration #2 - School Parcel Shapefiles
To solve the overlap issue, we obtained shapefiles for all of the City's school properties, and used a PostGIS-enabled database to calculate distances between the home address and the nearest point on the school parcel. In so doing, we were able to calculate walk zone distances, which allowed us to properly identify schools with walk zone eligibility:




After a several weeks of deep-diving into the internals of PostGIS mapping, we seemed to be back on track.

Stepping back, however, a new consideration came to light: was it fair to assume that a 7th grader could walk from downtown Boston, across the Charles River, and to a school in Charlestown in less than 1.5 miles? A Google Directions search suggested otherwise (the route below is estimated at 1.9 miles):



If the purpose of the walk zone policy was to determine which schools a student could reasonably get to on foot (and to discourage parents from busing their kids to schools on the other side of town), our walk zone circle began to seem misleading.

Iteration #3 - Walkshed Mapping
In the end, we decided to use an open source project called pgRouting (which extends PostGIS to provide geospatial routing functionality) along with OpenStreetMap to derive a "walkshed" polygon and to calculate street walking distances. We also could have used the Google Maps Distance Matrix API to calculate walking distance, but opted to go with pgRouting based on the need to create the walkshed polygon. These tools allowed us to then visualize the walkshed in Google Maps:



Aside from being noticeably smaller than the walk zone circle, the walkshed conveys a representation of walkability that is customized to the home address. Notice how the walkshed area is confined by bodies of water that are not spanned by any bridges.

DiscoverBPS is now live at www.discoverbps.org. The walkshed map (which would require policy changes by Boston Public Schools) is being considered for use in 2013.


Categories: News

The power of visualization with the Google Analytics API and Google Earth

15 Dec 2011

[Cross posted from the Google Analytics Blog]

Does your organization have several websites, each serving a particular geographic region? If so you know how challenging it is to analyze the data across these regions in a meaningful way.

Visualizations can help, but they can be difficult to design. Newland communities, a developer of residential and urban home communities, manages numerous web properties for each community and is no stranger to these challenges. To address them, Newland used the query tool from ShufflePoint. The tool enabled the combination of data from Google Analytics and Google Earth, allowing Newland to visualize the data in new ways.

ShufflePoint implemented a pilot project after discussing the idea with Chief Ingredient and their client Newland Communities. Their goal: deal with some of the problems associated with clarifying large amounts of data in a visually appealing manner. The outcome of the project was an integration of Google Analytics data with Google Earth.

Using the Google Analytics API, the ShufflePoint query tool extracts metrics by location from Google Analytics for multiple Newland Communities web properties and creates KML representations viewable in Google Earth. The mashup provides advanced visual reporting on location based campaigns, showing their effect on pageviews, and highlighting any anomalies requiring further investigation. Additionally, the visualization is a great fit for promotional videos, or digital signage needs.

“ShufflePoint uses almost every feature and capability of the Google Analytics API. The API has all of the characteristics that a developer could hope for, including great performance, correct semantics, OAuth for authentication, and good community support. The Google Earth based application has given ShufflePoint recognition for doing innovative and challenging things with Google Analytics. This has been beneficial for promoting ShufflePoint’s offerings.” Chris Harrington, CTO

The ShufflePoint application can be found on the ShufflePoint website.

If you’re interested in developing solutions for the Google Analytics platform, visit Google Analytics Developer Program.

Posted by Pete Frisella, Google Analytics API Team
Categories: News

Map data updates for the United Kingdom, Germany, Finland, and Sweden

9 Dec 2011
One of the biggest challenges of mapping the world is that the world is continually changing. At Google we aim to provide fresh, detailed, and accurate maps that evolve at the same pace as the world around us. As a consequence we’re happy to roll out updated maps for the United Kingdom, Germany, Finland, and Sweden, accompanied by the launch of the "Report a Problem" tool for these countries.

The map updates we are rolling out today include a number of improvements, such as more accurate water bodies, and more comprehensive parks coverage. The “Report a Problem” tool allows Google Maps users, and Maps API developers, to notify Google of errors in our map data, with email notification when their error reports have been resolved. For more information, see our announcement on the Google LatLong blog.

As with previous map data updates, it’s important that any data you have cached for these countries that was obtained using a Maps API service such as the Geocoding API be refreshed following this update. Periodical refreshing of cached data will also ensure that you benefit from any updates and corrections that are applied in future. If you have any questions or concerns, please consult the relevant Maps API forum.

Posted by Thor Mitchell, Product Manager, Google Maps API

Categories: News

Four Tips for Improving Your Mobile Web Map App

1 Dec 2011

We've had several new feature announcements for the Google Maps API in the last few months, including high resolution static maps, the new Street View Image API, and the use of high DPI map tiles in the JS Maps API on mobile devices. I'm here to give you some tips for using these new features to improve your existing mobile JS map app .

  1. Upgrade Your App to Use the v3 API
    If you're still using the v2 Google Maps API it's time to change that. Period. This is one of the best improvements you can make to your map app. The v3 Google Maps API was designed for the mobile web and it is significantly faster than its predecessor. Not only is the v3 Google Maps API designed to load fast on mobile browsers, but your app will be upgraded immediately because your map will automatically access high DPI map tiles, which have better on screen fidelity.

  2. Use the Static Maps API to Improve User Experience
    Check your Google Analytics data (or server logs ) to see if your app is being accessed by devices with browsers that can't or don't fully support JavaScript. You can add logic to your app (e.g, server-side user agent checking) to determine whether you should serve your JS Maps API-based app or a static map image that shows the same or similar information. Although your users won't be able to interact with the map, they'll appreciate the ability to view the map. You can even add markers and other features to the static map . You'll also be able to take advantage of the high resolution Static Maps API.

  3. Use StreetView Images to Provide More Context
    Chances are your map app gives users access to all kinds of information, whether it's your own data and images or our very own Places API. Give your users some additional context by using the Street View Image API to provide a general idea of what a location looks like at street level. When you provide a location in your URL request, the API will snap to the panorama photographed closest to that particular location.

  4. Use the JS Maps API Only When It Makes Sense
    If all you need is a small map for context, you should be using the Static Maps API. This may seem obvious, but we've come across a few mobile apps that seem to use the JS Maps API to provide nothing more than a thumbnail. Use the Static Maps API to load a small image and, if needed, link that thumbnail to open up a larger map (whether your own page that uses the JS Maps API or maps.google.com).

And again, if you're still using the deprecated v2 Google Maps API in any of your apps (mobile or otherwise), it's time to migrate your app to the v3 Google Maps API, as we're more than halfway through the three year deprecation period.

Posted by Andrés Ferraté, Developer Relations, Google Maps API

Categories: News

Understanding how the Maps API usage limits affect your sites

23 Nov 2011
Several weeks ago we shared an update about the introduction of usage limits to the Google Maps API. Today I’d like to provide additional details about these limits, the types of sites that may be affected, and as promised, equip you with the means for measuring your site’s Maps API usage.

Usage limits and affected sites

Usage limits are being introduced to secure the long term future of the Maps API, while minimising the impact on developers. We have purposefully set the usage limits as high as possible - at 25,000 map loads per day - to minimise the number of affected developers, while ensuring that the service remains viable going forward. Based on current usage, only the top 0.35% of sites will be affected by these limits, meaning that the Google Maps API will remain free for the vast majority of sites.

We recognise that sites may occasionally experience spikes in traffic that cause them to exceed the daily usage limits for a short period of time. For example, a media site that uses a map to illustrate a breaking news story, or a map-based data visualization that goes viral across social networks, may start to generate higher traffic volumes. In order to accommodate such bursts in popularity, we will only enforce the usage limits on sites that exceed them for 90 consecutive days. Once that criteria is met, the limits will be enforced on the site from that point onwards, and all subsequent excess usage will cause the site to incur charges.

Please be aware that Maps API applications developed by non-profit organisations, applications deemed by Google to be in the public interest, and applications based in countries where we do not support Google Checkout transactions or offer Maps API Premier are exempt from these usage limits. We will publish a process by which sites can apply for an exemption on the basis of the above criteria prior to enforcement of the limits commencing. Non-profit organizations are also encouraged to apply for a Google Earth Outreach grant, which provides all the additional benefits of a full Maps API Premier license.

Evaluating API usage by your site

To help you measure your site’s Maps API usage, we have now added the Maps API to the Google APIs Console. The Google APIs Console is a centralised dashboard for Google’s developer offerings, and we encourage all developers, no matter how big or small your application, to create an APIs Console account.

We are initially introducing the limits for Maps API v2 and Maps API v3 map loads. The Maps Image APIs, and differentiated pricing and limits for Maps API v3 Styled Maps, are not currently included in the APIs Console, but will be added in the future. Once you’ve created an APIs Console account, please follow the instructions in the Maps API documentation to enable Maps API v2 or Maps API v3 on your APIs Console Project, and update your application to provide your APIs Console key when loading the Maps API.

After updating your Maps API application, you will begin to see your usage reported in the APIs Console. Monitor your usage over several weeks, and if your site consistently exceeds the daily usage limits, you will need to respond in one of the following ways:
If you choose to enable billing, you will not be charged until enforcement of the usage limits begins in early 2012. Once enforcement begins, excess usage after your site has exceeded the limits for more than 90 days will be charged to the credit card you provided according to the rates listed in the Maps API FAQ.

We hope this additional information helps clarify the impact that the Maps API usage limits may have on your site, and recommend that you begin using the Google APIs Console to quantify your usage. For more information, please refer to the usage limits section of the Maps API FAQ. For further assistance, we encourage you to visit the the Google Maps JavaScript API v3 forum.

Posted by Thor Mitchell, Product Manager, Google Maps API
Categories: News

Make your map interactive with shape editing and drawing tools

15 Nov 2011
With a paper map, you can truly make it your own by getting out a pen or a pencil, and adding your own annotations to it. You could circle all the museums that you want to visit, or trace the route that you will take on your road trip.

Maps API applications can now offer users this sort of tactile interactivity using the new Drawing Library. The Drawing Library provides a toolbox which enables users to draw markers, lines, and shapes on the map, much as they would in any drawing application. The tools can be used for collecting annotations from users, or for selecting regions to search or highlight. Applications can listen for events when overlays are added and respond accordingly, such as issuing the search query or saving the annotations to a database.

Shapes on a map, including shapes users have just drawn using drawing tools, can also be made editable so that users can modify or correct them. For example, the user could change the bounds for a geospatial query with the drag of a mouse. The Polyline, Polygon, Circle, and Rectangle classes have a new editable property, which toggles the visibility of control points on these shapes.



For more information on using the drawing library and editable shapes, please refer to the Maps API documentation. The Maps API forum is a great place to discuss these new features, or raise any other Maps API issues that you may have. We hope that these new features will result in even greater interactivity for applications built on top of the Maps API.

Posted by Enoch Lau, Software Engineer, Google Maps API
Categories: News

Introduction of usage limits to the Maps API

27 Oct 2011
When the Maps API Terms of Service were updated in April of this year we announced that usage limits would be introduced to the Maps API starting on October 1st. With October upon us, I’d like to provide an update on how these limits are being introduced, and the impact it will have on your Maps API sites.

The usage limits that now apply to Maps API sites are documented in the Maps API FAQ. However no site exceeding these limits will stop working immediately. We understand that developers need time to evaluate their usage, determine if they are affected, and respond if necessary. There are three options available for sites that are exceeding the limits:
To assist in evaluating whether your site is exceeding the usage limits we will shortly be adding the Maps API to the Google APIs Console. Once available you will be able to track your usage in the APIs Console by providing an APIs Console key when you load the Maps API. If you find that your site does exceed the usage limits each day you can opt to pay for your excess usage by enabling billing on your APIs Console project. We will then start billing excess usage to your credit card when we begin enforcing the usage limits in early 2012.

For very popular sites Maps API Premier is likely to be a more cost effective option. It also offers a number of additional benefits, including terms that permit for-fee and internal use, enterprise technical support, a Service Level Agreement, fixed and invoiced annual pricing, and increased quotas for the Maps API Web Services. For more information on how Maps API Premier could benefit your application please contact the Sales team using this form.

We will announce the availability of the Maps APIs in the APIs Console on this blog later this quarter, and provide more details on how to set up an APIs Console account and update your Maps API application with an APIs Console key. We will also provide at least 30 days notice on this blog before enforcement of the usage limits and billing for excess usage begins.

We understand that the introduction of these limits may be concerning. However with the continued growth in adoption of the Maps API we need to secure its long term future by ensuring that even when used by the highest volume for-profit sites, the service remains viable. By introducing these limits we are ensuring that Google can continue to offer the Maps API for free to the vast majority of developers for many years to come.

Posted by Thor Mitchell, Product Manager, Google Maps API
Categories: News