What is the encoding of the data attribute in the new 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?

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.


Need Your Help

Catch multiple exceptions at once?

c# .net exception exception-handling

It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught.

Uploading Image to Amazon s3 with HTML, javascript & jQuery with Ajax Request (No PHP)

javascript html5 jquery amazon-s3

I am developing a website in HTML, javascript &amp; jQuery. I want to upload images to amazon s3 server in an ajax request. There is no such SDK to integrate s3 in Javascript. A PHP SDK is availabl...