Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the encoding of the data attribute in the new Google Maps?

Tags:

google-maps

The new Google Maps have URLs that look like this:

https://www.google.com/maps/search/coffee/@37.0625,-95.677068,4z/data=!3m1!4b1

Obviously the search term is "coffee" and @37.0625,-95.677068,4z is the lat, lng and zoom; but what is data? I.e. what encoding is !3m1!4b1?

like image 491
Daniel Dimitrov Avatar asked Apr 02 '14 10:04

Daniel Dimitrov


People also ask

What is Google Maps coded in?

Like many other Google web applications, Google Maps uses JavaScript extensively. The site also uses JSON for data transfer rather than XML, for performance reasons.

What type of data does Google Maps use?

Well then, how much data does the Google Maps app download per hour? The short answer. In the standard mode, the Google Maps app consumes about 5-10 MB every hour, both on Android and iPhone.

Did Google Maps change their format?

Google Maps is being redesigned to make it easier to distinguish between natural features in the environment, whether they're mountainous ice caps, deserts, beaches, or dense forests.

Where does the data for Google Maps come from?

The search giant collects data from satellite imagery, cameras at traffic signals, GPS on mobile phones and many other real-time data sources. The collected data is fed into real-time data analysing tools that turn it into accurate information for their users.


1 Answers

I've never seen this encoding, I guess it's something proprietary by Google. There are some hints about the structure though. I clicked on "embed" and got a longer url, with the same syntax:

<iframe src="https://www.google.com/maps/embed?pb=!1m12!1m8!1m3!1d26081603.294420473!2d-95.677068!3d37.0625!3m2!1i1024!2i768!4f13.1!2m1!1scoffee!5e0!3m2!1sde!2s!4v1404930797899" width="600" height="450" frameborder="0" style="border:0"></iframe>

The ! char is quite likely a separator. For better readability, some line breaks:

https://www.google.com/maps/embed?pb=
!1m12
!1m8
!1m3
!1d26081603.294420473
!2d-95.677068
!3d37.0625
!3m2
!1i1024
!2i768
!4f13.1
!2m1
!1scoffee
!5e0
!3m2
!1sde
!2s
!4v1404930797899

The pattern seems to be !<id><data type><value>.
Some of the data types we see here: s is a string, b is boolean, i is integer, d is double, f float.

Now this is just a guess, but I think m is a container and there is the pattern that !<id>m<X> is followed by X parameters. This way similiar values are grouped, the IDs are unique and in ascending order on each level:

!1m12
  !1m8
    !1m3
      !1d26081603.294420473
      !2d-95.677068
      !3d37.0625
    !3m2
      !1i1024
      !2i768
    !4f13.1
  !2m1
    !1scoffee
  !5e0
!3m2
  !1sde
  !2s
!4v1404930797899

Another example, after clicking on a random coffee shop. I've tried to identify some of the values.

!1m14
  !1m8
    !1m3
      !1d3101.011519367493   // zoom level
      !2d-94.59454913903049  // longitude
      !3d38.99223345944582   // latitude
    !3m2
      !1i1024                // looks like some screen resolution,
      !2i768                 // but never changes
    !4f13.1
  !3m3
    !1m2
      !1s0x0%3A0xaf8a57446f312899
      !2sOne+More+Cup        // business name that I clicked
  !5e0
!3m2
  !1sde                      // language (german)
  !2s
!4v1404933052643             // timestamp

So if this is somewhat right, your example !3m1!4b1 is a boolean value.

like image 159
kapex Avatar answered Sep 21 '22 08:09

kapex