Accessing Google Tile independent from their API in OL3? (possible for paying customer?)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing Google Tile independent from their API in OL3? (possible for paying customer?)

drno
This post was updated on .
Using map from tile providers are common use-case in web mapping: overlaying internally-hosted WMS/WFS layer on top of Google Maps/OSM/Bing Maps. These are easy in OpenLayers 2. However, this feat -especially Google Maps- is not supported anymore in OL3.

The book "OpenLayers 3 Beginner's Guide" page 107:
OpenLayers 2 had some third-party mapping APIs embedded into its core, enabling you to use its maps inside your Openlayers-based application. Nowadays, for better decoupling of OpenLayers API from third-party APIs, the OpenLayers 3 team choose to have no support for other mapping APIs that tie together tiles and an associated JavaScript API library.
Why this decision?
One of the main goals of OpenLayers 3 was to rewrite OpenLayers 2, making its API cleaner. The support for Google Maps API in OpenLayers 2 has also put a significant maintenance burden on both library and application developers, to keep up with changes of the Google Maps API. To avoid this in OpenLayers 3, the support for Google Maps using Google Maps API is nonexistent. However, Google does provide its tiles independent from their API, but only to paying customers. Fortunately, you have more alternatives to Google Maps API (Bing, OSM).


I found this awesome solution in OpenLayers. I tried it myself that it works with OpenLayers 4.1.1 and Leaflet 0.7.7.

Can anyone elaborate more on:
1. how OL3 can access Google Maps tile independent from their API ?
2. whether the above solution in stackoverflow is the answer of my question #1?
3. what sort of payment/contract ? Is it the same with the Google Maps API Premium ?
Reply | Threaded
Open this post in threaded view
|

Re: Accessing Google Tile independent from their API in OL3? (possible for paying customer?)

Andreas Hocevar
The solution you found is illegal. It violates Google's Terms of Use.
I added a comment to that answer on Stack Overflow pointing to the
section of the terms. If in doubt, get in touch with your Google sales
representative to see if you can negotiate a special agreement. But I
know of no one who was able to do that.

Andreas.

On Thu, Aug 3, 2017 at 10:43 AM, drno <[hidden email]> wrote:

> Using map from tile providers are common use-case in web mapping: overlaying
> internally-hosted WMS/WFS layer on top of Google Maps/OSM/Bing Maps. These
> are easy in OpenLayers 2. However, this feat -especially Google Maps- is not
> supported anymore in OL3. The book "OpenLayers 3 Beginner's Guide" page 107:
> OpenLayers 2 had some third-party mapping APIs embedded into its core,
> enabling you to use its maps inside your Openlayers-based application.
> Nowadays, for better decoupling of OpenLayers API from third-party APIs, the
> OpenLayers 3 team choose to have no support for other mapping APIs that tie
> together tiles and an associated JavaScript API library. Why this decision?
> One of the main goals of OpenLayers 3 was to rewrite OpenLayers 2, making
> its API cleaner. The support for Google Maps API in OpenLayers 2 has also
> put a significant maintenance burden on both library and application
> developers, to keep up with changes of the Google Maps API. To avoid this in
> OpenLayers 3, the support for Google Maps using Google Maps API is
> nonexistent. However, Google does provide its tiles independent from their
> API, but only to paying customers. Fortunately, you have more alternatives
> to Google Maps API (Bing, OSM). I found this awesome solution in OpenLayers.
> I tried it myself that it works with OpenLayers 4.1.1 and Leaflet 0.7.7. Can
> anyone elaborate more on: 1. how OL3 can access Google Maps tile independent
> from their API ? 2. whether the above solution in stackoverflow is the
> answer of my question #1? 3. what sort of payment/contract ? Is it the same
> with the Google Maps API Premium ?
> ________________________________
> View this message in context: Accessing Google Tile independent from their
> API in OL3? (possible for paying customer?)
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: Accessing Google Tile independent from their API in OL3? (possible for paying customer?)

drno
Andreas Hocevar wrote
The solution you found is illegal. It violates Google's Terms of Use.
Andreas

I am not surprised if we suspect that such way is illegal. Both free plan and paid plan prohibit it:
* Free plan: (Google Maps Terms of Service, article 10.1.a) https://developers.google.com/maps/terms#section_10_1
* Paid plan: (MASTER TERMS: Google Maps APIs, article 4.1.A) https://enterprise.google.com/maps/terms/apac/premium-maps-terms.html

But if only Google can relax this, there could be great advantage.
Layer from direct access to Google Maps Tiles has visual appearance far better than layer coming from 'Google Maps API' [+]:
* Direct access gives us Google baselayer that 'really-sticks-to-the-map'. User's pan & zoom move the map and Google baselayer follow it with no lag at all
* Google Maps API gives us baselayer that does not stick to the map. User's pan & zoom move the map and Google baselayer follow it WITH noticeable lag.
(Strange thing? I really wish i could show you visually, but I am sure you know what I mean with this 'stickyness'.)

Also, I checked that accessing directly to Google Maps Tiles WITH paid plan is possible: make sure that there's javascript reference to Google eg. <script async defer src="https://maps.googleapis.com/maps/api/js?client=CLIENT_ID&........"></script>.
(I have a Premium Plan)

Hence Maps APIs Credits are still counted, where one refresh (or load) of the page costs 1 Maps APIs Credit.

I think this is kind of win-win solution:
* Google customer (gets better visual quality in OpenLayers (or Leaflet), and
* Google keeps all map usage metered

Now if I were Google I will make direct-access-to-tile available for use but only for paid plan, such that HTTP requests to direct-access-to-tile without paid plan will be rejected.

Also, I observed that Google is the only map provider (to the best extent of my knowledge) that has lag movement during map move (as long as the Google layer comes NOT from direct-access-to-tile). Bing and OSM do not have it.

+] I put quote because I am not really sure how to shortly distinct the two (Direct access to tile VS Google Maps API?)
Andreas Hocevar wrote
If in doubt, get in touch with your Google sales representative to see if you can negotiate a special agreement.
Yes, I agree.