Tag Archives: Geo

I/O session live: Building geo services that scale

Posted by Laurence Moroney, Developer Advocate at Google

While at Google I/O, l had the opportunity to present the session ‘Building geo services that scale’. I’m pleased to share it more broadly for those of you who were not able to be there in person:
Building geo services that scale
Not all map and geo applications run entirely on your mobile device. Perhaps you want to protect your keys or other API access data from reverse engineering by putting them in the cloud, or you have custom business logic that you run on your server that you don't want to distribute via mobile. To protect your keys and API access data you'll need to operate some kind of service. In this session you'll learn how to build that service on the Google Cloud Platform and consume it in a mobile application that uses the Google Maps APIs.
DSC_3206 (1).jpg

author image
About Laurence: I am a Developer Advocate at Google, working on mobile services, specializing in cross-platform developer technologies. As the host of 'Coffee with a Googler' on the Google Developers channel I’m able to meet with some of those most creative and inspiring developers at Google and learn about the projects they’re leading. When I’m not Googling, I’m involved in many things, including working on the revival comics for the Stargate TV shows, and enjoying the geek cred that this brings.


Behind the Australian Elections Map: Mapping democracy in real-time

It's elections time in Australia! With 94% of eligible Australians registered to vote, there will be close to 15 million participants this year.

Googlers in the Sydney office were recently chatting about the upcoming election and realized we all had similar questions: what were the results last cycle, where are the closest polling stations, and where do we look for real-time results on election day? Friends and family were asking the same questions, so we decided to build a solution using Google Maps APIs, Firebase, Google App Engine, Google Cloud Compute, Angular 2, the Google Translation Toolkit and Go.



The aim of the election map was to provide all the information that Australians would need to participate in the voting process. We wanted to cover pre-, mid- and post-election needs, including:

  1. A polling place locator with searchable addresses, suburbs, and electorates
  2. Directions and navigation to the polling places, accessible via the election map
  3. Real-time election results once polling has closed and counting has started
  4. The ability to share and embed maps.

UX mockup: map and fake election results using testing data

The pre-election map displays static electorate data, polling booths and ballot papers. It also indicates who won the electorate in the last 2013 election. To do this, we sourced 2013 election data from the Australian Electoral Commission (AEC) and stored it in a Go application intended for Google App Engine so that it could be served to the website frontend. The AEC provided us with data about electorate boundaries and polling place locations.

The website frontend was built using Angular 2 and we've used several open source projects, including GDAL, mapshaper and a point clustering library. These libraries allowed us to send only the required details for a user's viewport, while keeping data usage reasonably low and reducing visual noise.

Polling location information with address and directions intent
Day-of website visitors will have the ability to search for polling stations and learn about what services are available at each location (accessibility, sausage sizzle and/or cake stand). We sourced the sausage sizzle and cake stand data from Democracy Sausage and Snagvotes. We used the polling place ID to match these to the AEC polling place identifiers. We built a small Google Compute Engine app which sources the data from our sausage sizzle data sources and broadcasts it out to our live web application using Firebase Realtime Database.
Autocomplete searches for polling locations
To enable the search functionality, we use two different services in parallel. We first attempt to match the search query against the electorate list on the client. We also use the Google Maps Javascript API Places Library with Autocomplete to provide suggestions of what users might be searching for, including suburbs, places of interest and addresses. This gives our users the ability to select recommendations instead of having to type full queries.

Voters also need to plan their trip to the polling booths. We relied on Google Maps' existing real-time traffic information and turn-by-turn directions to provide directions functionality.

After 6pm on election night and when votes begin to be counted, we will switch the site to show real time election results. To do this, again we are using the AEC data feed and Firebase Realtime Database.

To make it really easy for people to visualize the elections results we employed a hemicycle (half donut circle) in the left sidebar to display real-time results. We also added "share" and "embed" features so people and media can easily share information about the election.

This project was put together by a cross-functional group of Google volunteers including software engineers, UX Designers, product managers and the legal and marketing teams. We'll all be voting on July 2nd, cake in hand. See you at the polls!

About Taylah: I am an Associate Product Manager at Google’s Sydney office where I work on Google Maps for Android Auto. I love working on Google Maps as you get to help millions of people explore the world every day. When I’m not at work, I love exploring beautiful places, shopping in thrift stores, painting and spending time with my family and friends.

Marker zIndex and more come to the Google Maps Android API

Released today, the latest version of the Google Maps Android API includes several popular developer requested features including the ability to order the display of markers on the map with the new marker zIndex property, the ability to set the transparency of your tile overlays, and a new circle click listener.

Marker zIndex

Marker zIndex is one of the most requested features on our issue tracker - today's release gives you the ability to control the order in which markers are displayed on the map [Issue 7762]. This gives you control over which tap target your user is most likely to hit by setting the zIndex property on each marker. The markers are drawn in order of the zIndex, with the the highest zIndex marker drawn on top.


animated image with cars moving over a plane

animated image with cars moving under a plane thanks to zIndex

Before: No control over the marker zIndex. The plane will be obscured by some of the cars. After: The zIndex of the plane is set to be the highest. The plane is now always visible on top.

Tile overlay transparency

Just like ground overlays, you can now set the transparency of your tile overlay to allow the basemap to show through [Issue 4765].

Circle clickability

Just like polylines and polygons, apps compiled with the latest release can now have circle clickability via the OnCircleClickListener. You can enable or disable the clickability of circles by calling setClickable(boolean) on the relevant circle.

getMapAsync() now required

In December 2014 we deprecated getMap() in favor of getMapAsync(). From this release onwards, you'll need to use getMapAsync() in order to compile your apps. Note that existing apps in the wild on your users' devices won't be impacted by this change as the getMap() method still exists within the Google Play Services APK that is delivered to Android devices.

If you haven't already done so, follow these steps:

Here's a sample fragment using the deprecated getMap(), with a fictitious doStuff() method that would implement the fragment's initial logic:
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;

public class MainActivity extends FragmentActivity {

    private GoogleMap mMap;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
        doStuff();
    }

}


The above however was error prone, since getMap() could potentially return null. Here's the same sample using getMapAsync():

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;

public class MainActivity extends FragmentActivity implements OnMapReadyCallback {

    private GoogleMap mMap;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap map) {
        mMap = map;
        doStuff();
    }

}

You can see we now implement the OnMapReadyCallback interface which defines the onMapReady() method, which will be called when the GoogleMap instance is ready. We’ve also moved the call to the fictitious doStuff() method into onMapReady(), since this is where we now want to start the fragment's initial logic.

A big thank you to Android developers everywhere for using the Google Maps Android API and submitting feedback via the issue tracker.

Our release notes contain details of bugs fixed, deprecation notices, as well as the features mentioned in this post. Take a look and start using our new features today!



Posted by Megan Boundey, Product Manager, Google Maps Mobile APIs

Building for Scale: Updates to Google Maps APIs Standard Plan

Eleven years after a developer first reverse-engineered a Google Map, there are more than three million location-informed apps and websites generating billions of requests daily, all powered by Google Maps APIs. From unicorns to passion projects to public service, the power of maps and location data is limited only by the creativity of developers.

The Internet landscape has dramatically shifted from desktops to mobile devices in the last decade, and as a result, our services have evolved to meet the needs of our developers and their users. More devices means exponentially more requests, and hundreds of millions of global users are just coming online. Therefore, today we are announcing a few updates to bring more simplicity and consistency to our Standard Plan limits and pricing.

As of June 22, 2016 we are making the following changes to the Google Maps APIs Standard Plan:

  1. We no longer support keyless access (any request that doesn't include an API key). Future product updates are only available for requests made with an API key. API keys allow us to contact developers when required and help us identify misbehaving implementations.
  2. We have implemented a simple 25,000 map loads per day free limit to new Google Maps JavaScript API, Static Maps API, and Street View Image API implementations. The confusing 90-consecutive-day grace period for these APIs is being retired on October 12, 2016. With this change, developers can predictably plan for growth while media sites and US nonprofits can request more quota at no charge via our dedicated support programs.
  3. We have reduced the daily map load maximum limit you can purchase for Google Maps JavaScript API, Static Maps API, and Street View Image API from 1,000,000 to 100,000 requests per API.* We believe higher-volume developers are best served with a Premium Plan license, which includes technical support and a Service Level Agreement, and with this change we've also created consistency between Standard Plan quotas across our maps and web service APIs.
  4. We now count Google Maps JavaScript API client-side requests towards the daily limit of the associated web service API.*

The new policies will apply immediately to all Maps API implementations created on or after June 22nd, 2016.

Existing applications have been grandfathered based on their current usage to ensure that they continue to function both now and in the future. We will also be proactively contacting all existing API key users who, based on usage growth patterns, may be impacted in the future. If you’re an existing user, please take the time to read our Policy Update for Standard Plan summary for details on how each of these changes might affect your implementation.

Posted by Ken Hoetmer, Product Manager, Google Maps APIs

* Exceptions may apply for implementations that were exceeding new quotas prior to June 22, 2016.

Learn about developing geo applications over coffee with Ankur Kotwal and Ken Hoetmer



While at Google I/O, I had a chance to sit down for a cup of coffee with Ankur Kotwal, Developer Advocate at Google and Ken Hoetmer, Product Manager for the Google Maps APIs. Both had an interesting perspective on how maps have evolved and where they are headed.

In Ankur’s session we discussed technologies beyond the visualization aspects of maps, including the Directions API, Places API and Roads API. He highlighted innovative ways developers are using Google Maps APIs including VR, marker clustering and heatmaps. We also spoke about Santa Tracker, which Ankur has been a part of for four years (he also revealed what Santa likes to do during his time off). Ankur announced the new Google Maps APIs Beta program, so if you have not signed-up, head over to the site to apply.

Learn about developing Geo applications over Coffee with Ankur Kotwal

While speaking with Ken, we discussed how he started working with maps and the Google Maps API as well as how he eventually landed at Google on the Sydney maps team. Ken spoke about how use cases have evolved from interactive maps to more powerful applications and insights driven by location information made available through the APIs. He shared details about some newer APIs including native iOS and Android Places API, Roads API, Directions API and Predictive Travel Time (estimating travel time and routes based on now or in the future). He also highlighted some notable location-based intelligence use cases including Uber, GoJek, Dash Labs and the city of Sydney.

Google Maps APIs and Coffee with Product Manager Ken Hoetmer

About Laurence: I am a Developer Advocate at Google, working on mobile services, specializing in cross-platform developer technologies. As the host of 'Coffee with a Googler' on the Google Developers channel I’m able to meet with some of those most creative and inspiring developers at Google and learn about the projects they’re leading. When I’m not Googling, I’m involved in many things, including working on the revival comics for the Stargate TV shows, and enjoying the geek cred that this brings.

More descriptive JavaScript console error messages



Over the past few months we've rolled out several JavaScript console error message improvements designed to help developers implement Google Maps JavaScript API into web apps. Our goal was to:

  • Give developers more descriptive error messages
  • Provide developers with a suggested solution to resolve the error
  • Avoid popups for displaying error messages
  • Create a positive experience for end-users in the event an error occurs

How do developers usually use the JavaScript console? When? Why?
Web developers use browser tools to develop and debug their applications. They can find various messages in the JavaScript console to which their application, libraries or APIs write. For users of our Google Maps JavaScript API, we have returned error messages in the JavaScript console for some types of Maps API errors. But, these messages were often not descriptive enough for web developers to investigate the issue and find solutions.

What happened when users saw the old error messages?
Our previous popup error messages showed up on the top of the web page. This JavaScript alert prevented users from interacting with the page until the “OK” button was clicked, even if they were not interacting with the map. We served 4 basic error messages that pointed to the general troubleshooting page of our website.
Error_message.png

What do developers and users see now?
We now display 21 different error messages in the console —you can see the full list in our developer documentation. In addition, we've provided direct links from specific errors to self-service solutions on the developer site. We've also simplified the error messages displayed to end users -the improved error appears in the map div itself, allowing users to interact with the rest of the page even if the map load fails.
JS Console error message.png

We hope these changes will improve your implementation and interactions with your end users.

I’ve been a Technical Solutions Engineer at Google for 6 years. I enjoy working on the Google Maps APIs because there is always a new discovery on maps. Outside of Google, I love beer, especially after skiing in the mountains.
mizba.jpeg

Google I/O session live: Streamlining developer experiences with the Google Maps APIs



While at Google I/O, Laurence Moroney and I had a chance to present our session titled ‘Streamlining developer experiences with the Google Maps APIs’. We’re pleased to share it more broadly for those of you who were not able to be there in person:
Streamlining developer experiences with the Google Maps APIs
The Google Maps APIs provide a seamless experience for developers of all levels. Some want to offer a map or directions but don't want to build these things themselves; this can be achieved with just a few lines of code. Other developers prefer to integrate natively with off-the-shelf widgets. Finally, some developers want complete control over every aspect of the presentation. This session highlights the Maps APIs that represent the full gamut of the developer experiences, enabling you to get going immediately and scale as necessary. You'll see how widgets and services can be added over time with a suite of Maps APIs, services and libraries.
I am a Developer Advocate at Google experienced in building on Android and the Google Maps API. I am based out of the Google Sydney office and lead the Geo Developer Relations & Next Billion Users Developer Relations team to inspire developers towards building on the Google developer platform. When I’m not at Google inspiring other developers, I enjoy spending time with my kids.

Introducing the Google Maps APIs Udacity course



The Google Maps Operations team gets to work with thousands of developers each year to create great user experiences and powerful analytics built on maps and location data. We drew from these experiences to create a brand new Google Maps APIs course, in collaboration with Udacity, that teaches developers best practices when using our web APIs.
Google Maps 03.jpg

The new course, available today for free, gives you step-by-step tutorials that demonstrate how to integrate maps and location features into your website, and how to get useful location related data using various Web Service APIs.

You’ll walk through building a real-estate listings site using a uniquely styled Google map, data visualization, and street view panoramas. You’ll practice developing location-related features: calculate distance between locations, get directions, and view places of interest data.
You’ll also see other examples of Google Maps APIs in action and learn how to secure and monitor your deployment using the Google APIs Console. At the end of the course, you’ll have built your first map-enabled site and be ready to create your own projects using location data, services, and maps!

Whether you’re new to Google Maps APIs or just want a refresher, head over to Udacity to learn about how to start adding location features and map visualizations into your websites, today!

I happily joined Google in September, 2015. I love working with the Google Maps APIs because they are easy to build with and enable end users to have an intuitive, familiar experience in any site or app. Outside of Google I like to play Zelda, eat pizza and drink coffee with my dog.
thumb_IMG_0219_1024.jpg

Google I/O session live: Understand your Place in this world



At Google I/O, Ravi Palanki, Android Place API technical lead and I presented our session titled ‘Understand your Place in this world’. Even if you were not able to attend Google I/O in person, you can now watch our session:
Understand your Place in this world
Humans navigate a world made up of places with names, addresses and phone numbers—not lat/long coordinates. The Google Places API enables an app or website to present location data to users in a human-centered fashion. In this session we shared how you can use the Places API to discover your environment. I walked the audience through the main use cases and Places API functionalities, across mobile and web. We also showed off some newly-released mobile widgets, and Ravi did a deep-dive into the benefits of the mobile platform, such as optimization for mobile device battery life and increased device accuracy. This session is a great starting point to learn how the Places API can make all your apps -- not just map-centric ones -- smarter.
IMG_20160519_093436.jpg
With the Google Places API you get data from the same database used by Google Maps and Google+ Local. Places features more than 100 million businesses and points of interest that are updated frequently through owner-verified listings and user-moderated contributions.
  • Use the power of mobile to give your users contextual information about where they are, when they’re there with the Places API for Android.
  • Search for and retrieve rich information about local businesses and points of interest, available on every screen with the Places API Web Service.
  • Add autocomplete to any application, providing type-ahead location-based predictions like the search on Google Maps.
IMG_20160519_090128.jpg
I am a product manager on the Maps API team. In my role, I focus on the Places API across all platforms and geographies. When I’m not at Google, I love running coastal trails, playing the piano and enjoying the fantastic lifestyle in Sydney!

One Day in at Google I/O



Day 1 done! We had a great first day at Google I/O—more than 800 developers visited our Geo sandbox to check out apps, play with 360 degree cameras and most importantly, chat with our engineers, product managers, and developer advocates about the apps they’re building.
IMG_6610.JPG

The Geo sandbox features Sugarbear, a 1959 PD-4104 General Motors Coach that measures 35’ long by 8’ wide with a diesel engine outfitted for biodiesel. Sugarbear made an epic trip across the USA after last year’s I/O and we’ve brought her back this year for more demo fun. You can engage with interactive maps experiences and check out customer applications inside the bus. Climb Yosemite's El Capitan, calculate your solar potential with Project Sunroof, and see how Nest and the Environmental Defense Fund use location data to make our lives better. Sugarbear also features Google Maps APIs customers Trucker Path, Zendrive, Postmates, GTX Corp and Vagabond.
2016-05-18-1.jpg

The Google I/O event shuttle buses are also being tracked and visualized in real time by an app we built using Firebase and Google Maps APIs. Within the Geo sandbox you can check out the app on the big screen and chat with the developers about how it works on the inside (hint: ask for Brett).

Geo also hosted one session yesterday: Location and Proximity Superpowers: Eddystone + Google Beacon Platform and we have several additional sessions on Thursday and Friday, including Understand your Place in this world and Building geo services that scale.

Finally, don’t forget about our office hours—scheduled for Thursday, May 19 at 4pm. We’ll be in the tent for an hour...bring your Maps and Location questions for our Product Managers and Developer Advocates.