Openlayers and licensing

1,112 views
Skip to first unread message

Paul Degnan

unread,
Aug 21, 2013, 7:34:30 AM8/21/13
to google-map...@googlegroups.com
This question is intended for the Google employees monitoring the list; I was directed to post here with my issue. Sorry if it seems irrelevant to other listers (though it probably won't!)

I have recently gotten the email from Google informing me that my usage has exceeded 25k for three months running. (Which makes sense. My site is seasonal and gets more traffic in good running/biking weather.) 

Looking at the TOS, it seems like any load of of a map *or* the javascript API is counted towards the total. My plan is to switch to Openlayers, and switch the default layer from being a Google map layer to OSM. I still intend to offer Google hybrid and satellite layers since the big G clearly has the best satellite imagery around. But I'm pretty sure that I'm only barely coming in over the limit, and this tweak should have the effect of getting me back below the threshold. I have already gotten the Google layers working in my Openlayers application, and they work great. So a couple of questions:

- I've learned that using a Google layer in Openlayers does not require an API key. I'm not trying to get around Google's fees, but how is it they charge Openlayers users? Could they be just giving OL developers a freebie to support open source? Because that would be rilly rilly cool of them, and I would tweet out to my teeming mass of twitter followers (BOTH of them!) how cool they are for doing that.

- Also, I want to confirm, assuming there will be some sort of charge for using google as a layer in Openlayers, would I be right in thinking I only get charged once a user switches to a Google layer? In other words, if a user stays on the OSM layer the whole time, that shouldn't count towards my Google usage limit, correct?

Rossko

unread,
Sep 14, 2013, 3:49:40 PM9/14/13
to google-map...@googlegroups.com
Things may become clearer if you study just how OpenLayers works with Google tiles.  The Google API is loaded underneath the openlayers code, and used to display Google's tiles - as required by the terms of use.
 
You can use the Gooogle API with or without a key, what service you get depends on that.  Whether or not Openlayers sits on top doesn't affect that.
 
You'd probably want to find out from Openlayers folk if the Google API is loaded when you provide the Google layer option, or when the option is actually selected. (as that will determine when the "billing counter" clicks)
 

Nianwei Liu

unread,
Sep 15, 2013, 5:12:44 AM9/15/13
to google-map...@googlegroups.com
According to this page: http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer/Google/v3-js.html

"To use this layer, you must include the GMaps v3 API in your html."

This means it will not help your count issue. You are still loading Google API even you use Open Street Map mostly.

What you should do is make sure OpenLayers is doing "lazy" loading of Google API, i.e. loading Google API only (and only once) when any of the Google supplied map is viewed. You need to actually modify OpenLayer's core code to do on-demand loading. It takes extra work but should be doable. Google API provide a callback parameter in the API load you can use to invoke any function you intend to call before API load. If you need an example of "lazy" loading, check this: http://gmaps-utility-gis.googlecode.com/svn/trunk/agsjs/src/agsjs/layers/GoogleMapsLayer.js, pay attention to the _initGMaps function.

As Rossko pointed out, key or no key both works, they all have counter.

Eldan Shkolnikov

unread,
Sep 16, 2013, 8:23:41 PM9/16/13
to google-map...@googlegroups.com
Thanks a lot guys!! Your help is really appreciated! I will look into it!!


On Wednesday, August 21, 2013 7:34:30 AM UTC-4, Paul Degnan wrote:
Reply all
Reply to author
Forward
0 new messages